Novalnet - Version 10.0.0

Version Notes

- Novalnet Merchant API configuration has been globally implemented.
o On-hold transaction configuration.
o Merchant script notification mail configuration.
o Auto selection of last successfull payment.
o Merchant can set up their Referrer ID.
o Proxy server configuration.
o Merchant can define their gateway timeout.
- Auto-fill for payment data (Direct Debit SEPA).
- Fraud prevention through PIN by Callback/SMS/E-Mail. (For Credit Card, Direct Debit SEPA & Invoice).
- Integrated "AMEX card type".
- Subscription management.
- Order and transaction management.
- Implemented "Extension" features
o VOID & CAPTURE option for on-hold transaction payments (Direct Debit SEPA, Credit Card, Invoice & Prepayment).
o Refund option for the payments (Credit Card, Direct Debit SEPA, Invoice, Prepayment, Instant Bank Transfer, iDEAL & PayPal).
o Transaction amount update option (For Direct Debit SEPA, Invoice & Prepayment).
o Due date change option for Prepayment & Invoice payment.
- Affiliate management system.

Download this release

Release Info

Developer Gabriel Dixon
Extension Novalnet
Version 10.0.0
Comparing to
See all releases


Code changes from version 5.0.4 to 10.0.0

Files changed (176) hide show
  1. app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Config/Form.php +28 -101
  2. app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Config/Payment/Form.php +132 -0
  3. app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Page/Edit.php +8 -8
  4. app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Page/Save.php +103 -0
  5. app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Page/View.php +7 -8
  6. app/code/community/Novalnet/Payment/Block/Adminhtml/{Information.php → Information/Module.php} +3 -3
  7. app/code/community/Novalnet/Payment/Block/Adminhtml/Information/Novalnetmerchantadmin.php +50 -0
  8. app/code/community/Novalnet/Payment/Block/Adminhtml/Recurring/Profile.php +42 -0
  9. app/code/community/Novalnet/Payment/Block/Adminhtml/Recurring/Profile/Grid.php +152 -0
  10. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order.php +0 -2
  11. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php +63 -0
  12. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Grid.php +3 -6
  13. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Invoice/Totals.php +64 -0
  14. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Invoice/View.php +55 -18
  15. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Totals.php +62 -0
  16. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View.php +11 -15
  17. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/Invoices.php +197 -0
  18. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/Renderer/Invoices.php +45 -0
  19. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/TransactionOverview.php +13 -7
  20. app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/TransactionStatus.php +20 -14
  21. app/code/community/Novalnet/Payment/Block/Adminhtml/Transaction/Grid.php +1 -4
  22. app/code/community/Novalnet/Payment/Block/Adminhtml/Transaction/View.php +6 -4
  23. app/code/community/Novalnet/Payment/Block/Adminhtml/Transactionoverview/Grid.php +4 -4
  24. app/code/community/Novalnet/Payment/Block/Adminhtml/Transactionoverview/View.php +4 -4
  25. app/code/community/Novalnet/Payment/Block/Adminhtml/Widget.php +4 -1
  26. app/code/community/Novalnet/Payment/Block/Adminhtml/Widget/Grid/Container.php +5 -1
  27. app/{design/adminhtml/default/default/template/novalnet/payment/method/pdf/Sofortueberweisung.phtml → code/community/Novalnet/Payment/Block/Cart/Item/Renderer.php} +39 -29
  28. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/{Sofortueberweisung.php → Banktransfer.php} +3 -2
  29. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Cc.php +30 -5
  30. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Eps.php +49 -0
  31. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Ideal.php +1 -0
  32. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Invoice.php +5 -1
  33. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Paypal.php +1 -0
  34. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Prepayment.php +14 -0
  35. app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Sepa.php +4 -1
  36. app/code/community/Novalnet/Payment/Block/Payment/Method/Info/{Sofortueberweisung.php → Banktransfer.php} +3 -3
  37. app/code/community/Novalnet/Payment/Block/Payment/Method/Info/Eps.php +70 -0
  38. app/code/community/Novalnet/Payment/Block/Payment/Method/Info/Ideal.php +0 -1
  39. app/code/community/Novalnet/Payment/Block/Payment/Method/Info/Prepayment.php +1 -1
  40. app/code/community/Novalnet/Payment/Block/Payment/Method/NovalnetRedirect.php +5 -4
  41. app/code/community/Novalnet/Payment/Block/Sales/Adminhtml/Recurring/Profile/View.php +141 -0
  42. app/code/community/Novalnet/Payment/Block/Sales/Order/Creditmemo/Totals.php +63 -0
  43. app/code/community/Novalnet/Payment/Block/Sales/Order/Invoice/Totals.php +65 -0
  44. app/code/community/Novalnet/Payment/Block/Sales/Order/Totals.php +64 -0
  45. app/code/community/Novalnet/Payment/Block/Sales/Recurring/Profile/View.php +120 -0
  46. app/code/community/Novalnet/Payment/Helper/AssignData.php +171 -88
  47. app/code/community/Novalnet/Payment/Helper/Data.php +276 -177
  48. app/code/community/Novalnet/Payment/Model/Adminhtml/Sales/Order/Create.php +6 -8
  49. app/code/community/Novalnet/Payment/Model/Affiliate.php +1 -1
  50. app/code/community/Novalnet/Payment/Model/Amountchanged.php +39 -0
  51. app/code/community/Novalnet/Payment/Model/Callback.php +0 -2
  52. app/code/community/Novalnet/Payment/Model/Callbackscript.php +1136 -386
  53. app/code/community/Novalnet/Payment/Model/Config.php +34 -21
  54. app/code/community/Novalnet/Payment/Model/Factory.php +401 -0
  55. app/code/community/Novalnet/Payment/Model/Ipn.php +415 -0
  56. app/code/community/Novalnet/Payment/Model/Novalnet/Request.php +36 -0
  57. app/code/community/Novalnet/Payment/Model/Novalnet/Source/Callbacktypes.php +4 -6
  58. app/code/community/Novalnet/Payment/Model/Novalnet/Source/{Cctypes.php → Cctype.php} +1 -2
  59. app/code/community/Novalnet/Payment/Model/Observer.php +32 -16
  60. app/code/community/Novalnet/Payment/Model/Payment/Method/Abstract.php +966 -485
  61. app/code/community/Novalnet/Payment/Model/Payment/Method/{NovalnetSofortueberweisung.php → NovalnetBanktransfer.php} +1 -4
  62. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetCc.php +0 -2
  63. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetEps.php +34 -0
  64. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetIdeal.php +0 -3
  65. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetInvoice.php +0 -2
  66. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetPaypal.php +0 -3
  67. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetPrepayment.php +0 -2
  68. app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetSepa.php +0 -2
  69. app/code/community/Novalnet/Payment/Model/Quote/Address/Total/Nominal.php +109 -0
  70. app/code/community/Novalnet/Payment/Model/Recurring.php +278 -0
  71. app/code/community/Novalnet/Payment/Model/Recurring/Profile.php +152 -0
  72. app/code/community/Novalnet/Payment/Model/Resource/Affiliate.php +6 -1
  73. app/code/community/Novalnet/Payment/Model/Resource/Affiliateuser.php +6 -1
  74. app/code/community/Novalnet/Payment/Model/Resource/Amountchanged.php +38 -0
  75. app/code/community/Novalnet/Payment/Model/Resource/Amountchanged/Collection.php +33 -0
  76. app/code/community/Novalnet/Payment/Model/Resource/Callback.php +6 -2
  77. app/code/community/Novalnet/Payment/Model/Resource/Callback/Collection.php +0 -1
  78. app/code/community/Novalnet/Payment/Model/Resource/Recurring.php +38 -0
  79. app/code/community/Novalnet/Payment/Model/Resource/Recurring/Collection.php +33 -0
  80. app/code/community/Novalnet/Payment/Model/Resource/Separefill.php +38 -0
  81. app/code/community/Novalnet/Payment/Model/Resource/Separefill/Collection.php +33 -0
  82. app/code/community/Novalnet/Payment/Model/Resource/Transactionoverview.php +6 -2
  83. app/code/community/Novalnet/Payment/Model/Resource/Transactionoverview/Collection.php +2 -1
  84. app/code/community/Novalnet/Payment/Model/Resource/Transactionstatus.php +6 -2
  85. app/code/community/Novalnet/Payment/Model/Resource/Transactionstatus/Collection.php +2 -1
  86. app/code/community/Novalnet/Payment/Model/Sales/Creditmemo/Tax.php +93 -0
  87. app/code/community/Novalnet/Payment/Model/Sales/Creditmemo/Total.php +93 -0
  88. app/code/community/Novalnet/Payment/Model/Sales/Order/Invoice.php +99 -0
  89. app/code/community/Novalnet/Payment/Model/Sales/Order/Payment.php +161 -0
  90. app/code/community/Novalnet/Payment/Model/Sales/Order/Pdf/Creditmemo.php +142 -0
  91. app/code/community/Novalnet/Payment/Model/Sales/Order/Pdf/Invoice.php +143 -0
  92. app/code/community/Novalnet/Payment/Model/Separefill.php +62 -0
  93. app/code/community/Novalnet/Payment/Model/System/Config/Activemethods.php +5 -3
  94. app/code/community/Novalnet/Payment/Model/Transactionoverview.php +0 -2
  95. app/code/community/Novalnet/Payment/Model/Transactionstatus.php +0 -1
  96. app/code/community/Novalnet/Payment/controllers/Adminhtml/Configuration/Wizard/PageController.php +48 -14
  97. app/code/community/Novalnet/Payment/controllers/Adminhtml/{InformationController.php → Information/ModuleController.php} +10 -7
  98. app/code/community/Novalnet/Payment/controllers/Adminhtml/Information/NovalnetmerchantadminController.php +41 -0
  99. app/code/community/Novalnet/Payment/controllers/Adminhtml/Sales/OrderController.php +193 -56
  100. app/code/community/Novalnet/Payment/controllers/Adminhtml/Sales/Recurring/ProfileController.php +201 -0
  101. app/code/community/Novalnet/Payment/controllers/Adminhtml/TransactionController.php +12 -17
  102. app/code/community/Novalnet/Payment/controllers/Adminhtml/TransactionoverviewController.php +13 -17
  103. app/code/community/Novalnet/Payment/controllers/GatewayController.php +198 -103
  104. app/code/community/Novalnet/Payment/etc/adminhtml.xml +65 -40
  105. app/code/community/Novalnet/Payment/etc/config.xml +130 -70
  106. app/code/community/Novalnet/Payment/etc/system.xml +615 -466
  107. app/code/community/Novalnet/Payment/sql/novalnet_setup/{mysql4-install-5.0.4.php → mysql4-install-10.0.0.php} +76 -27
  108. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-1.4.0-5.0.0.php +29 -60
  109. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.0-5.0.1.php +7 -9
  110. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.1-5.0.2.php +17 -18
  111. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.2-10.0.0.php +134 -0
  112. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.3-10.0.0.php +128 -0
  113. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.3-5.0.4.php +6 -4
  114. app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.4-10.0.0.php +88 -0
  115. app/design/adminhtml/default/default/layout/novalnet/configuration.xml +88 -8
  116. app/design/adminhtml/default/default/template/novalnet/information/{iframe.phtml → module.phtml} +1 -1
  117. app/design/{frontend/base/default/template/novalnet/payment/method/pdf/Sofortueberweisung.phtml → adminhtml/default/default/template/novalnet/information/novalnetmerchantadmin.phtml} +32 -29
  118. app/design/adminhtml/default/default/template/novalnet/payment/configuration/paymentcontainer.phtml +38 -0
  119. app/design/adminhtml/default/default/template/novalnet/payment/configuration/{container.phtml → viewcontainer.phtml} +2 -0
  120. app/design/adminhtml/default/default/template/novalnet/payment/method/form/Cc.phtml +38 -36
  121. app/design/adminhtml/default/default/template/novalnet/payment/method/form/Invoice.phtml +4 -6
  122. app/design/adminhtml/default/default/template/novalnet/payment/method/form/Prepayment.phtml +2 -4
  123. app/design/adminhtml/default/default/template/novalnet/payment/method/form/Sepa.phtml +93 -81
  124. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Banktransfer.phtml +52 -0
  125. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Cc.phtml +9 -4
  126. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Eps.phtml +52 -0
  127. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Ideal.phtml +26 -16
  128. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Invoice.phtml +10 -3
  129. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Paypal.phtml +26 -14
  130. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Prepayment.phtml +12 -4
  131. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Sepa.phtml +8 -3
  132. app/design/adminhtml/default/default/template/novalnet/payment/method/info/Sofortueberweisung.phtml +0 -40
  133. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Banktransfer.phtml +49 -0
  134. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Cc.phtml +22 -4
  135. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Eps.phtml +49 -0
  136. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Ideal.phtml +22 -2
  137. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Invoice.phtml +10 -3
  138. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Paypal.phtml +22 -7
  139. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Prepayment.phtml +11 -4
  140. app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Sepa.phtml +25 -4
  141. app/design/adminhtml/default/default/template/novalnet/sales/order/view/info.phtml +273 -0
  142. app/design/adminhtml/default/default/template/novalnet/sales/order/view/tab/info.phtml +324 -0
  143. app/design/adminhtml/default/default/template/novalnet/sales/order/{transactionoverview.phtml → view/tab/transactionoverview.phtml} +19 -15
  144. app/design/adminhtml/default/default/template/novalnet/transaction/overview/view/form.phtml +17 -15
  145. app/design/adminhtml/default/default/template/novalnet/transaction/view/form.phtml +5 -6
  146. app/design/adminhtml/default/default/template/novalnet/widget/view/container.phtml +87 -0
  147. app/design/frontend/base/default/layout/novalnet.xml +29 -0
  148. app/design/frontend/{default/default/template/novalnet/payment/method/form/Sofortueberweisung.phtml → base/default/template/novalnet/payment/method/form/Banktransfer.phtml} +18 -24
  149. app/design/frontend/base/default/template/novalnet/payment/method/form/Cc.phtml +70 -69
  150. app/design/frontend/{rwd/default/template/novalnet/payment/method/form/Sofortueberweisung.phtml → base/default/template/novalnet/payment/method/form/Eps.phtml} +19 -24
  151. app/design/frontend/base/default/template/novalnet/payment/method/form/Ideal.phtml +19 -24
  152. app/design/frontend/base/default/template/novalnet/payment/method/form/Invoice.phtml +11 -10
  153. app/design/frontend/base/default/template/novalnet/payment/method/form/Paypal.phtml +19 -24
  154. app/design/frontend/base/default/template/novalnet/payment/method/form/Prepayment.phtml +3 -6
  155. app/design/frontend/base/default/template/novalnet/payment/method/form/Sepa.phtml +110 -103
  156. app/design/frontend/base/default/template/novalnet/payment/method/info/Banktransfer.phtml +52 -0
  157. app/design/frontend/base/default/template/novalnet/payment/method/info/Cc.phtml +8 -3
  158. app/design/frontend/base/default/template/novalnet/payment/method/info/Eps.phtml +52 -0
  159. app/design/frontend/base/default/template/novalnet/payment/method/info/Ideal.phtml +26 -16
  160. app/design/frontend/base/default/template/novalnet/payment/method/info/Invoice.phtml +10 -3
  161. app/design/frontend/base/default/template/novalnet/payment/method/info/Paypal.phtml +26 -14
  162. app/design/frontend/base/default/template/novalnet/payment/method/info/Prepayment.phtml +12 -4
  163. app/design/frontend/base/default/template/novalnet/payment/method/info/Sepa.phtml +8 -3
  164. app/design/frontend/base/default/template/novalnet/payment/method/info/Sofortueberweisung.phtml +0 -40
  165. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Banktransfer.phtml +49 -0
  166. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Cc.phtml +22 -4
  167. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Eps.phtml +49 -0
  168. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Ideal.phtml +22 -2
  169. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Invoice.phtml +10 -3
  170. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Paypal.phtml +22 -7
  171. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Prepayment.phtml +11 -4
  172. app/design/frontend/base/default/template/novalnet/payment/method/pdf/Sepa.phtml +25 -4
  173. app/design/frontend/base/default/template/novalnet/sales/recurring/profile/view.phtml +149 -0
  174. app/design/frontend/default/default/layout/novalnet.xml +29 -0
  175. app/design/frontend/{base/default/template/novalnet/payment/method/form/Sofortueberweisung.phtml → default/default/template/novalnet/payment/method/form/Banktransfer.phtml} +18 -24
  176. app/design/frontend/default/default/template/novalnet/payment/method/form/Cc.phtml +55 -54
app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Config/Form.php CHANGED
@@ -26,12 +26,7 @@
26
  class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends Mage_Adminhtml_Block_System_Config_Form
27
  {
28
  /**
29
- * @var string
30
- */
31
- protected $_groupName = '';
32
-
33
- /**
34
- * prepare configuration wizard form layout
35
  *
36
  */
37
  protected function _prepareLayout()
@@ -50,42 +45,44 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends
50
  {
51
  $this->_initObjects();
52
  $form = $this->_initForm();
53
-
 
54
  $sections = $this->_configFields->getSection(
55
- $this->getSectionCode(), $this->getWebsiteCode(), $this->getStoreCode()
56
  );
57
 
58
  $session = Mage::getSingleton('admin/session');
59
 
60
- if (!$this->getWebsiteCode() && !$this->getStoreCode()) {
61
- $session->setNnStoreConfig(Mage::helper('novalnet_payment')->__('Standard'));
62
- } else if ($this->getWebsiteCode() != '' && !$this->getStoreCode()) {
63
- $storeConfig = Mage::getModel('core/website')->load($this->getWebsiteCode())->getName();
64
- Mage::register('webConfig', Mage::getModel('core/website')->load($this->getWebsiteCode())->getId());
65
  $session->setNnStoreConfig($storeConfig);
66
  } else {
67
- $storeConfig = Mage::getModel('core/store')->load($this->getStoreCode())->getName();
68
- Mage::register('storeConfig', Mage::getModel('core/store')->load($this->getStoreCode())->getId());
69
  $session->setNnStoreConfig($storeConfig);
70
  }
71
 
72
  $groups = $sections->groups;
73
- $groupName = $this->getGroupName();
74
- $group = $groups->$groupName;
75
-
76
- $fieldsetRenderer = Mage::getBlockSingleton('Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset');
77
- $fieldsetConfig = array(
78
- 'legend' => Mage::helper('novalnet_payment')->__((string) $group->label),
79
- );
80
- $fieldset = $form->addFieldset($sections->getName() . '_' . $group->getName(), $fieldsetConfig);
81
- $fieldsetRenderer->setForm($this);
82
-
83
- $this->initFields($fieldset, $group, $sections);
84
-
 
85
  $fieldset->addField(
86
  'page_code', 'hidden', array(
87
  'name' => 'page_code',
88
- 'value' => $this->getPageCode()
89
  )
90
  );
91
  $form->setUseContainer(true);
@@ -93,7 +90,7 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends
93
  return $this;
94
  }
95
 
96
- /**
97
  * Initialize configuration wizard form
98
  *
99
  * @return Varien_Data_Form
@@ -103,7 +100,7 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends
103
  $form = new Varien_Data_Form(
104
  array(
105
  'id' => 'edit_form',
106
- 'action' => $this->getSaveUrl(),
107
  'method' => 'post',
108
  'enctype' => 'multipart/form-data'
109
  )
@@ -111,66 +108,6 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends
111
  return $form;
112
  }
113
 
114
- /**
115
- * Get save url
116
- *
117
- * @return string
118
- */
119
- protected function getSaveUrl()
120
- {
121
- return $this->getUrl('*/*/save', array('_current' => true));
122
- }
123
-
124
- /**
125
- * Get group name
126
- *
127
- * @return string
128
- */
129
- public function getGroupName()
130
- {
131
- return $this->getConfigPage('group_name');
132
- }
133
-
134
- /**
135
- * Get page code
136
- *
137
- * @return string
138
- */
139
- public function getPageCode()
140
- {
141
- return $this->getConfigPage('codes/page');
142
- }
143
-
144
- /**
145
- * Get section code
146
- *
147
- * @return string
148
- */
149
- public function getSectionCode()
150
- {
151
- return $this->getConfigPage('codes/section');
152
- }
153
-
154
- /**
155
- * Get store
156
- *
157
- * @return string
158
- */
159
- public function getStoreCode()
160
- {
161
- return $this->getConfigPage('codes/store');
162
- }
163
-
164
- /**
165
- * Get website
166
- *
167
- * @return string
168
- */
169
- public function getWebsiteCode()
170
- {
171
- return $this->getConfigPage('codes/website');
172
- }
173
-
174
  /**
175
  * Get configuration page path
176
  *
@@ -179,18 +116,8 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends
179
  */
180
  public function getConfigPage($path)
181
  {
182
- $config = $this->helperWizard()->getConfigPage();
183
  return $config->getData($path);
184
  }
185
 
186
- /**
187
- * Get Novalnet payment helper
188
- *
189
- * @return Novalnet_Payment_Helper_Data
190
- */
191
- public function helperWizard()
192
- {
193
- return Mage::helper('novalnet_payment');
194
- }
195
-
196
  }
26
  class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Form extends Mage_Adminhtml_Block_System_Config_Form
27
  {
28
  /**
29
+ * Prepare configuration wizard form layout
 
 
 
 
 
30
  *
31
  */
32
  protected function _prepareLayout()
45
  {
46
  $this->_initObjects();
47
  $form = $this->_initForm();
48
+ $getWebsiteCode = $this->getConfigPage('codes/website');
49
+ $getStoreCode = $this->getConfigPage('codes/store');
50
  $sections = $this->_configFields->getSection(
51
+ $this->getConfigPage('codes/section'), $getWebsiteCode, $getStoreCode
52
  );
53
 
54
  $session = Mage::getSingleton('admin/session');
55
 
56
+ if (!$getWebsiteCode && !$getStoreCode) {
57
+ $session->setNnStoreConfig('Standard');
58
+ } else if ($getWebsiteCode != '' && !$getStoreCode) {
59
+ $storeConfig = Mage::getModel('core/website')->load($getWebsiteCode)->getName();
60
+ Mage::register('webConfig', Mage::getModel('core/website')->load($getWebsiteCode)->getId());
61
  $session->setNnStoreConfig($storeConfig);
62
  } else {
63
+ $storeConfig = Mage::getModel('core/store')->load($getStoreCode)->getName();
64
+ Mage::register('storeConfig', Mage::getModel('core/store')->load($getStoreCode)->getId());
65
  $session->setNnStoreConfig($storeConfig);
66
  }
67
 
68
  $groups = $sections->groups;
69
+ $gropupArray = $this->getConfigPage('group_name');
70
+ foreach ($gropupArray as $gropupArrayvalue) {
71
+ $group = $groups->$gropupArrayvalue;
72
+
73
+ $fieldsetRenderer = Mage::getBlockSingleton('Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset');
74
+ $fieldsetConfig = array(
75
+ 'legend' => Mage::helper('novalnet_payment')->__((string) $group->label),
76
+ );
77
+ $fieldset = $form->addFieldset($sections->getName() . '_' . $group->getName(), $fieldsetConfig);
78
+ $fieldsetRenderer->setForm($this);
79
+
80
+ $this->initFields($fieldset, $group, $sections);
81
+ }
82
  $fieldset->addField(
83
  'page_code', 'hidden', array(
84
  'name' => 'page_code',
85
+ 'value' => $this->getConfigPage('codes/page')
86
  )
87
  );
88
  $form->setUseContainer(true);
90
  return $this;
91
  }
92
 
93
+ /**
94
  * Initialize configuration wizard form
95
  *
96
  * @return Varien_Data_Form
100
  $form = new Varien_Data_Form(
101
  array(
102
  'id' => 'edit_form',
103
+ 'action' => $this->getUrl('*/*/save', array('_current' => true)),
104
  'method' => 'post',
105
  'enctype' => 'multipart/form-data'
106
  )
108
  return $form;
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * Get configuration page path
113
  *
116
  */
117
  public function getConfigPage($path)
118
  {
119
+ $config = Mage::helper('novalnet_payment')->getConfigPage();
120
  return $config->getData($path);
121
  }
122
 
 
 
 
 
 
 
 
 
 
 
123
  }
app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Config/Payment/Form.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Config_Payment_Form extends Mage_Adminhtml_Block_System_Config_Form
27
+ {
28
+ /**
29
+ * prepare configuration wizard layout
30
+ *
31
+ */
32
+ protected function _prepareLayout()
33
+ {
34
+ $return = parent::_prepareLayout();
35
+ $this->initForm();
36
+ return $return;
37
+ }
38
+
39
+ /**
40
+ * Initialize configuration wizard form
41
+ *
42
+ * @return Mage_Adminhtml_Block_System_Config_Form
43
+ */
44
+ public function initForm()
45
+ {
46
+ $this->_initObjects();
47
+ $form = $this->_initForm();
48
+ $getWebsiteCode = $this->getConfigPage('codes/website');
49
+ $getStoreCode = $this->getConfigPage('codes/store');
50
+ $sections = $this->_configFields->getSection(
51
+ $this->getConfigPage('codes/section'), $getWebsiteCode, $getStoreCode
52
+ );
53
+
54
+ $session = Mage::getSingleton('admin/session');
55
+
56
+ if (!$getWebsiteCode && !$getStoreCode) {
57
+ $session->setNnStoreConfig('Standard');
58
+ } else if ($getWebsiteCode && !$getStoreCode) {
59
+ $storeConfig = Mage::getModel('core/website')->load($getWebsiteCode)->getName();
60
+ Mage::register('webConfig', Mage::getModel('core/website')->load($getWebsiteCode)->getId());
61
+ $session->setNnStoreConfig($storeConfig);
62
+ } else {
63
+ $storeConfig = Mage::getModel('core/store')->load($getStoreCode)->getName();
64
+ Mage::register('storeConfig', Mage::getModel('core/store')->load($getStoreCode)->getId());
65
+ $session->setNnStoreConfig($storeConfig);
66
+ }
67
+
68
+ $groups = $sections->groups;
69
+ $gropupArray = $this->getConfigPage('group_name');
70
+ foreach ($gropupArray as $gropupArrayvalue) {
71
+ $group = $groups->$gropupArrayvalue;
72
+
73
+ $fieldsetConfig = array(
74
+ 'legend' => Mage::helper('novalnet_payment')->__((string) $group->label),
75
+ );
76
+
77
+ $fieldsetRenderer = $group->frontend_model
78
+ ? Mage::getBlockSingleton((string) $group->frontend_model) : $this->_defaultFieldsetRenderer;
79
+
80
+ $fieldsetRenderer->setForm($this)
81
+ ->setConfigData($this->_configData);
82
+ $fieldset = new Varien_Data_Form_Element_Fieldset($fieldsetConfig);
83
+ $fieldset->setId($sections->getName() . '_' . $group->getName())
84
+ ->setRenderer($fieldsetRenderer)
85
+ ->setGroup($group);
86
+ $form->addElement($fieldset);
87
+
88
+ $this->initFields($fieldset, $group, $sections);
89
+ }
90
+
91
+ $fieldset->addField(
92
+ 'page_code', 'hidden', array(
93
+ 'name' => 'page_code',
94
+ 'value' => $this->getConfigPage('codes/page')
95
+ )
96
+ );
97
+ $form->setUseContainer(true);
98
+ $this->setForm($form);
99
+ return $this;
100
+ }
101
+
102
+ /**
103
+ * Initialize configuration wizard form
104
+ *
105
+ * @return Varien_Data_Form
106
+ */
107
+ protected function _initForm()
108
+ {
109
+ $form = new Varien_Data_Form(
110
+ array(
111
+ 'id' => 'save_form',
112
+ 'action' => $this->getUrl('*/*/paymentsave', array('_current' => true)),
113
+ 'method' => 'post',
114
+ 'enctype' => 'multipart/form-data'
115
+ )
116
+ );
117
+ return $form;
118
+ }
119
+
120
+ /**
121
+ * Get configuration page path
122
+ *
123
+ * @param string $path
124
+ * @return mixed
125
+ */
126
+ public function getConfigPage($path)
127
+ {
128
+ $config = Mage::helper('novalnet_payment')->getConfigPage();
129
+ return $config->getData($path);
130
+ }
131
+
132
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Page/Edit.php CHANGED
@@ -32,19 +32,19 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Page_Edit extends Ma
32
  $this->_blockGroup = 'novalnet_payment';
33
  $this->_controller = 'adminhtml_configuration_wizard_page_edit';
34
 
35
- $this->_removeButton('delete');
36
- $this->_removeButton('reset');
37
- $this->_removeButton('back');
38
- $this->_removeButton('save');
39
 
40
  $this->_addButton('back', array(
41
- 'label' => Mage::helper('novalnet_payment')->__('Back'),
42
  'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')',
43
  'class' => 'default',
44
  ));
45
 
46
  $this->_addButton('save', array(
47
- 'label' => Mage::helper('novalnet_payment')->__('Save'),
48
  'onclick' => 'editForm.submit();',
49
  'class' => 'default',
50
  ));
@@ -60,8 +60,8 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Page_Edit extends Ma
60
  $session = Mage::getSingleton('admin/session');
61
  $storeConfig = $session->getNnStoreConfig();
62
 
63
- $headerText = $this->getConfigPage('header_text');
64
- $text = Mage::helper('novalnet_payment')->__($headerText . ' for ' . $storeConfig);
65
  $session->unsNnStoreConfig();
66
  return $text;
67
  }
32
  $this->_blockGroup = 'novalnet_payment';
33
  $this->_controller = 'adminhtml_configuration_wizard_page_edit';
34
 
35
+ $this->_removeButton('delete')
36
+ ->_removeButton('reset')
37
+ ->_removeButton('back')
38
+ ->_removeButton('save');
39
 
40
  $this->_addButton('back', array(
41
+ 'label' => $this->helperWizard()->__('Back'),
42
  'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')',
43
  'class' => 'default',
44
  ));
45
 
46
  $this->_addButton('save', array(
47
+ 'label' => $this->helperWizard()->__('Save'),
48
  'onclick' => 'editForm.submit();',
49
  'class' => 'default',
50
  ));
60
  $session = Mage::getSingleton('admin/session');
61
  $storeConfig = $session->getNnStoreConfig();
62
 
63
+ $headerText = $this->helperWizard()->__($this->getConfigPage('header_text'));
64
+ $text = $this->helperWizard()->__('%s for %s', $headerText, $storeConfig);
65
  $session->unsNnStoreConfig();
66
  return $text;
67
  }
app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Page/Save.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Page_Save extends Mage_Adminhtml_Block_Widget_Form_Container
27
+ {
28
+
29
+ public function __construct()
30
+ {
31
+ $this->_mode = '';
32
+ $this->_blockGroup = 'novalnet_payment';
33
+ $this->_controller = 'adminhtml_configuration_wizard_page_save';
34
+
35
+ $this->_removeButton('delete')
36
+ ->_removeButton('reset')
37
+ ->_removeButton('back')
38
+ ->_removeButton('save');
39
+
40
+ $this->_addButton('back', array(
41
+ 'label' => $this->helperWizard()->__('Back'),
42
+ 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')',
43
+ 'class' => 'default',
44
+ 'style' => 'margin-top: 10px;',
45
+ ));
46
+
47
+ $this->_addButton('save', array(
48
+ 'label' => $this->helperWizard()->__('Save'),
49
+ 'onclick' => 'saveForm.submit();',
50
+ 'class' => 'default',
51
+ ));
52
+ }
53
+
54
+ /**
55
+ * Get header text of configuration wizard page
56
+ *
57
+ * @return string
58
+ */
59
+ public function getHeaderText()
60
+ {
61
+ $session = Mage::getSingleton('admin/session');
62
+ $storeConfig = $session->getNnStoreConfig();
63
+
64
+ $headerText = $this->helperWizard()->__($this->getConfigPage('header_text'));
65
+ $text = $this->helperWizard()->__('%s for %s', $headerText, $storeConfig);
66
+ $session->unsNnStoreConfig();
67
+ return $text;
68
+ }
69
+
70
+ /**
71
+ * Get configuration wizard page back url
72
+ *
73
+ * @return string
74
+ */
75
+ public function getBackUrl()
76
+ {
77
+ $url = $this->helperWizard()->getPreviousPageUrlAsString();
78
+ return $this->getUrl($url, array('_current' => true));
79
+ }
80
+
81
+ /**
82
+ * Get configuration page path
83
+ *
84
+ * @param string $path
85
+ * @return mixed
86
+ */
87
+ public function getConfigPage($path)
88
+ {
89
+ $config = $this->helperWizard()->getConfigPage();
90
+ return $config->getData($path);
91
+ }
92
+
93
+ /**
94
+ * Get Novalnet payment helper
95
+ *
96
+ * @return Novalnet_Payment_Helper_Data
97
+ */
98
+ public function helperWizard()
99
+ {
100
+ return Mage::helper('novalnet_payment');
101
+ }
102
+
103
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Configuration/Wizard/Page/View.php CHANGED
@@ -30,10 +30,10 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Page_View extends Ma
30
  {
31
  $this->_blockGroup = 'novalnet_payment';
32
  $this->_controller = 'adminhtml_configuration_wizard_page';
33
- $this->_headerText = Mage::helper('novalnet_payment')->__('Novalnet Payment Configuration');
34
 
35
- $this->_removeButton('edit');
36
- $this->_removeButton('back');
37
 
38
  $this->_addButton('save', array(
39
  'label' => Mage::helper('adminhtml')->__('Continue'),
@@ -77,9 +77,8 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Page_View extends Ma
77
  */
78
  public function getHeaderText()
79
  {
80
- $headerText = $this->getConfigPage('header_text');
81
- $text = Mage::helper('novalnet_payment')->__($headerText);
82
- return $text;
83
  }
84
 
85
  /**
@@ -105,9 +104,9 @@ class Novalnet_Payment_Block_Adminhtml_Configuration_Wizard_Page_View extends Ma
105
  }
106
 
107
  /**
108
- * prepare layout
109
  *
110
- * @return
111
  */
112
  protected function _prepareLayout()
113
  {
30
  {
31
  $this->_blockGroup = 'novalnet_payment';
32
  $this->_controller = 'adminhtml_configuration_wizard_page';
33
+ $this->_headerText = $this->helperWizard()->__('Novalnet Payment Configuration');
34
 
35
+ $this->_removeButton('edit')
36
+ ->_removeButton('back');
37
 
38
  $this->_addButton('save', array(
39
  'label' => Mage::helper('adminhtml')->__('Continue'),
77
  */
78
  public function getHeaderText()
79
  {
80
+ $headerText = $this->helperWizard()->__($this->getConfigPage('header_text'));
81
+ return $headerText;
 
82
  }
83
 
84
  /**
104
  }
105
 
106
  /**
107
+ * Prepare layout
108
  *
109
+ * @return null
110
  */
111
  protected function _prepareLayout()
112
  {
app/code/community/Novalnet/Payment/Block/Adminhtml/{Information.php → Information/Module.php} RENAMED
@@ -23,7 +23,7 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Novalnet_Payment_Block_Adminhtml_Information extends Mage_Adminhtml_Block_Template
27
  {
28
 
29
  /**
@@ -32,11 +32,11 @@ class Novalnet_Payment_Block_Adminhtml_Information extends Mage_Adminhtml_Block_
32
  */
33
  public function _construct()
34
  {
35
- $this->setTemplate("novalnet/information/iframe.phtml");
36
  }
37
 
38
  /**
39
- * Set the Novalnet Magento module path
40
  *
41
  * @return string
42
  */
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Novalnet_Payment_Block_Adminhtml_Information_Module extends Mage_Adminhtml_Block_Template
27
  {
28
 
29
  /**
32
  */
33
  public function _construct()
34
  {
35
+ $this->setTemplate("novalnet/information/module.phtml");
36
  }
37
 
38
  /**
39
+ * Return Magento module information link
40
  *
41
  * @return string
42
  */
app/code/community/Novalnet/Payment/Block/Adminhtml/Information/Novalnetmerchantadmin.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Information_Novalnetmerchantadmin extends Mage_Adminhtml_Block_Template
27
+ {
28
+
29
+ /**
30
+ * Assign the template to load the novalnet magento module updates
31
+ *
32
+ */
33
+ public function _construct()
34
+ {
35
+ $this->setTemplate("novalnet/information/novalnetmerchantadmin.phtml");
36
+ }
37
+
38
+ /**
39
+ * Return Novalnet merchant admin link
40
+ *
41
+ * @return string
42
+ */
43
+ public function getNovalnetAdminUrl()
44
+ {
45
+ $protocol = Mage::app()->getStore()->isCurrentlySecure() ? 'https' : 'http';
46
+ $url = $this->escapeUrl($protocol . '://admin.novalnet.de');
47
+ return $url;
48
+ }
49
+
50
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Recurring/Profile.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Recurring_Profile extends Mage_Adminhtml_Block_Widget_Grid_Container
27
+ {
28
+
29
+ protected $_blockGroup = 'novalnet_payment';
30
+ protected $_controller = 'adminhtml_recurring_profile';
31
+
32
+ /**
33
+ * Set header text and remove "addnew" button
34
+ *
35
+ */
36
+ public function __construct()
37
+ {
38
+ $this->_headerText = Mage::helper('novalnet_payment')->__('Novalnet Recurring Profiles');
39
+ parent::__construct();
40
+ $this->_removeButton('add');
41
+ }
42
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Recurring/Profile/Grid.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Recurring_Profile_Grid extends Mage_Adminhtml_Block_Widget_Grid
27
+ {
28
+ /**
29
+ * Set ajax/session parameters
30
+ *
31
+ */
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('novalnet_recurring_profile_grid');
36
+ $this->setUseAjax(true);
37
+ $this->setSaveParametersInSession(true);
38
+ }
39
+
40
+ /**
41
+ * Prepare grid collection object
42
+ *
43
+ * @return Mage_Sales_Block_Adminhtml_Recurring_Profile_Grid
44
+ */
45
+ protected function _prepareCollection()
46
+ {
47
+ $collection = Mage::getResourceModel('sales/recurring_profile_collection')
48
+ ->addFieldToFilter('method_code', array(
49
+ 'like' => '%novalnet%',
50
+ ));
51
+ $collection->setOrder('profile_id', 'desc');
52
+ $this->setCollection($collection);
53
+
54
+ if (!$this->getParam($this->getVarNameSort())) {
55
+ $collection->setOrder('profile_id', 'desc');
56
+ }
57
+ return parent::_prepareCollection();
58
+ }
59
+
60
+ /**
61
+ * Prepare grid columns
62
+ *
63
+ * @return Mage_Sales_Block_Adminhtml_Recurring_Profile_Grid
64
+ */
65
+ protected function _prepareColumns()
66
+ {
67
+ $profile = Mage::getModel('sales/recurring_profile');
68
+
69
+ $this->addColumn('reference_id', array(
70
+ 'header' => $profile->getFieldLabel('reference_id'),
71
+ 'index' => 'reference_id',
72
+ 'html_decorators' => array('nobr'),
73
+ 'width' => 1,
74
+ ));
75
+
76
+ if (!Mage::app()->isSingleStoreMode()) {
77
+ $this->addColumn('store_id', array(
78
+ 'header' => Mage::helper('adminhtml')->__('Store'),
79
+ 'index' => 'store_id',
80
+ 'type' => 'store',
81
+ 'store_view' => true,
82
+ 'display_deleted' => true,
83
+ ));
84
+ }
85
+
86
+ $this->addColumn('state', array(
87
+ 'header' => $profile->getFieldLabel('state'),
88
+ 'index' => 'state',
89
+ 'type' => 'options',
90
+ 'options' => $profile->getAllStates(),
91
+ 'html_decorators' => array('nobr'),
92
+ 'width' => 1,
93
+ ));
94
+
95
+ $this->addColumn('created_at', array(
96
+ 'header' => $profile->getFieldLabel('created_at'),
97
+ 'index' => 'created_at',
98
+ 'type' => 'datetime',
99
+ 'html_decorators' => array('nobr'),
100
+ 'width' => 1,
101
+ ));
102
+
103
+ $this->addColumn('updated_at', array(
104
+ 'header' => $profile->getFieldLabel('updated_at'),
105
+ 'index' => 'updated_at',
106
+ 'type' => 'datetime',
107
+ 'html_decorators' => array('nobr'),
108
+ 'width' => 1,
109
+ ));
110
+
111
+ $methods = array();
112
+ foreach (Mage::helper('payment')->getRecurringProfileMethods() as $method) {
113
+ if(preg_match("/novalnet/i",$method->getCode())){
114
+ $methods[$method->getCode()] = $method->getTitle();
115
+ }
116
+ }
117
+ $this->addColumn('method_code', array(
118
+ 'header' => $profile->getFieldLabel('method_code'),
119
+ 'index' => 'method_code',
120
+ 'type' => 'options',
121
+ 'options' => $methods,
122
+ ));
123
+
124
+ $this->addColumn('schedule_description', array(
125
+ 'header' => $profile->getFieldLabel('schedule_description'),
126
+ 'index' => 'schedule_description',
127
+ ));
128
+
129
+ return parent::_prepareColumns();
130
+ }
131
+
132
+ /**
133
+ * Get row url for js event handlers
134
+ *
135
+ * @param Varien_Object
136
+ * @return string
137
+ */
138
+ public function getRowUrl($row)
139
+ {
140
+ return $this->getUrl('adminhtml/sales_recurring_profile/view', array('profile' => $row->getId()));
141
+ }
142
+
143
+ /**
144
+ * Get grid url
145
+ *
146
+ * @return string
147
+ */
148
+ public function getGridUrl()
149
+ {
150
+ return $this->getUrl('*/*/grid', array('_current'=>true));
151
+ }
152
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order.php CHANGED
@@ -29,11 +29,9 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order extends Novalnet_Payment_Bloc
29
  public function __construct()
30
  {
31
  parent::__construct();
32
-
33
  $this->_blockGroup = 'novalnet_payment';
34
  $this->_controller = 'adminhtml_sales_order';
35
  $this->_headerText = Mage::helper('novalnet_payment')->__('Orders');
36
-
37
  $this->removeButton('add');
38
  }
39
 
29
  public function __construct()
30
  {
31
  parent::__construct();
 
32
  $this->_blockGroup = 'novalnet_payment';
33
  $this->_controller = 'adminhtml_sales_order';
34
  $this->_headerText = Mage::helper('novalnet_payment')->__('Orders');
 
35
  $this->removeButton('add');
36
  }
37
 
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Creditmemo_Totals extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals
27
+ {
28
+
29
+ /**
30
+ * Initialize creditmemo totals array
31
+ *
32
+ * @return Mage_Sales_Block_Order_Totals
33
+ */
34
+ protected function _initTotals()
35
+ {
36
+ parent::_initTotals();
37
+ $helper = Mage::helper('novalnet_payment');
38
+ $amountchangedvalue = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
39
+ if ($amountchangedvalue) {
40
+ if (preg_match("/\bview\b/i", Mage::helper('core/url')->getCurrentUrl())) {
41
+ $this->_totals['refund_amount_changed'] = new Varien_Object(array(
42
+ 'code' => 'refund_amount_changed',
43
+ 'strong' => true,
44
+ 'value' => $this->getSource()->getGrandTotal(),
45
+ 'base_value' => $this->getSource()->getBaseGrandTotal(),
46
+ 'label' => Mage::helper('sales')->__('Novalnet refunded Amount'),
47
+ 'area' => 'footer'
48
+ ));
49
+ }
50
+
51
+ $this->_totals['amount_changed'] = new Varien_Object(array(
52
+ 'code' => 'amount_changed',
53
+ 'strong' => true,
54
+ 'value' => $amountchangedvalue,
55
+ 'base_value' => $amountchangedvalue,
56
+ 'label' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
57
+ 'area' => 'footer'
58
+ ));
59
+ }
60
+ return $this;
61
+ }
62
+
63
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Grid.php CHANGED
@@ -28,9 +28,6 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_B
28
 
29
  var $novalnetPayments = array();
30
 
31
- /**
32
- *
33
- */
34
  public function __construct()
35
  {
36
  parent::__construct();
@@ -76,9 +73,9 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_B
76
  ->getSelect()->where("`payment`.`method` like '%novalnet%'");
77
  } else {
78
  $flatOrderPayment = $collection->getTable('sales/order_payment');
79
- $collection->getSelect()->join(array('payment' => $flatOrderPayment), 'main_table.entity_id = payment.parent_id', 'method')
80
- ->where("`payment`.`method` like '%novalnet%'");
81
  }
 
82
  $this->setCollection($collection);
83
  return parent::_prepareCollection();
84
  }
@@ -88,7 +85,7 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_B
88
  *
89
  * @return Novalnet_Payment_Block_Adminhtml_Sales_Order_Grid
90
  */
91
- public function _prepareColumns()
92
  {
93
  $this->addColumn('real_order_id', array(
94
  'header' => Mage::helper('sales')->__('Order #'),
28
 
29
  var $novalnetPayments = array();
30
 
 
 
 
31
  public function __construct()
32
  {
33
  parent::__construct();
73
  ->getSelect()->where("`payment`.`method` like '%novalnet%'");
74
  } else {
75
  $flatOrderPayment = $collection->getTable('sales/order_payment');
76
+ $collection->getSelect()->join(array('payment' => $flatOrderPayment), 'main_table.entity_id = payment.parent_id', 'method')->where("`payment`.`method` like '%novalnet%'");
 
77
  }
78
+
79
  $this->setCollection($collection);
80
  return parent::_prepareCollection();
81
  }
85
  *
86
  * @return Novalnet_Payment_Block_Adminhtml_Sales_Order_Grid
87
  */
88
+ protected function _prepareColumns()
89
  {
90
  $this->addColumn('real_order_id', array(
91
  'header' => Mage::helper('sales')->__('Order #'),
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Invoice/Totals.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Invoice_Totals extends Mage_Adminhtml_Block_Sales_Order_Invoice_Totals
27
+ {
28
+
29
+ /**
30
+ * Initialize order totals array
31
+ *
32
+ * @return Mage_Sales_Block_Order_Totals
33
+ */
34
+ protected function _initTotals()
35
+ {
36
+ parent::_initTotals();
37
+ $helper = Mage::helper('novalnet_payment');
38
+ $amountchangedvalue = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
39
+ if ($amountchangedvalue) {
40
+ $adjustmentamount = -($this->getOrder()->getGrandTotal() - $amountchangedvalue);
41
+
42
+ $this->_totals['adjust_amount_changed'] = new Varien_Object(array(
43
+ 'code' => 'adjust_amount_changed',
44
+ 'strong' => true,
45
+ 'value' => $adjustmentamount,
46
+ 'base_value' => $adjustmentamount,
47
+ 'label' => Mage::helper('sales')->__('Novalnet Adjusted Amount'),
48
+ 'area' => 'footer'
49
+ ));
50
+
51
+ $this->_totals['amount_changed'] = new Varien_Object(array(
52
+ 'code' => 'amount_changed',
53
+ 'strong' => true,
54
+ 'value' => $amountchangedvalue,
55
+ 'base_value' => $amountchangedvalue,
56
+ 'label' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
57
+ 'area' => 'footer'
58
+ ));
59
+ }
60
+
61
+ return $this;
62
+ }
63
+
64
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Invoice/View.php CHANGED
@@ -29,38 +29,75 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Invoice_View extends Mage_Adm
29
  public function __construct()
30
  {
31
  parent::__construct();
32
- $payment = $this->getInvoice()->getOrder()->getPayment();
33
- $paymentCode = $payment->getMethodInstance()->getCode();
34
  $helper = Mage::helper('novalnet_payment');
 
 
 
35
 
36
- if (preg_match("/novalnet/i", $paymentCode) && $paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE) {
37
- $this->_removeButton('print');
38
- $this->_removeButton('capture');
39
- $baseGrandTotal = $payment->getOrder()->getBaseGrandTotal();
40
- $orderPayment = $this->getInvoice()->getOrder()->getPayment();
41
- $orderId = $this->getInvoice()->getOrder()->getIncrementId();
42
- $refundedAmount = $helper->getFormatedAmount($orderPayment->getAmountRefunded());
43
- $callbackTrans = $helper->loadCallbackValue($orderId);
 
44
  $callbackValue = $callbackTrans && $callbackTrans->getCallbackAmount()
45
  != NULL ? $callbackTrans->getCallbackAmount() : '';
46
- if ($callbackValue && $callbackValue > (string) $refundedAmount && $baseGrandTotal
47
- != $orderPayment->getAmountRefunded()) {
48
- $this->_addButton('capture', array(// capture?
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  'label' => Mage::helper('sales')->__('Credit Memo'),
50
  'class' => 'go',
51
  'onclick' => 'setLocation(\'' . $this->getCreditMemoUrl() . '\')'
52
  )
53
  );
54
- }
55
- if ($this->getInvoice()->getId()) {
56
- $this->_addButton('print', array(
 
 
 
 
 
 
57
  'label' => Mage::helper('sales')->__('Print'),
58
  'class' => 'save',
59
  'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')'
60
  )
61
  );
62
- }
63
- }
64
  }
65
 
66
  }
29
  public function __construct()
30
  {
31
  parent::__construct();
 
 
32
  $helper = Mage::helper('novalnet_payment');
33
+ $order = $this->getInvoice()->getOrder();
34
+ $nominalItem = $helper->checkNominalItem($order->getAllItems());
35
+ $totalPaid = $order->getTotalPaid();
36
 
37
+ $payment = $order->getPayment();
38
+ $orderRefundAmount = $payment->getAmountRefunded();
39
+ $paymentMethod = $payment->getMethodInstance()->getCode();
40
+ $orderId = $order->getIncrementId();
41
+ $sorderId = $order->getId();
42
+ $refundedAmount = $helper->getFormatedAmount($payment->getAmountRefunded());
43
+
44
+ $amount = $helper->getAmountCollection($sorderId, 1, NULL);
45
+ $callbackTrans = $helper->loadCallbackValue($orderId);
46
  $callbackValue = $callbackTrans && $callbackTrans->getCallbackAmount()
47
  != NULL ? $callbackTrans->getCallbackAmount() : '';
48
+ if (($payment->getAmountRefunded() < $amount) || ($nominalItem && $payment->getAmountRefunded() < $totalPaid)) {
49
+ $this->_removeButton('print');
50
+ $this->_removeButton('capture');
51
+ if ($paymentMethod == Novalnet_Payment_Model_Config::NN_INVOICE && $callbackValue && $callbackValue > (string) $refundedAmount) {
52
+ $this->getCreditMemoButton();
53
+ }else if($paymentMethod != Novalnet_Payment_Model_Config::NN_INVOICE){
54
+ $this->getCreditMemoButton();
55
+ }
56
+ if ($this->getInvoice()->getId()) {
57
+ $this->getPrintButton();
58
+ }
59
+ } else if (preg_match("/novalnet/i", $paymentMethod) && $paymentMethod == Novalnet_Payment_Model_Config::NN_INVOICE && !$amount && $orderRefundAmount < $totalPaid) {
60
+ $this->_removeButton('print');
61
+ $this->_removeButton('capture');
62
+
63
+ if ($callbackValue && $callbackValue > (string) $refundedAmount) {
64
+ $this->getCreditMemoButton();
65
+ }
66
+ if ($this->getInvoice()->getId()) {
67
+ $this->getPrintButton();
68
+ }
69
+ }else if($paymentMethod == Novalnet_Payment_Model_Config::NN_INVOICE && !$callbackValue){
70
+ $this->_removeButton('capture');
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Add creditmemo button
76
+ *
77
+ */
78
+ private function getCreditMemoButton()
79
+ {
80
+
81
+ $this->_addButton('capture', array(// capture?
82
  'label' => Mage::helper('sales')->__('Credit Memo'),
83
  'class' => 'go',
84
  'onclick' => 'setLocation(\'' . $this->getCreditMemoUrl() . '\')'
85
  )
86
  );
87
+ }
88
+
89
+ /**
90
+ * Add print button
91
+ *
92
+ */
93
+ private function getPrintButton()
94
+ {
95
+ $this->_addButton('print', array(
96
  'label' => Mage::helper('sales')->__('Print'),
97
  'class' => 'save',
98
  'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')'
99
  )
100
  );
 
 
101
  }
102
 
103
  }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/Totals.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Sales_Order_Totals extends Mage_Adminhtml_Block_Sales_Order_Totals
27
+ {
28
+
29
+ /**
30
+ * Initialize order totals array
31
+ *
32
+ * @return Mage_Sales_Block_Order_Totals
33
+ */
34
+ protected function _initTotals()
35
+ {
36
+ parent::_initTotals();
37
+ $helper = Mage::helper('novalnet_payment');
38
+ $amountchangedvalue = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
39
+ if ($amountchangedvalue) {
40
+ $adjustmentamount = -($this->getOrder()->getGrandTotal() - $amountchangedvalue);
41
+ $this->_totals['adjust_amount_changed'] = new Varien_Object(array(
42
+ 'code' => 'adjust_amount_changed',
43
+ 'strong' => true,
44
+ 'value' => $adjustmentamount,
45
+ 'base_value' => $adjustmentamount,
46
+ 'label' => Mage::helper('sales')->__('Novalnet Adjusted Amount'),
47
+ 'area' => 'footer'
48
+ ));
49
+
50
+ $this->_totals['amount_changed'] = new Varien_Object(array(
51
+ 'code' => 'amount_changed',
52
+ 'strong' => true,
53
+ 'value' => $amountchangedvalue,
54
+ 'base_value' => $amountchangedvalue,
55
+ 'label' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
56
+ 'area' => 'footer'
57
+ ));
58
+ }
59
+ return $this;
60
+ }
61
+
62
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View.php CHANGED
@@ -28,18 +28,16 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_B
28
 
29
  public function __construct()
30
  {
31
-
32
  parent::__construct();
33
-
34
  $order = $this->getOrder();
35
- $payment = $this->getOrder()->getPayment();
36
  $paymentMethod = $payment->getMethodInstance()->getCode();
37
  $helper = Mage::helper('novalnet_payment');
38
  $getTid = $helper->makeValidNumber($payment->getLastTransId());
39
 
 
40
  if (preg_match("/novalnet/i", $paymentMethod)) {
41
  $this->_removeButton('order_creditmemo');
42
-
43
  $getTransactionStatus = $helper->loadTransactionStatus($getTid);
44
 
45
  $this->_updateButton('order_invoice', 'label', Mage::helper('novalnet_payment')->__('Capture'));
@@ -60,13 +58,13 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_B
60
  Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
61
  $this->_removeButton('order_invoice');
62
  if ($getTransactionStatus->getTransactionStatus() == 91) {
 
63
  $this->_addButton('novalnet_confirm', array(
64
  'label' => Mage::helper('novalnet_payment')->__('Novalnet Capture'),
65
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/novalnetconfirm') . '\')',
66
  ), 0);
67
  }
68
  }
69
-
70
  if ($order->canCancel() && $getTransactionStatus->getTransactionStatus()
71
  < Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
72
  $this->_removeButton('void_payment');
@@ -76,16 +74,14 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_B
76
  'onclick' => "confirmSetLocation('{$message}', '{$this->getVoidPaymentUrl()}')",
77
  ));
78
  }
79
-
80
- if ($this->_isAllowedAction('ship') && $order->canShip()
81
- && !$order->getForcedDoShipmentWithInvoice()) {
82
- $this->_addButton('order_ship', array(
83
- 'label' => Mage::helper('sales')->__('Ship'),
84
- 'onclick' => 'setLocation(\'' . $this->getShipUrl() . '\')',
85
- 'class' => 'go'
86
- ));
87
- }
88
  }
89
  }
90
-
91
  }
28
 
29
  public function __construct()
30
  {
 
31
  parent::__construct();
 
32
  $order = $this->getOrder();
33
+ $payment = $order->getPayment();
34
  $paymentMethod = $payment->getMethodInstance()->getCode();
35
  $helper = Mage::helper('novalnet_payment');
36
  $getTid = $helper->makeValidNumber($payment->getLastTransId());
37
 
38
+
39
  if (preg_match("/novalnet/i", $paymentMethod)) {
40
  $this->_removeButton('order_creditmemo');
 
41
  $getTransactionStatus = $helper->loadTransactionStatus($getTid);
42
 
43
  $this->_updateButton('order_invoice', 'label', Mage::helper('novalnet_payment')->__('Capture'));
58
  Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
59
  $this->_removeButton('order_invoice');
60
  if ($getTransactionStatus->getTransactionStatus() == 91) {
61
+ $this->_removeButton('order_invoice');
62
  $this->_addButton('novalnet_confirm', array(
63
  'label' => Mage::helper('novalnet_payment')->__('Novalnet Capture'),
64
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/novalnetconfirm') . '\')',
65
  ), 0);
66
  }
67
  }
 
68
  if ($order->canCancel() && $getTransactionStatus->getTransactionStatus()
69
  < Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
70
  $this->_removeButton('void_payment');
74
  'onclick' => "confirmSetLocation('{$message}', '{$this->getVoidPaymentUrl()}')",
75
  ));
76
  }
77
+ if ($this->_isAllowedAction('ship') && $order->canShip()
78
+ && !$order->getForcedDoShipmentWithInvoice()) {
79
+ $this->_addButton('order_ship', array(
80
+ 'label' => Mage::helper('sales')->__('Ship'),
81
+ 'onclick' => 'setLocation(\'' . $this->getShipUrl() . '\')',
82
+ 'class' => 'go'
83
+ ));
84
+ }
 
85
  }
86
  }
 
87
  }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/Invoices.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_Invoices extends Mage_Adminhtml_Block_Widget_Grid
27
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
28
+ {
29
+
30
+ public function __construct()
31
+ {
32
+ parent::__construct();
33
+ $this->setId('order_invoices');
34
+ $this->setUseAjax(true);
35
+ }
36
+
37
+ /**
38
+ * Retrieve collection class
39
+ *
40
+ * @return string
41
+ */
42
+ protected function _getCollectionClass()
43
+ {
44
+ return 'sales/order_invoice_grid_collection';
45
+ }
46
+
47
+ /**
48
+ * Prepare order Collection for invoice
49
+ *
50
+ * @return Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_Invoices
51
+ */
52
+ protected function _prepareCollection()
53
+ {
54
+ $collection = Mage::getResourceModel($this->_getCollectionClass())
55
+ ->addFieldToSelect('entity_id')
56
+ ->addFieldToSelect('created_at')
57
+ ->addFieldToSelect('order_id')
58
+ ->addFieldToSelect('increment_id')
59
+ ->addFieldToSelect('state')
60
+ ->addFieldToSelect('grand_total')
61
+ ->addFieldToSelect('base_grand_total')
62
+ ->addFieldToSelect('store_currency_code')
63
+ ->addFieldToSelect('base_currency_code')
64
+ ->addFieldToSelect('order_currency_code')
65
+ ->addFieldToSelect('billing_name')
66
+ ->setOrderFilter($this->getOrder())
67
+ ;
68
+ $this->setCollection($collection);
69
+ return parent::_prepareCollection();
70
+ }
71
+
72
+ /**
73
+ * Define order invoice tab grid
74
+ *
75
+ * @return Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_Invoices
76
+ */
77
+ protected function _prepareColumns()
78
+ {
79
+ $this->addColumn('increment_id', array(
80
+ 'header' => Mage::helper('sales')->__('Invoice #'),
81
+ 'index' => 'increment_id',
82
+ 'width' => '120px',
83
+ ));
84
+
85
+ $this->addColumn('billing_name', array(
86
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
87
+ 'index' => 'billing_name',
88
+ ));
89
+
90
+ $this->addColumn('created_at', array(
91
+ 'header' => Mage::helper('sales')->__('Invoice Date'),
92
+ 'index' => 'created_at',
93
+ 'type' => 'datetime',
94
+ ));
95
+
96
+ $this->addColumn('state', array(
97
+ 'header' => Mage::helper('sales')->__('Status'),
98
+ 'index' => 'state',
99
+ 'type' => 'options',
100
+ 'options' => Mage::getModel('sales/order_invoice')->getStates(),
101
+ ));
102
+
103
+ $this->addColumn('base_grand_total', array(
104
+ 'header' => Mage::helper('customer')->__('Amount'),
105
+ 'index' => 'base_grand_total',
106
+ 'type' => 'currency',
107
+ 'currency' => 'base_currency_code',
108
+ ));
109
+ $helper = Mage::helper('novalnet_payment');
110
+ $countofvalues = $helper->getAmountCollection($this->getOrder()->getId(), NULL, NULL);
111
+ if ($countofvalues > 0) {
112
+ $this->addColumn('novalnet_amount', array(
113
+ 'header' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
114
+ 'width' => '2px',
115
+ 'sortable' => false,
116
+ 'filter' => false,
117
+ 'renderer' => 'novalnet_payment/adminhtml_sales_order_view_tab_renderer_invoices',
118
+ ));
119
+ }
120
+ return parent::_prepareColumns();
121
+ }
122
+
123
+ /**
124
+ * Retrieve order model instance
125
+ *
126
+ * @return Mage_Sales_Model_Order
127
+ */
128
+ public function getOrder()
129
+ {
130
+ return Mage::registry('current_order');
131
+ }
132
+
133
+ /**
134
+ * Return row url
135
+ *
136
+ * @return string
137
+ */
138
+ public function getRowUrl($row)
139
+ {
140
+ return $this->getUrl('*/sales_order_invoice/view', array(
141
+ 'invoice_id' => $row->getId(),
142
+ 'order_id' => $row->getOrderId()
143
+ )
144
+ );
145
+ }
146
+
147
+ /**
148
+ * Return grid url
149
+ *
150
+ * @return string
151
+ */
152
+ public function getGridUrl()
153
+ {
154
+ return $this->getUrl('*/*/invoices', array('_current' => true));
155
+ }
156
+
157
+ /**
158
+ * Return tab label
159
+ *
160
+ * @return string
161
+ */
162
+ public function getTabLabel()
163
+ {
164
+ return Mage::helper('sales')->__('Invoices');
165
+ }
166
+
167
+ /**
168
+ * Return tab title
169
+ *
170
+ * @return string
171
+ */
172
+ public function getTabTitle()
173
+ {
174
+ return Mage::helper('sales')->__('Order Invoices');
175
+ }
176
+
177
+ /**
178
+ * Can show tab
179
+ *
180
+ * @return boolean
181
+ */
182
+ public function canShowTab()
183
+ {
184
+ return true;
185
+ }
186
+
187
+ /**
188
+ * Tab is hidden
189
+ *
190
+ * @return boolean
191
+ */
192
+ public function isHidden()
193
+ {
194
+ return false;
195
+ }
196
+
197
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/Renderer/Invoices.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_Renderer_Invoices extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
27
+ {
28
+
29
+ /**
30
+ * Renders grid column
31
+ *
32
+ * @param Varien_Object $row
33
+ * @return string
34
+ */
35
+ public function render(Varien_Object $row)
36
+ {
37
+ $amount = '';
38
+ $orderId = $row->getOrderId();
39
+ $symbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
40
+ $amount .= $symbol;
41
+ $amount .= Mage::helper('novalnet_payment')->getAmountCollection($orderId, 1, NULL);
42
+ return $amount;
43
+ }
44
+
45
+ }
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/TransactionOverview.php CHANGED
@@ -29,11 +29,11 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionOverview
29
 
30
  public function __construct()
31
  {
32
- $this->setTemplate('novalnet/sales/order/transactionoverview.phtml');
33
  }
34
 
35
  /**
36
- * Return Tab label
37
  *
38
  * @return string
39
  */
@@ -43,7 +43,7 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionOverview
43
  }
44
 
45
  /**
46
- * Return Tab title
47
  *
48
  * @return string
49
  */
@@ -53,13 +53,19 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionOverview
53
  }
54
 
55
  /**
56
- * Can show tab in tabs
57
  *
58
  * @return boolean
59
  */
60
  public function canShowTab()
61
  {
62
- return true;
 
 
 
 
 
 
63
  }
64
 
65
  /**
@@ -73,7 +79,7 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionOverview
73
  }
74
 
75
  /**
76
- * Return Tab class
77
  *
78
  * @return string
79
  */
@@ -83,7 +89,7 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionOverview
83
  }
84
 
85
  /**
86
- * get current order
87
  *
88
  * @return Mage_Sales_Model_Order
89
  */
29
 
30
  public function __construct()
31
  {
32
+ $this->setTemplate('novalnet/sales/order/view/tab/transactionoverview.phtml');
33
  }
34
 
35
  /**
36
+ * Return tab label
37
  *
38
  * @return string
39
  */
43
  }
44
 
45
  /**
46
+ * Return tab title
47
  *
48
  * @return string
49
  */
53
  }
54
 
55
  /**
56
+ * Can show tab
57
  *
58
  * @return boolean
59
  */
60
  public function canShowTab()
61
  {
62
+ $order = $this->getOrder();
63
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
64
+ if (preg_match("/novalnet/i", $paymentCode)) {
65
+ return true;
66
+ } else {
67
+ return false;
68
+ }
69
  }
70
 
71
  /**
79
  }
80
 
81
  /**
82
+ * Return tab class
83
  *
84
  * @return string
85
  */
89
  }
90
 
91
  /**
92
+ * Get current order
93
  *
94
  * @return Mage_Sales_Model_Order
95
  */
app/code/community/Novalnet/Payment/Block/Adminhtml/Sales/Order/View/Tab/TransactionStatus.php CHANGED
@@ -65,7 +65,13 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionStatus ex
65
  */
66
  public function canShowTab()
67
  {
68
- return true;
 
 
 
 
 
 
69
  }
70
 
71
  /**
@@ -89,7 +95,7 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionStatus ex
89
  }
90
 
91
  /**
92
- * get current order
93
  *
94
  * @return Mage_Sales_Model_Order
95
  */
@@ -158,10 +164,10 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionStatus ex
158
  {
159
  $order = $this->getOrder();
160
 
161
- // @var $transStatCollection Novalnet_Payment_Model_TransactionStatus_Collection
162
- $transStatCollection = $this->helperNovalnetPayment()->getModelTransactionStatus()->getCollection();
163
- $transStatCollection->getByOrder($order);
164
- return $transStatCollection;
165
  }
166
 
167
  /**
@@ -171,44 +177,44 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionStatus ex
171
  */
172
  protected function _prepareColumns()
173
  {
174
- $helperNnPayment = $this->helperNovalnetPayment();
175
  $this->setColumn('txid', array(
176
- 'header' => $helperNnPayment->__('Transaction no'),
177
  'width' => '200px',
178
  'type' => 'text',
179
  'index' => 'transaction_no',
180
  )
181
  );
182
  $this->setColumn('order_id', array(
183
- 'header' => $helperNnPayment->__('Order no'),
184
  'width' => '200px',
185
  'type' => 'text',
186
  'index' => 'order_id',
187
  )
188
  );
189
  $this->setColumn('transaction_status', array(
190
- 'header' => $helperNnPayment->__('Transaction Status'),
191
  'width' => '200px',
192
  'type' => 'text',
193
  'index' => 'transaction_status',
194
  )
195
  );
196
  $this->setColumn('ncno', array(
197
- 'header' => $helperNnPayment->__('NC No'),
198
  'width' => '200px',
199
  'type' => 'text',
200
  'index' => 'nc_no',
201
  )
202
  );
203
  $this->setColumn('customer_id', array(
204
- 'header' => $helperNnPayment->__('Customer ID'),
205
  'width' => '200px',
206
  'type' => 'text',
207
  'index' => 'customer_id',
208
  )
209
  );
210
  $this->setColumn('store_id', array(
211
- 'header' => $helperNnPayment->__('Store ID'),
212
  'width' => '200px',
213
  'type' => 'text',
214
  'index' => 'store_id',
@@ -221,7 +227,7 @@ class Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_TransactionStatus ex
221
  /**
222
  * Add coumn
223
  *
224
- * @return
225
  */
226
  private function setColumn($field, $fieldColumnMap)
227
  {
65
  */
66
  public function canShowTab()
67
  {
68
+ $order = $this->getOrder();
69
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
70
+ if (preg_match("/novalnet/i", $paymentCode)) {
71
+ return true;
72
+ } else {
73
+ return false;
74
+ }
75
  }
76
 
77
  /**
95
  }
96
 
97
  /**
98
+ * Get current order
99
  *
100
  * @return Mage_Sales_Model_Order
101
  */
164
  {
165
  $order = $this->getOrder();
166
 
167
+ // @var $StatusCollection Novalnet_Payment_Model_TransactionStatus_Collection
168
+ $statusCollection = $this->helperNovalnetPayment()->getModelTransactionStatus()->getCollection();
169
+ $statusCollection->getByOrder($order);
170
+ return $statusCollection;
171
  }
172
 
173
  /**
177
  */
178
  protected function _prepareColumns()
179
  {
180
+ $helper = $this->helperNovalnetPayment();
181
  $this->setColumn('txid', array(
182
+ 'header' => $helper->__('Transaction ID'),
183
  'width' => '200px',
184
  'type' => 'text',
185
  'index' => 'transaction_no',
186
  )
187
  );
188
  $this->setColumn('order_id', array(
189
+ 'header' => $helper->__('Order number'),
190
  'width' => '200px',
191
  'type' => 'text',
192
  'index' => 'order_id',
193
  )
194
  );
195
  $this->setColumn('transaction_status', array(
196
+ 'header' => $helper->__('Transaction Status'),
197
  'width' => '200px',
198
  'type' => 'text',
199
  'index' => 'transaction_status',
200
  )
201
  );
202
  $this->setColumn('ncno', array(
203
+ 'header' => $helper->__('NC No'),
204
  'width' => '200px',
205
  'type' => 'text',
206
  'index' => 'nc_no',
207
  )
208
  );
209
  $this->setColumn('customer_id', array(
210
+ 'header' => $helper->__('Customer ID'),
211
  'width' => '200px',
212
  'type' => 'text',
213
  'index' => 'customer_id',
214
  )
215
  );
216
  $this->setColumn('store_id', array(
217
+ 'header' => $helper->__('Store ID'),
218
  'width' => '200px',
219
  'type' => 'text',
220
  'index' => 'store_id',
227
  /**
228
  * Add coumn
229
  *
230
+ * @return null
231
  */
232
  private function setColumn($field, $fieldColumnMap)
233
  {
app/code/community/Novalnet/Payment/Block/Adminhtml/Transaction/Grid.php CHANGED
@@ -28,9 +28,6 @@ class Novalnet_Payment_Block_Adminhtml_Transaction_Grid extends Mage_Adminhtml_B
28
 
29
  var $novalnetPayments = array();
30
 
31
- /**
32
- *
33
- */
34
  public function __construct()
35
  {
36
  parent::__construct();
@@ -42,7 +39,7 @@ class Novalnet_Payment_Block_Adminhtml_Transaction_Grid extends Mage_Adminhtml_B
42
  }
43
 
44
  /**
45
- * Prepare order Collection for novalnet transaction status
46
  *
47
  * @return Novalnet_Payment_Block_Adminhtml_Transaction_Grid
48
  */
28
 
29
  var $novalnetPayments = array();
30
 
 
 
 
31
  public function __construct()
32
  {
33
  parent::__construct();
39
  }
40
 
41
  /**
42
+ * Prepare order Collection for Novalnet transaction status
43
  *
44
  * @return Novalnet_Payment_Block_Adminhtml_Transaction_Grid
45
  */
app/code/community/Novalnet/Payment/Block/Adminhtml/Transaction/View.php CHANGED
@@ -53,7 +53,7 @@ class Novalnet_Payment_Block_Adminhtml_Transaction_View extends Mage_Adminhtml_B
53
  }
54
 
55
  /**
56
- * get Novalnet transaction status
57
  *
58
  * @return string
59
  */
@@ -69,19 +69,21 @@ class Novalnet_Payment_Block_Adminhtml_Transaction_View extends Mage_Adminhtml_B
69
  */
70
  public function getCurrencyCode()
71
  {
72
- $order = Mage::getModel("sales/order")->loadByIncrementId(trim($this->getNovalnetTransactionStatus()->getOrderId()));
 
73
  return $order->getOrderCurrencyCode();
74
  }
75
 
76
  /**
77
- * get payment method title
78
  *
79
  * @return string
80
  */
81
  public function getPaymentTitle()
82
  {
83
  $transactionStatus = $this->getNovalnetTransactionStatus();
84
- $title = Mage::helper("novalnet_payment")->getModel($transactionStatus->getPaymentName())->_getConfigData('title');
 
85
  return $title;
86
  }
87
 
53
  }
54
 
55
  /**
56
+ * Get Novalnet transaction status
57
  *
58
  * @return string
59
  */
69
  */
70
  public function getCurrencyCode()
71
  {
72
+ $order = Mage::getModel("sales/order")->loadByIncrementId(
73
+ trim($this->getNovalnetTransactionStatus()->getOrderId()));
74
  return $order->getOrderCurrencyCode();
75
  }
76
 
77
  /**
78
+ * Get payment method title
79
  *
80
  * @return string
81
  */
82
  public function getPaymentTitle()
83
  {
84
  $transactionStatus = $this->getNovalnetTransactionStatus();
85
+ $title = Mage::helper("novalnet_payment")->getModel(
86
+ $transactionStatus->getPaymentName())->_getConfigData('title');
87
  return $title;
88
  }
89
 
app/code/community/Novalnet/Payment/Block/Adminhtml/Transactionoverview/Grid.php CHANGED
@@ -54,22 +54,22 @@ class Novalnet_Payment_Block_Adminhtml_Transactionoverview_Grid extends Mage_Adm
54
  */
55
  protected function _prepareColumns()
56
  {
57
- $helperNnPayment = $this->helperNovalnetPayment();
58
 
59
  $this->addColumn('order_id', array(
60
- 'header' => $helperNnPayment->__('Order no #'),
61
  'width' => '80px',
62
  'type' => 'text',
63
  'index' => 'order_id',
64
  ));
65
  $this->addColumn('transaction_no', array(
66
- 'header' => $helperNnPayment->__('Transaction #'),
67
  'width' => '80px',
68
  'type' => 'text',
69
  'index' => 'transaction_id',
70
  ));
71
  $this->addColumn('id', array(
72
- 'header' => $helperNnPayment->__('Store id #'),
73
  'width' => '80px',
74
  'type' => 'text',
75
  'index' => 'store_id',
54
  */
55
  protected function _prepareColumns()
56
  {
57
+ $helper = $this->helperNovalnetPayment();
58
 
59
  $this->addColumn('order_id', array(
60
+ 'header' => $helper->__('Order no #'),
61
  'width' => '80px',
62
  'type' => 'text',
63
  'index' => 'order_id',
64
  ));
65
  $this->addColumn('transaction_no', array(
66
+ 'header' => $helper->__('Transaction #'),
67
  'width' => '80px',
68
  'type' => 'text',
69
  'index' => 'transaction_id',
70
  ));
71
  $this->addColumn('id', array(
72
+ 'header' => $helper->__('Store id #'),
73
  'width' => '80px',
74
  'type' => 'text',
75
  'index' => 'store_id',
app/code/community/Novalnet/Payment/Block/Adminhtml/Transactionoverview/View.php CHANGED
@@ -48,24 +48,24 @@ class Novalnet_Payment_Block_Adminhtml_Transactionoverview_View extends Mage_Adm
48
  }
49
 
50
  /**
51
- * get Novalnet transaction overview
52
  *
53
  * @return string
54
  */
55
  public function getNovalnetTransactionOverview()
56
  {
57
  return Mage::registry('novalnet_payment_transactionoverview');
58
- ;
59
  }
60
 
61
  /**
62
- * get payment method title
63
  *
64
  * @return string
65
  */
66
  public function getPaymentTitle()
67
  {
68
- $order = Mage::getModel("sales/order")->loadByIncrementId(trim($this->getNovalnetTransactionOverview()->getOrderId()));
 
69
  if ($order->getPayment()) {
70
  $paymentMethod = $order->getPayment()->getMethod();
71
  $title = Mage::helper("novalnet_payment")->getModel($paymentMethod)->_getConfigData('title');
48
  }
49
 
50
  /**
51
+ * Get Novalnet transaction overview
52
  *
53
  * @return string
54
  */
55
  public function getNovalnetTransactionOverview()
56
  {
57
  return Mage::registry('novalnet_payment_transactionoverview');
 
58
  }
59
 
60
  /**
61
+ * Get payment method title
62
  *
63
  * @return string
64
  */
65
  public function getPaymentTitle()
66
  {
67
+ $order = Mage::getModel("sales/order")->loadByIncrementId(
68
+ trim($this->getNovalnetTransactionOverview()->getOrderId()));
69
  if ($order->getPayment()) {
70
  $paymentMethod = $order->getPayment()->getMethod();
71
  $title = Mage::helper("novalnet_payment")->getModel($paymentMethod)->_getConfigData('title');
app/code/community/Novalnet/Payment/Block/Adminhtml/Widget.php CHANGED
@@ -25,7 +25,10 @@
25
  */
26
  class Novalnet_Payment_Block_Adminhtml_Widget extends Mage_Adminhtml_Block_Widget_Form_Container
27
  {
28
-
 
 
 
29
  public function __construct()
30
  {
31
  parent::__construct();
25
  */
26
  class Novalnet_Payment_Block_Adminhtml_Widget extends Mage_Adminhtml_Block_Widget_Form_Container
27
  {
28
+ /**
29
+ * Set the configuration wizard template
30
+ *
31
+ */
32
  public function __construct()
33
  {
34
  parent::__construct();
app/code/community/Novalnet/Payment/Block/Adminhtml/Widget/Grid/Container.php CHANGED
@@ -25,7 +25,11 @@
25
  */
26
  class Novalnet_Payment_Block_Adminhtml_Widget_Grid_Container extends Mage_Adminhtml_Block_Widget_Grid_Container
27
  {
28
-
 
 
 
 
29
  public function getHeaderCssClass()
30
  {
31
  return 'novalnet-adminhtml-head ' . parent::getHeaderCssClass();
25
  */
26
  class Novalnet_Payment_Block_Adminhtml_Widget_Grid_Container extends Mage_Adminhtml_Block_Widget_Grid_Container
27
  {
28
+ /**
29
+ * Return grid header css class
30
+ *
31
+ * @return mixed
32
+ */
33
  public function getHeaderCssClass()
34
  {
35
  return 'novalnet-adminhtml-head ' . parent::getHeaderCssClass();
app/{design/adminhtml/default/default/template/novalnet/payment/method/pdf/Sofortueberweisung.phtml → code/community/Novalnet/Payment/Block/Cart/Item/Renderer.php} RENAMED
@@ -1,29 +1,39 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
- * would be greatly appreciated.
20
- *
21
- * @category Novalnet
22
- * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- ?>
27
- <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
28
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
29
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $this->getInfo()->getLastTransId()) ?>{{pdf_row_separator}}
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_Item_Renderer
27
+ {
28
+ /**
29
+ * Get list of all otions for product
30
+ *
31
+ * @return array
32
+ */
33
+ public function getOptionList()
34
+ {
35
+ Mage::getSingleton('checkout/session')->setOptionprofile($this->getProductOptions());
36
+ return $this->getProductOptions();
37
+ }
38
+
39
+ }
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/{Sofortueberweisung.php → Banktransfer.php} RENAMED
@@ -23,16 +23,17 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Novalnet_Payment_Block_Payment_Method_Form_Sofortueberweisung extends Mage_Payment_Block_Form
27
  {
28
 
29
  /**
30
  * Init default template for block
 
31
  */
32
  protected function _construct()
33
  {
34
  parent::_construct();
35
- $this->setTemplate('novalnet/payment/method/form/Sofortueberweisung.phtml');
36
  }
37
 
38
  /**
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Novalnet_Payment_Block_Payment_Method_Form_Banktransfer extends Mage_Payment_Block_Form
27
  {
28
 
29
  /**
30
  * Init default template for block
31
+ *
32
  */
33
  protected function _construct()
34
  {
35
  parent::_construct();
36
+ $this->setTemplate('novalnet/payment/method/form/Banktransfer.phtml');
37
  }
38
 
39
  /**
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Cc.php CHANGED
@@ -25,7 +25,10 @@
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_Form
27
  {
28
-
 
 
 
29
  protected function _construct()
30
  {
31
  parent::_construct();
@@ -53,7 +56,7 @@ class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_F
53
  }
54
 
55
  /**
56
- * Retrieve availables credit card types
57
  *
58
  * @return array
59
  */
@@ -89,7 +92,7 @@ class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_F
89
  }
90
 
91
  /**
92
- * Retrieve credit card expire months
93
  *
94
  * @return array
95
  */
@@ -104,7 +107,7 @@ class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_F
104
  }
105
 
106
  /**
107
- * Retrieve credit card expire years
108
  *
109
  * @return array
110
  */
@@ -112,12 +115,33 @@ class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_F
112
  {
113
  $years = $this->getData('cc_years');
114
  if (is_null($years)) {
115
- $years = $this->_getConfig()->getYears();
116
  $this->setData('cc_years', $years);
117
  }
118
  return $years;
119
  }
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  /**
122
  * Get information to end user from config
123
  *
@@ -127,4 +151,5 @@ class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_F
127
  {
128
  return $this->getMethod()->getConfigData('booking_reference');
129
  }
 
130
  }
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_Form_Cc extends Mage_Payment_Block_Form
27
  {
28
+ /**
29
+ * Init default template for block
30
+ *
31
+ */
32
  protected function _construct()
33
  {
34
  parent::_construct();
56
  }
57
 
58
  /**
59
+ * Retrieve availables Credit Card types
60
  *
61
  * @return array
62
  */
92
  }
93
 
94
  /**
95
+ * Retrieve Credit Card expiry months
96
  *
97
  * @return array
98
  */
107
  }
108
 
109
  /**
110
+ * Retrieve Credit Card expiry years
111
  *
112
  * @return array
113
  */
115
  {
116
  $years = $this->getData('cc_years');
117
  if (is_null($years)) {
118
+ $years = $this->getYears();
119
  $this->setData('cc_years', $years);
120
  }
121
  return $years;
122
  }
123
 
124
+ /**
125
+ * Retrieve Credit Card expiry years from Novalnet configuration
126
+ *
127
+ * @return array
128
+ */
129
+ private function getYears()
130
+ {
131
+ $method = $this->getMethod();
132
+ $configYears = $method->getConfigData('cc_valid_year');
133
+ $count = $configYears ? $configYears : 25;
134
+
135
+ $years = array();
136
+ $first = date("Y");
137
+
138
+ for ($index = 0; $index < $count; $index++) {
139
+ $year = $first + $index;
140
+ $years[$year] = $year;
141
+ }
142
+ return $years;
143
+ }
144
+
145
  /**
146
  * Get information to end user from config
147
  *
151
  {
152
  return $this->getMethod()->getConfigData('booking_reference');
153
  }
154
+
155
  }
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Eps.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Payment_Method_Form_Eps extends Mage_Payment_Block_Form
27
+ {
28
+
29
+ /**
30
+ * Init default template for block
31
+ *
32
+ */
33
+ protected function _construct()
34
+ {
35
+ parent::_construct();
36
+ $this->setTemplate('novalnet/payment/method/form/Eps.phtml');
37
+ }
38
+
39
+ /**
40
+ * Get information to end user from config
41
+ *
42
+ * @return string
43
+ */
44
+ public function getUserInfo()
45
+ {
46
+ return $this->getMethod()->getConfigData('booking_reference');
47
+ }
48
+
49
+ }
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Ideal.php CHANGED
@@ -28,6 +28,7 @@ class Novalnet_Payment_Block_Payment_Method_Form_Ideal extends Mage_Payment_Bloc
28
 
29
  /**
30
  * Init default template for block
 
31
  */
32
  protected function _construct()
33
  {
28
 
29
  /**
30
  * Init default template for block
31
+ *
32
  */
33
  protected function _construct()
34
  {
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Invoice.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Magento
4
  *
@@ -25,7 +26,10 @@
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_Form_Invoice extends Mage_Payment_Block_Form
27
  {
28
-
 
 
 
29
  protected function _construct()
30
  {
31
  parent::_construct();
1
  <?php
2
+
3
  /**
4
  * Magento
5
  *
26
  */
27
  class Novalnet_Payment_Block_Payment_Method_Form_Invoice extends Mage_Payment_Block_Form
28
  {
29
+ /**
30
+ * Init default template for block
31
+ *
32
+ */
33
  protected function _construct()
34
  {
35
  parent::_construct();
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Paypal.php CHANGED
@@ -28,6 +28,7 @@ class Novalnet_Payment_Block_Payment_Method_Form_Paypal extends Mage_Payment_Blo
28
 
29
  /**
30
  * Init default template for block
 
31
  */
32
  protected function _construct()
33
  {
28
 
29
  /**
30
  * Init default template for block
31
+ *
32
  */
33
  protected function _construct()
34
  {
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Prepayment.php CHANGED
@@ -26,6 +26,10 @@
26
  class Novalnet_Payment_Block_Payment_Method_Form_Prepayment extends Mage_Payment_Block_Form
27
  {
28
 
 
 
 
 
29
  protected function _construct()
30
  {
31
  parent::_construct();
@@ -42,4 +46,14 @@ class Novalnet_Payment_Block_Payment_Method_Form_Prepayment extends Mage_Payment
42
  return $this->getMethod()->getConfigData('booking_reference');
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
45
  }
26
  class Novalnet_Payment_Block_Payment_Method_Form_Prepayment extends Mage_Payment_Block_Form
27
  {
28
 
29
+ /**
30
+ * Init default template for block
31
+ *
32
+ */
33
  protected function _construct()
34
  {
35
  parent::_construct();
46
  return $this->getMethod()->getConfigData('booking_reference');
47
  }
48
 
49
+ /**
50
+ * Retrieve Novalnet Mode in Configuration
51
+ *
52
+ * @return boolean
53
+ */
54
+ public function getLiveMode()
55
+ {
56
+ return $this->getMethod()->_getConfigData('live_mode');
57
+ }
58
+
59
  }
app/code/community/Novalnet/Payment/Block/Payment/Method/Form/Sepa.php CHANGED
@@ -25,7 +25,10 @@
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_Form_Sepa extends Mage_Payment_Block_Form
27
  {
28
-
 
 
 
29
  protected function _construct()
30
  {
31
  parent::_construct();
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_Form_Sepa extends Mage_Payment_Block_Form
27
  {
28
+ /**
29
+ * Init default template for block
30
+ *
31
+ */
32
  protected function _construct()
33
  {
34
  parent::_construct();
app/code/community/Novalnet/Payment/Block/Payment/Method/Info/{Sofortueberweisung.php → Banktransfer.php} RENAMED
@@ -23,7 +23,7 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Novalnet_Payment_Block_Payment_Method_Info_Sofortueberweisung extends Mage_Payment_Block_Info
27
  {
28
 
29
  /**
@@ -33,7 +33,7 @@ class Novalnet_Payment_Block_Payment_Method_Info_Sofortueberweisung extends Mage
33
  protected function _construct()
34
  {
35
  parent::_construct();
36
- $this->setTemplate('novalnet/payment/method/info/Sofortueberweisung.phtml');
37
  }
38
 
39
  /**
@@ -53,7 +53,7 @@ class Novalnet_Payment_Block_Payment_Method_Info_Sofortueberweisung extends Mage
53
  */
54
  public function toPdf()
55
  {
56
- $this->setTemplate('novalnet/payment/method/pdf/Sofortueberweisung.phtml');
57
  return $this->toHtml();
58
  }
59
 
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Novalnet_Payment_Block_Payment_Method_Info_Banktransfer extends Mage_Payment_Block_Info
27
  {
28
 
29
  /**
33
  protected function _construct()
34
  {
35
  parent::_construct();
36
+ $this->setTemplate('novalnet/payment/method/info/Banktransfer.phtml');
37
  }
38
 
39
  /**
53
  */
54
  public function toPdf()
55
  {
56
+ $this->setTemplate('novalnet/payment/method/pdf/Banktransfer.phtml');
57
  return $this->toHtml();
58
  }
59
 
app/code/community/Novalnet/Payment/Block/Payment/Method/Info/Eps.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Payment_Method_Info_Eps extends Mage_Payment_Block_Info
27
+ {
28
+
29
+ /**
30
+ * Init default template for block
31
+ *
32
+ */
33
+ protected function _construct()
34
+ {
35
+ parent::_construct();
36
+ $this->setTemplate('novalnet/payment/method/info/Eps.phtml');
37
+ }
38
+
39
+ /**
40
+ * Retrieve payment method model
41
+ *
42
+ * @return Mage_Payment_Model_Method_Abstract
43
+ */
44
+ public function getMethod()
45
+ {
46
+ return $this->getInfo()->getMethodInstance();
47
+ }
48
+
49
+ /**
50
+ * Render as PDF
51
+ *
52
+ * @return string
53
+ */
54
+ public function toPdf()
55
+ {
56
+ $this->setTemplate('novalnet/payment/method/pdf/Eps.phtml');
57
+ return $this->toHtml();
58
+ }
59
+
60
+ /**
61
+ * Get some specific information
62
+ *
63
+ * @return array
64
+ */
65
+ public function getAdditionalData($key)
66
+ {
67
+ return Mage::helper('novalnet_payment')->getAdditionalData($this->getInfo(), $key);
68
+ }
69
+
70
+ }
app/code/community/Novalnet/Payment/Block/Payment/Method/Info/Ideal.php CHANGED
@@ -28,7 +28,6 @@ class Novalnet_Payment_Block_Payment_Method_Info_Ideal extends Mage_Payment_Bloc
28
 
29
  /**
30
  * Init default template for block
31
- *
32
  */
33
  protected function _construct()
34
  {
28
 
29
  /**
30
  * Init default template for block
 
31
  */
32
  protected function _construct()
33
  {
app/code/community/Novalnet/Payment/Block/Payment/Method/Info/Prepayment.php CHANGED
@@ -37,7 +37,7 @@ class Novalnet_Payment_Block_Payment_Method_Info_Prepayment extends Mage_Payment
37
 
38
  /**
39
  * Render as PDF
40
- *
41
  * @return string
42
  */
43
  public function toPdf()
37
 
38
  /**
39
  * Render as PDF
40
+ *
41
  * @return string
42
  */
43
  public function toPdf()
app/code/community/Novalnet/Payment/Block/Payment/Method/NovalnetRedirect.php CHANGED
@@ -20,7 +20,7 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_NovalnetRedirect extends Mage_Core_Block_Abstract
@@ -33,7 +33,7 @@ class Novalnet_Payment_Block_Payment_Method_NovalnetRedirect extends Mage_Core_B
33
  $helper = Mage::helper('novalnet_payment');
34
  $paymentCode = $payment->getMethodInstance()->getCode();
35
  $actionUrl = $helper->getPayportUrl('redirect', $paymentCode);
36
- $authorizeKey = $paymentObj->_getConfigData('password', true);
37
 
38
  if ($authorizeKey) {
39
  $form = new Varien_Data_Form();
@@ -59,7 +59,8 @@ class Novalnet_Payment_Block_Payment_Method_NovalnetRedirect extends Mage_Core_B
59
  'auth_code' => $authCode,
60
  'product' => $productId,
61
  'tariff' => $tariffId,
62
- 'key' => $logFormData['key']
 
63
  );
64
  if ($paymentCode == Novalnet_Payment_Model_Config::NN_CC && $paymentObj->_getConfigData('active_cc3d')) {
65
  $data['ActiveCc3d'] = 1;
@@ -76,6 +77,7 @@ class Novalnet_Payment_Block_Payment_Method_NovalnetRedirect extends Mage_Core_B
76
 
77
  // IE & Firefox will not submit form if the form is full of hidden fileds.
78
  $form->addField('continue', 'submit', array('name' => 'Continue', 'value' => $this->__('Continue')));
 
79
  $html = '<html><body>';
80
  $html.= $this->__('You will be redirected to Novalnet AG in a few seconds.');
81
  $html.= $form->toHtml();
@@ -87,5 +89,4 @@ class Novalnet_Payment_Block_Payment_Method_NovalnetRedirect extends Mage_Core_B
87
  return $html;
88
  }
89
  }
90
-
91
  }
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  class Novalnet_Payment_Block_Payment_Method_NovalnetRedirect extends Mage_Core_Block_Abstract
33
  $helper = Mage::helper('novalnet_payment');
34
  $paymentCode = $payment->getMethodInstance()->getCode();
35
  $actionUrl = $helper->getPayportUrl('redirect', $paymentCode);
36
+ $authorizeKey = $paymentObj->loadAffAccDetail();
37
 
38
  if ($authorizeKey) {
39
  $form = new Varien_Data_Form();
59
  'auth_code' => $authCode,
60
  'product' => $productId,
61
  'tariff' => $tariffId,
62
+ 'key' => $logFormData['key'],
63
+ 'authorize_key' => $authorizeKey
64
  );
65
  if ($paymentCode == Novalnet_Payment_Model_Config::NN_CC && $paymentObj->_getConfigData('active_cc3d')) {
66
  $data['ActiveCc3d'] = 1;
77
 
78
  // IE & Firefox will not submit form if the form is full of hidden fileds.
79
  $form->addField('continue', 'submit', array('name' => 'Continue', 'value' => $this->__('Continue')));
80
+
81
  $html = '<html><body>';
82
  $html.= $this->__('You will be redirected to Novalnet AG in a few seconds.');
83
  $html.= $form->toHtml();
89
  return $html;
90
  }
91
  }
 
92
  }
app/code/community/Novalnet/Payment/Block/Sales/Adminhtml/Recurring/Profile/View.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Block_Sales_Adminhtml_Recurring_Profile_View extends Mage_Sales_Block_Adminhtml_Recurring_Profile_View
27
+ {
28
+
29
+ /**
30
+ * Prepare layout for recurring profile
31
+ *
32
+ * @return Mage_Sales_Block_Adminhtml_Recurring_Profile_View
33
+ */
34
+ protected function _prepareLayout()
35
+ {
36
+ $profile = Mage::registry('current_recurring_profile');
37
+
38
+ if (!preg_match("/novalnet/i", $profile->getMethodCode()))
39
+ return parent::_prepareLayout();
40
+
41
+ $this->_addButton('back', array(
42
+ 'label' => Mage::helper('adminhtml')->__('Back'),
43
+ 'onclick' => "setLocation('{$this->getUrl('*/*/')}')",
44
+ 'class' => 'back'
45
+ ));
46
+
47
+ $comfirmationMessage = Mage::helper('sales')->__('Are you sure you want to do this?');
48
+
49
+ // cancel
50
+ if ($profile->canCancel()) {
51
+ $url = $this->getUrl('*/*/updateState', array('profile' => $profile->getId(),
52
+ 'action' => 'cancel'));
53
+ $this->_addButton('cancel', array(
54
+ 'label' => Mage::helper('sales')->__('Cancel'),
55
+ 'onclick' => "cancelviewstatus('recurring_buttons_view','recurring_cancel_button_view')",
56
+ 'class' => 'delete',
57
+ ));
58
+ }
59
+ // suspend
60
+ $state = $profile->getState();
61
+ if ($profile->canSuspend() && $state != 'pending') {
62
+ $url = $this->getUrl('*/*/updateState', array('profile' => $profile->getId(),
63
+ 'action' => 'suspend'));
64
+ $this->_addButton('suspend', array(
65
+ 'label' => Mage::helper('sales')->__('Suspend'),
66
+ 'onclick' => "confirmSetLocation('{$comfirmationMessage}', '{$url}')",
67
+ 'class' => 'delete',
68
+ ));
69
+ }
70
+
71
+ // activate
72
+ if ($profile->canActivate() && $state != 'pending') {
73
+ $url = $this->getUrl('*/*/updateState', array('profile' => $profile->getId(),
74
+ 'action' => 'activate'));
75
+ $this->_addButton('activate', array(
76
+ 'label' => Mage::helper('sales')->__('Activate'),
77
+ 'onclick' => "confirmSetLocation('{$comfirmationMessage}', '{$url}')",
78
+ 'class' => 'add',
79
+ ));
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Set title and a hack for tabs container
85
+ *
86
+ * @return Mage_Sales_Block_Adminhtml_Recurring_Profile_View
87
+ */
88
+ protected function _beforeToHtml()
89
+ {
90
+ $profile = Mage::registry('current_recurring_profile');
91
+ $this->_headerText = Mage::helper('sales')->__('Recurring Profile # %s', $profile->getReferenceId());
92
+ $this->setViewHtml('<div id="' . $this->getDestElementId() . '"></div>');
93
+ return parent::_beforeToHtml();
94
+ }
95
+
96
+ /**
97
+ * Get cancel reasons for recurring cancel
98
+ *
99
+ * @return mixed
100
+ */
101
+ protected function _getCancelButtonWithReasons()
102
+ {
103
+ $profile = Mage::registry('current_recurring_profile');
104
+ $comfirmationMessage = Mage::helper('sales')->__('Are you sure you want to do this?');
105
+ $helper = Mage::helper('sales');
106
+ $lang = $helper->__("Please select reason,");
107
+ $lang .= $helper->__("Product is costly,");
108
+ $lang .= $helper->__("Cheating,");
109
+ $lang .= $helper->__("Partner interfered,");
110
+ $lang .= $helper->__("Financial problem,");
111
+ $lang .= $helper->__("Content does not match my likes,");
112
+ $lang .= $helper->__("Content is not enough,");
113
+ $lang .= $helper->__("Interested only for a trial,");
114
+ $lang .= $helper->__("Page is very slow,");
115
+ $lang .= $helper->__("Satisfied customer,");
116
+ $lang .= $helper->__("Logging in problems,");
117
+ $lang .= $helper->__("Other reasons");
118
+ $cancelview = "";
119
+ if ($profile->canCancel()) {
120
+ $cancelReason = $helper->__("Please select the reason of subscription cancellation");
121
+ $select = Mage::app()->getLayout()->createBlock('core/html_select')
122
+ ->setName("cancel_reason")
123
+ ->setId("reason-subscribe")
124
+ ->setOptions(explode(",", $lang));
125
+
126
+ $cancelview .= $select->getHtml();
127
+
128
+ $url = $this->getUrl('*/*/updateState', array('profile' => $profile->getId(),
129
+ 'action' => 'cancel'));
130
+ $this->setChild('cancel', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
131
+ 'label' => Mage::helper('sales')->__('Cancel'),
132
+ 'onclick' => "cancel_action('{$comfirmationMessage}', '{$url}', '{$cancelReason}')",
133
+ 'class' => 'delete',
134
+ ))
135
+ );
136
+ $cancelview .= $this->getChildHtml('cancel');
137
+ }
138
+ return $cancelview;
139
+ }
140
+
141
+ }
app/code/community/Novalnet/Payment/Block/Sales/Order/Creditmemo/Totals.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * Part of the payment module of Novalnet AG
17
+ * https://www.novalnet.de
18
+ * If you have found this script useful a small
19
+ * recommendation as well as a comment on merchant form
20
+ * would be greatly appreciated.
21
+ *
22
+ * @category Novalnet
23
+ * @package Novalnet_Payment
24
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ class Novalnet_Payment_Block_Sales_Order_Creditmemo_Totals extends Mage_Sales_Block_Order_Creditmemo_Totals
28
+ {
29
+ /**
30
+ * Initialize creditmemo totals array
31
+ *
32
+ * @return Mage_Sales_Block_Order_Totals
33
+ */
34
+ protected function _initTotals()
35
+ {
36
+ parent::_initTotals();
37
+
38
+ $helper = Mage::helper('novalnet_payment');
39
+ $amountchangedvalue = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
40
+ if ($amountchangedvalue) {
41
+ $this->_totals['refund_amount_changed'] = new Varien_Object(array(
42
+ 'code' => 'refund_amount_changed',
43
+ 'strong' => true,
44
+ 'value' => $this->getSource()->getGrandTotal(),
45
+ 'base_value' => $this->getSource()->getBaseGrandTotal(),
46
+ 'label' => Mage::helper('sales')->__('Novalnet refunded Amount'),
47
+ 'area' => 'footer'
48
+ ));
49
+
50
+ $this->_totals['amount_changed'] = new Varien_Object(array(
51
+ 'code' => 'amount_changed',
52
+ 'strong' => true,
53
+ 'value' => $amountchangedvalue,
54
+ 'base_value' => $amountchangedvalue,
55
+ 'label' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
56
+ 'area' => 'footer'
57
+ ));
58
+ }
59
+
60
+ return $this;
61
+ }
62
+
63
+ }
app/code/community/Novalnet/Payment/Block/Sales/Order/Invoice/Totals.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * Part of the payment module of Novalnet AG
17
+ * https://www.novalnet.de
18
+ * If you have found this script useful a small
19
+ * recommendation as well as a comment on merchant form
20
+ * would be greatly appreciated.
21
+ *
22
+ * @category Novalnet
23
+ * @package Novalnet_Payment
24
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ class Novalnet_Payment_Block_Sales_Order_Invoice_Totals extends Mage_Sales_Block_Order_Invoice_Totals
28
+ {
29
+
30
+ /**
31
+ * Initialize order totals array
32
+ *
33
+ * @return Mage_Sales_Block_Order_Totals
34
+ */
35
+ protected function _initTotals()
36
+ {
37
+ parent::_initTotals();
38
+
39
+ $helper = Mage::helper('novalnet_payment');
40
+ $amountchangedvalue = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
41
+ $grandtotal = $this->getOrder()->getGrandTotal();
42
+ $adjustmentamount = -($this->getOrder()->getGrandTotal() - $amountchangedvalue);
43
+ if ($amountchangedvalue) {
44
+ $this->_totals['adjust_amount_changed'] = new Varien_Object(array(
45
+ 'code' => 'adjust_amount_changed',
46
+ 'strong' => true,
47
+ 'value' => $adjustmentamount,
48
+ 'base_value' => $adjustmentamount,
49
+ 'label' => Mage::helper('sales')->__('Novalnet Adjusted Amount'),
50
+ 'area' => 'footer'
51
+ ));
52
+ $this->_totals['amount_changed'] = new Varien_Object(array(
53
+ 'code' => 'amount_changed',
54
+ 'strong' => true,
55
+ 'value' => $amountchangedvalue,
56
+ 'base_value' => $amountchangedvalue,
57
+ 'label' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
58
+ 'area' => 'footer'
59
+ ));
60
+ }
61
+
62
+ return $this;
63
+ }
64
+
65
+ }
app/code/community/Novalnet/Payment/Block/Sales/Order/Totals.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * Part of the payment module of Novalnet AG
17
+ * https://www.novalnet.de
18
+ * If you have found this script useful a small
19
+ * recommendation as well as a comment on merchant form
20
+ * would be greatly appreciated.
21
+ *
22
+ * @category Novalnet
23
+ * @package Novalnet_Payment
24
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ class Novalnet_Payment_Block_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals
28
+ {
29
+ /**
30
+ * Initialize order totals array
31
+ *
32
+ * @return Mage_Sales_Block_Order_Totals
33
+ */
34
+ protected function _initTotals()
35
+ {
36
+ parent::_initTotals();
37
+
38
+ $helper = Mage::helper('novalnet_payment');
39
+ $amountchangedvalue = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
40
+ if ($amountchangedvalue) {
41
+ $adjustmentamount = -($this->getOrder()->getGrandTotal() - $amountchangedvalue);
42
+ $this->_totals['adjust_amount_changed'] = new Varien_Object(array(
43
+ 'code' => 'adjust_amount_changed',
44
+ 'strong' => true,
45
+ 'value' => $adjustmentamount,
46
+ 'base_value' => $adjustmentamount,
47
+ 'label' => Mage::helper('sales')->__('Novalnet Adjusted Amount'),
48
+ 'area' => 'footer'
49
+ ));
50
+
51
+ $this->_totals['amount_changed'] = new Varien_Object(array(
52
+ 'code' => 'amount_changed',
53
+ 'strong' => true,
54
+ 'value' => $amountchangedvalue,
55
+ 'base_value' => $amountchangedvalue,
56
+ 'label' => Mage::helper('sales')->__('Novalnet Transaction Amount'),
57
+ 'area' => 'footer'
58
+ ));
59
+ }
60
+
61
+ return $this;
62
+ }
63
+
64
+ }
app/code/community/Novalnet/Payment/Block/Sales/Recurring/Profile/View.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Recurring profile view
29
+ */
30
+ class Novalnet_Payment_Block_Sales_Recurring_Profile_View extends Mage_Sales_Block_Recurring_Profile_View
31
+ {
32
+
33
+ /**
34
+ * Prepare recurring profile view
35
+ *
36
+ */
37
+ public function prepareViewData()
38
+ {
39
+ if (preg_match("/novalnet/i", $this->_profile->getMethodCode())) {
40
+ $this->setTemplate('novalnet/sales/recurring/profile/view.phtml');
41
+ }
42
+
43
+ $helper = Mage::helper('novalnet_payment');
44
+ $lang = $helper->__("Please select reason,");
45
+ $lang .= $helper->__("Product is costly,");
46
+ $lang .= $helper->__("Cheating,");
47
+ $lang .= $helper->__("Partner interfered,");
48
+ $lang .= $helper->__("Financial problem,");
49
+ $lang .= $helper->__("Content does not match my likes,");
50
+ $lang .= $helper->__("Content is not enough,");
51
+ $lang .= $helper->__("Interested only for a trial,");
52
+ $lang .= $helper->__("Page is very slow,");
53
+ $lang .= $helper->__("Satisfied customer,");
54
+ $lang .= $helper->__("Logging in problems,");
55
+ $lang .= $helper->__("Other reasons");
56
+
57
+ $select = Mage::app()->getLayout()->createBlock('core/html_select')
58
+ ->setName("cancel_reason")
59
+ ->setId("reason-subscribe")
60
+ ->setOptions(explode(",", $lang));
61
+
62
+ $this->addData(array(
63
+ 'reference_id' => $this->_profile->getReferenceId(),
64
+ 'can_cancel' => $this->_profile->canCancel(),
65
+ 'cancel_url' => $this->getUrl('*/*/updateState', array('profile' => $this->_profile->getId(),
66
+ 'action' => 'cancel')),
67
+ 'can_suspend' => $this->_profile->canSuspend(),
68
+ 'suspend_url' => $this->getUrl('*/*/updateState', array('profile' => $this->_profile->getId(),
69
+ 'action' => 'suspend')),
70
+ 'can_activate' => $this->_profile->canActivate(),
71
+ 'activate_url' => $this->getUrl('*/*/updateState', array('profile' => $this->_profile->getId(),
72
+ 'action' => 'activate')),
73
+ 'can_update' => $this->_profile->canFetchUpdate(),
74
+ 'update_url' => $this->getUrl('*/*/updateProfile', array('profile' => $this->_profile->getId())),
75
+ 'back_url' => $this->getUrl('*/*/'),
76
+ 'confirmation_message' => Mage::helper('sales')->__('Are you sure you want to do this?'),
77
+ 'cancel_reason' => $select->getHtml(),
78
+ ));
79
+ }
80
+
81
+ /**
82
+ * Prepare profile schedule info
83
+ *
84
+ */
85
+ public function prepareScheduleInfo()
86
+ {
87
+ $this->_shouldRenderInfo = true;
88
+ $getPaymentname = $this->_profile->getMethodCode();
89
+ $paymentName = array(
90
+ Novalnet_Payment_Model_Config::NN_PREPAYMENT,
91
+ Novalnet_Payment_Model_Config::NN_INVOICE,
92
+ Novalnet_Payment_Model_Config::NN_CC,
93
+ Novalnet_Payment_Model_Config::NN_SEPA
94
+ );
95
+ $m = 0;
96
+ if (!in_array($getPaymentname, $paymentName)) {
97
+ $m = 1;
98
+ foreach (array('start_datetime', 'suspension_threshold') as $key) {
99
+ $this->_addInfo(array(
100
+ 'label' => $this->_profile->getFieldLabel($key),
101
+ 'value' => $this->_profile->renderData($key),
102
+ ));
103
+ }
104
+ }
105
+ foreach ($this->_profile->exportScheduleInfo() as $i) {
106
+ if (!$m && $i->getTitle() != 'Trial Period') {
107
+ $this->_addInfo(array(
108
+ 'label' => $i->getTitle(),
109
+ 'value' => $i->getSchedule(),
110
+ ));
111
+ } else if ($m == 1) {
112
+ $this->_addInfo(array(
113
+ 'label' => $i->getTitle(),
114
+ 'value' => $i->getSchedule(),
115
+ ));
116
+ }
117
+ }
118
+ }
119
+
120
+ }
app/code/community/Novalnet/Payment/Helper/AssignData.php CHANGED
@@ -25,21 +25,20 @@
25
  */
26
  class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
27
  {
28
-
29
  /**
30
  * Name library directory.
31
  */
32
  const NAME_DIR_JS = 'novalnet/';
33
 
34
  /**
35
- * List files for include.
36
  *
37
- * @var array
38
  */
39
  protected $_files = array(
40
- 'jquery-1.10.2.min.js',
41
  'novalnetcc.js',
42
- 'novalnetsepa.js',
43
  );
44
 
45
  /**
@@ -77,18 +76,9 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
77
  if (!($data instanceof Varien_Object)) {
78
  $data = new Varien_Object($data);
79
  }
80
- $methodSession = $this->_getCheckout()->getData($paymentCode);
81
-
82
  switch ($paymentCode) {
83
  case Novalnet_Payment_Model_Config::NN_CC:
84
-
85
- $paymentInfo = $this->novalnetCardDetails('payment');
86
- $methodSession->setCcPanHash($this->novalnetCardDetails('novalnet_cc_hash'))
87
- ->setCcUniqueId($this->novalnetCardDetails('novalnet_cc_unique_id'))
88
- ->setNnCcCvc($paymentInfo['nn_cc_cid'])
89
- ->setNnCallbackTelNovalnetCc($data->getCallbackTel())
90
- ->setNnCallbackEmailNovalnetCc($data->getCallbackEmail());
91
- $this->_getCheckout()->setNnPaymentCode($paymentCode);
92
  $infoInstance->setNnCallbackTelNovalnetCc($data->getCallbackTel())
93
  ->setNnCallbackPinNovalnetCc(trim($data->getCallbackPin()))
94
  ->setNnNewCallbackPinNovalnetCc($data->getNewCallbackPin())
@@ -97,26 +87,27 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
97
  != 3) {
98
  $infoInstance->setCallbackPinValidationFlag(true);
99
  }
 
 
 
 
 
100
  break;
101
  case Novalnet_Payment_Model_Config::NN_SEPA:
102
-
103
- $paymentInfo = $this->novalnetCardDetails('payment');
104
- $methodSession->setSepaHash($this->novalnetCardDetails('result_sepa_hash'))
105
- ->setSepaUniqueId($this->novalnetCardDetails('result_mandate_unique'))
106
- ->setSepaHolder($paymentInfo['account_holder'])
107
- ->setIbanConfirmed($this->novalnetCardDetails('nnsepa_iban_confirmed'))
108
- ->setSepaDuedate($this->getModel($paymentCode)->_getConfigData('sepa_due_date'))
109
- ->setNnCallbackTelNovalnetSepa($data->getCallbackTel())
110
- ->setNnCallbackEmailNovalnetSepa($data->getCallbackEmail());
111
- $this->_getCheckout()->setNnPaymentCode($paymentCode);
112
  $infoInstance->setNnCallbackTelNovalnetSepa($data->getCallbackTel())
113
  ->setNnCallbackPinNovalnetSepa(trim($data->getCallbackPin()))
114
  ->setNnNewCallbackPinNovalnetSepa($data->getNewCallbackPin())
115
- ->setNnCallbackEmailNovalnetSepa($data->getCallbackEmail());
 
 
116
  if ($this->getModel($paymentCode)->_getConfigData('callback')
117
  != 3) {
118
  $infoInstance->setCallbackPinValidationFlag(true);
119
  }
 
 
 
 
120
  break;
121
  case Novalnet_Payment_Model_Config::NN_INVOICE:
122
  $infoInstance->setNnCallbackTelNovalnetInvoice($data->getCallbackTel())
@@ -127,13 +118,14 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
127
  != 3) {
128
  $infoInstance->setCallbackPinValidationFlag(true);
129
  }
 
130
  break;
131
  }
132
  }
133
  }
134
 
135
  /**
136
- * validate novalnet form data
137
  *
138
  * $param string $paymentCode
139
  * $param instance $infoInstance
@@ -143,71 +135,71 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
143
  {
144
  switch ($paymentCode) {
145
  case Novalnet_Payment_Model_Config::NN_CC:
146
- $getCardValues = $this->_getCheckout()->getData($paymentCode);
147
  $creditCardSecure = $this->getModel($paymentCode)->_getConfigData('active_cc3d');
 
148
 
149
- if ($creditCardSecure && !$this->getModel($paymentCode)->_getConfigData('password', true)) {
150
  Mage::throwException($this->__('Basic parameter not valid') . '!');
151
- } elseif (!$getCardValues->getCcPanHash() || !$getCardValues->getCcUniqueId()) {
152
- Mage::throwException($this->__('Please enter valid credit card details') . '!');
153
- } elseif (!$this->checkIsNumeric($getCardValues->getNnCcCvc())) {
154
- Mage::throwException($this->__('Please enter valid credit card details') . '!');
155
  } elseif (!$creditCardSecure && $this->checkCallbackAmount($paymentCode)
156
- && $this->getModel($paymentCode)->_getConfigData('callback') == '1'
157
- && !$infoInstance->getNnCallbackTelNovalnetCc() && !$this->checkIsAdmin()) {
158
- Mage::throwException($this->__('Please enter the Telephone / Mobilenumber') . '!');
159
  } elseif (!$creditCardSecure && $this->checkCallbackAmount($paymentCode)
160
- && $this->getModel($paymentCode)->_getConfigData('callback') == '3'
161
- && !$this->validateEmail($infoInstance->getNnCallbackEmailNovalnetCc())
162
  && !$this->checkIsAdmin()) {
163
- Mage::throwException($this->__('Please enter the E-Mail Address') . '!');
 
 
 
 
164
  }
165
  break;
166
  case Novalnet_Payment_Model_Config::NN_SEPA:
167
- $methodSession = $this->_getCheckout()->getData($paymentCode);
168
- $sepaDueDate = $methodSession->getSepaDuedate();
169
- $sepaHolder = trim($methodSession->getSepaHolder());
 
170
 
171
- if (strlen($sepaDueDate) > 0
172
- && ($sepaDueDate < 7 || !$this->checkIsNumeric($sepaDueDate))) {
173
  Mage::throwException($this->__('SEPA Due date is not valid') . '!');
174
- } elseif (!$methodSession->getIbanConfirmed()) {
175
- Mage::throwException($this->__('Please confirm IBAN & BIC'));
176
- } elseif (!$methodSession->getSepaHash() || !$methodSession->getSepaUniqueId()) {
177
- Mage::throwException($this->__('Please enter valid account details'));
178
  } elseif (!$sepaHolder || preg_match('/[#%\^<>@$=*!]/', $sepaHolder)) {
179
- Mage::throwException($this->__('Please enter valid account details') . '!');
 
 
 
 
180
  } elseif ($this->checkCallbackAmount($paymentCode)
181
- && $this->getModel($paymentCode)->_getConfigData('callback') == '1'
182
- && !$infoInstance->getNnCallbackTelNovalnetSepa() && !$this->checkIsAdmin()) {
183
- Mage::throwException($this->__('Please enter the Telephone / Mobilenumber') . '!');
184
  } elseif ($this->checkCallbackAmount($paymentCode)
185
- && $this->getModel($paymentCode)->_getConfigData('callback') == '3'
186
- && !$this->validateEmail($infoInstance->getNnCallbackEmailNovalnetSepa())
187
  && !$this->checkIsAdmin()) {
188
- Mage::throwException($this->__('Please enter the E-Mail Address') . '!');
189
  }
190
  break;
191
  case Novalnet_Payment_Model_Config::NN_IDEAL:
192
  case Novalnet_Payment_Model_Config::NN_PAYPAL:
193
  case Novalnet_Payment_Model_Config::NN_SOFORT:
194
- if (!$this->getModel($paymentCode)->_getConfigData('password', true)) {
195
- Mage::throwException($this->__('Basic parameter not valid') . '!');
196
- }
197
 
198
- if ($paymentCode == Novalnet_Payment_Model_Config::NN_PAYPAL
199
- && (!$this->getModel($paymentCode)->_getConfigData('api_sign', true)
200
- || !$this->getModel($paymentCode)->_getConfigData('api_user', true)
201
- || !$this->getModel($paymentCode)->_getConfigData('api_password', true))) {
202
  Mage::throwException($this->__('Basic parameter not valid') . '!');
203
  }
204
-
205
  break;
206
  }
207
  }
208
 
209
  /**
210
- * Assign novalnet return params for redirect payments
211
  *
212
  * $param varien_object $request
213
  * $param string $paymentCode
@@ -216,10 +208,11 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
216
  public function assignNovalnetReturnData(Varien_Object $request, $paymentCode)
217
  {
218
  $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
 
219
  $request->setUserVariable_0(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB))
220
  ->setReturnMethod(Novalnet_Payment_Model_Config::NOVALNET_RETURN_METHOD)
221
  ->setErrorReturnMethod(Novalnet_Payment_Model_Config::NOVALNET_RETURN_METHOD);
222
- if (in_array($paymentCode, $redirectPayment) || $paymentCode == Novalnet_Payment_Model_Config::NN_CC) {
223
  $request->setReturnUrl($this->getUrl(Novalnet_Payment_Model_Config::GATEWAY_RETURN_URL))
224
  ->setErrorReturnUrl($this->getUrl(Novalnet_Payment_Model_Config::GATEWAY_ERROR_RETURN_URL));
225
  }
@@ -236,7 +229,8 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
236
  {
237
  $encoding = $this->getPciEncodedParam($dataObj, $key);
238
  if ($encoding != true) {
239
- Mage::getSingleton('core/session')->addError($this->__('The methods for the handling of character sets are not available!'));
 
240
  $url = Mage::getModel('core/url')->getUrl("checkout/onepage/failure");
241
  Mage::app()->getResponse()->setRedirect($url);
242
  Mage::app()->getResponse()->sendResponse();
@@ -257,7 +251,7 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
257
  {
258
  $hash = $this->generateHash($dataObj, $key);
259
  if ($hash == false) {
260
- Mage::getSingleton('core/session')->addError($this->__('The hash functions are not available!'));
261
  $url = Mage::getModel('core/url')->getUrl("checkout/onepage/failure");
262
  Mage::app()->getResponse()->setRedirect($url);
263
  Mage::app()->getResponse()->sendResponse();
@@ -267,6 +261,28 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
267
  return $dataObj;
268
  }
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /**
271
  * Retrieve Credit Card Details
272
  *
@@ -279,7 +295,7 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
279
  }
280
 
281
  /**
282
- * remove sensitive data form novalnet log
283
  *
284
  * @param varien_object $request
285
  * @param string $paymentCode
@@ -292,30 +308,86 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
292
  case Novalnet_Payment_Model_Config::NN_CC:
293
  if ($this->getModel($paymentCode)->_getConfigData('active_cc3d')
294
  == 1) {
295
- unset($request['cc_holder'], $request['cc_exp_month'], $request['cc_exp_year'], $request['cc_cvc2'], $request['cc_type'], $request['cc_no'], $request['pan_hash']);
296
  } else {
297
  $request->unsCcHolder()
298
- ->unsCcNo()
299
  ->unsCcExpMonth()
300
  ->unsCcExpYear()
301
  ->unsCcCvc2()
302
- ->unsCcType()
303
  ->unsPanHash();
304
  }
305
  break;
306
  case Novalnet_Payment_Model_Config::NN_SEPA:
307
- $request->unsBankAccountHolder()
308
- ->unsBankAccount()
309
- ->unsBankCode()
310
- ->unsBic()
311
- ->unsIban()
312
- ->unsSepaHash();
 
 
 
 
 
 
 
 
 
 
 
313
  break;
314
  }
315
  }
316
  return $request;
317
  }
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  /**
320
  * Get Novalnet Bank Account Details
321
  *
@@ -326,11 +398,9 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
326
  {
327
  $dueDate = $result->getDueDate();
328
  $note = NULL;
329
- if ($dueDate) {
330
- $note .= 'Due Date: <b>' . Mage::helper('core')->formatDate($dueDate) . '</b>|NN Account Holder: <b>NOVALNET AG</b>';
331
- } else {
332
- $note .= 'NN Account Holder: <b>NOVALNET AG</b>';
333
- }
334
  $note .= '|IBAN: <b> ' . $result->getInvoiceIban() . '</b>';
335
  $note .= '|BIC: <b>' . $result->getInvoiceBic() . '</b>';
336
  $note .= '|NN_Bank: <b>' . $result->getInvoiceBankname() . ' ' . trim($result->getInvoiceBankplace()) . '</b>';
@@ -348,6 +418,7 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
348
  return 'NN_Amount: <b>' . Mage::helper('core')->currency($amount, true, false) . '</b>';
349
  }
350
 
 
351
  /**
352
  * Return bank details transaction id
353
  *
@@ -355,19 +426,18 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
355
  * @param array $data
356
  * @return string
357
  */
358
- public function getBankDetailsTID($tid, $data)
359
  {
360
  $productId = $data['product'] ? $data['product'] : '';
361
  $orderNo = $data['orderNo'] ? $data['orderNo'] : '';
362
-
363
- $note = NULL;
364
- $note .= "NN_Reference1:<b>BNR-$productId-$orderNo</b>";
365
  $note .= "|NN_Reference2:<b>TID $tid</b>";
366
- $note .= "|NN_Reference3:Order No&$orderNo";
367
 
368
  return $note;
369
  }
370
 
 
371
  /**
372
  * Check whether callback option is enabled
373
  *
@@ -376,11 +446,24 @@ class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
376
  */
377
  public function checkCallbackAmount($paymentCode)
378
  {
379
- $grandTotal = $this->_getCheckoutSession()->getQuote()->getBaseGrandTotal();
380
  $grandTotal = $this->getFormatedAmount($grandTotal);
381
  $callBackMinimum = (int) $this->getModel($paymentCode)->_getConfigData('callback_minimum_amount');
382
 
383
  return ($callBackMinimum ? $grandTotal >= $callBackMinimum : true);
384
  }
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  }
25
  */
26
  class Novalnet_Payment_Helper_AssignData extends Novalnet_Payment_Helper_Data
27
  {
 
28
  /**
29
  * Name library directory.
30
  */
31
  const NAME_DIR_JS = 'novalnet/';
32
 
33
  /**
34
+ * Novalnet script files
35
  *
36
+ * @return array
37
  */
38
  protected $_files = array(
39
+ 'novalnetJquery.js',
40
  'novalnetcc.js',
41
+ 'novalnetsepa.js'
42
  );
43
 
44
  /**
76
  if (!($data instanceof Varien_Object)) {
77
  $data = new Varien_Object($data);
78
  }
79
+ $this->getCheckout()->setRefilldatavalues($data);
 
80
  switch ($paymentCode) {
81
  case Novalnet_Payment_Model_Config::NN_CC:
 
 
 
 
 
 
 
 
82
  $infoInstance->setNnCallbackTelNovalnetCc($data->getCallbackTel())
83
  ->setNnCallbackPinNovalnetCc(trim($data->getCallbackPin()))
84
  ->setNnNewCallbackPinNovalnetCc($data->getNewCallbackPin())
87
  != 3) {
88
  $infoInstance->setCallbackPinValidationFlag(true);
89
  }
90
+ $this->getCheckout()->setCcPanHash($this->novalnetCardDetails('novalnet_cc_hash'))
91
+ ->setCcUniqueId($this->novalnetCardDetails('novalnet_cc_unique_id'))
92
+ ->setNnCcCvc($data->getNnCcCid())
93
+ ->setNnPaymentCode($paymentCode);
94
+
95
  break;
96
  case Novalnet_Payment_Model_Config::NN_SEPA:
 
 
 
 
 
 
 
 
 
 
97
  $infoInstance->setNnCallbackTelNovalnetSepa($data->getCallbackTel())
98
  ->setNnCallbackPinNovalnetSepa(trim($data->getCallbackPin()))
99
  ->setNnNewCallbackPinNovalnetSepa($data->getNewCallbackPin())
100
+ ->setNnCallbackEmailNovalnetSepa($data->getCallbackEmail())
101
+ ->setSepaDuedate($this->getModel($paymentCode)->_getConfigData('sepa_due_date'));
102
+
103
  if ($this->getModel($paymentCode)->_getConfigData('callback')
104
  != 3) {
105
  $infoInstance->setCallbackPinValidationFlag(true);
106
  }
107
+
108
+ $this->getCheckout()->setSepaHash($this->novalnetCardDetails('result_sepa_hash'))
109
+ ->setSepaUniqueId($this->novalnetCardDetails('result_mandate_unique'))
110
+ ->setNnPaymentCode($paymentCode);
111
  break;
112
  case Novalnet_Payment_Model_Config::NN_INVOICE:
113
  $infoInstance->setNnCallbackTelNovalnetInvoice($data->getCallbackTel())
118
  != 3) {
119
  $infoInstance->setCallbackPinValidationFlag(true);
120
  }
121
+ $this->getCheckout()->setNnPaymentCode($paymentCode);
122
  break;
123
  }
124
  }
125
  }
126
 
127
  /**
128
+ * validate Novalnet form data
129
  *
130
  * $param string $paymentCode
131
  * $param instance $infoInstance
135
  {
136
  switch ($paymentCode) {
137
  case Novalnet_Payment_Model_Config::NN_CC:
138
+ $accessKey = $this->getModel($paymentCode)->loadAffAccDetail();
139
  $creditCardSecure = $this->getModel($paymentCode)->_getConfigData('active_cc3d');
140
+ $callbackVal = $this->getModel($paymentCode)->_getConfigData('callback');
141
 
142
+ if (!$this->checkIsAdmin() && $creditCardSecure && !$accessKey) {
143
  Mage::throwException($this->__('Basic parameter not valid') . '!');
144
+ } elseif (!$this->getCheckout()->getCcPanHash() || !$this->getCheckout()->getCcUniqueId()) {
145
+ Mage::throwException($this->__('Your credit card details are invalid'));
 
 
146
  } elseif (!$creditCardSecure && $this->checkCallbackAmount($paymentCode)
147
+ && $callbackVal == '1' && !$infoInstance->getNnCallbackTelNovalnetCc()
148
+ && !$this->checkIsAdmin()) {
149
+ Mage::throwException($this->__('Please enter your telephone number') . '!');
150
  } elseif (!$creditCardSecure && $this->checkCallbackAmount($paymentCode)
151
+ && $callbackVal == '2' && !$infoInstance->getNnCallbackTelNovalnetCc()
 
152
  && !$this->checkIsAdmin()) {
153
+ Mage::throwException($this->__('Please enter your mobile number') . '!');
154
+ } elseif (!$creditCardSecure && $this->checkCallbackAmount($paymentCode)
155
+ && $callbackVal == '3' && !$this->validateEmail($infoInstance->getNnCallbackEmailNovalnetCc())
156
+ && !$this->checkIsAdmin()) {
157
+ Mage::throwException($this->__('Your E-mail address is invalid') . '!');
158
  }
159
  break;
160
  case Novalnet_Payment_Model_Config::NN_SEPA:
161
+ $paymentInfo = $this->novalnetCardDetails('payment');
162
+ $sepaHolder = $paymentInfo['account_holder'];
163
+ $sepaDueDate = $infoInstance->getSepaDuedate();
164
+ $callbackVal = $this->getModel($paymentCode)->_getConfigData('callback');
165
 
166
+ if (strlen($sepaDueDate) > 0 && ($sepaDueDate < 7 || !$this->checkIsNumeric($sepaDueDate))) {
 
167
  Mage::throwException($this->__('SEPA Due date is not valid') . '!');
168
+ } elseif (!$this->novalnetCardDetails('nnsepa_iban_confirmed')) {
169
+ Mage::throwException($this->__('Please accept the SEPA direct debit mandate'));
170
+ } elseif (!$this->getCheckout()->getSepaHash() || !$this->getCheckout()->getSepaUniqueId()) {
171
+ Mage::throwException($this->__('Your account details are invalid'));
172
  } elseif (!$sepaHolder || preg_match('/[#%\^<>@$=*!]/', $sepaHolder)) {
173
+ Mage::throwException($this->__('Your account details are invalid') . '!');
174
+ } elseif ($this->checkCallbackAmount($paymentCode)
175
+ && $callbackVal == '1' && !$infoInstance->getNnCallbackTelNovalnetSepa()
176
+ && !$this->checkIsAdmin()) {
177
+ Mage::throwException($this->__('Please enter your telephone number') . '!');
178
  } elseif ($this->checkCallbackAmount($paymentCode)
179
+ && $callbackVal == '2' && !$infoInstance->getNnCallbackTelNovalnetSepa()
180
+ && !$this->checkIsAdmin()) {
181
+ Mage::throwException($this->__('Please enter your mobile number') . '!');
182
  } elseif ($this->checkCallbackAmount($paymentCode)
183
+ && $callbackVal == '3' && !$this->validateEmail($infoInstance->getNnCallbackEmailNovalnetSepa())
 
184
  && !$this->checkIsAdmin()) {
185
+ Mage::throwException($this->__('Your E-mail address is invalid') . '!');
186
  }
187
  break;
188
  case Novalnet_Payment_Model_Config::NN_IDEAL:
189
  case Novalnet_Payment_Model_Config::NN_PAYPAL:
190
  case Novalnet_Payment_Model_Config::NN_SOFORT:
191
+ case Novalnet_Payment_Model_Config::NN_EPS:
192
+ $accessKey = $this->getModel($paymentCode)->loadAffAccDetail();
 
193
 
194
+ if (!$accessKey) {
 
 
 
195
  Mage::throwException($this->__('Basic parameter not valid') . '!');
196
  }
 
197
  break;
198
  }
199
  }
200
 
201
  /**
202
+ * Assign Novalnet return params for redirect payments
203
  *
204
  * $param varien_object $request
205
  * $param string $paymentCode
208
  public function assignNovalnetReturnData(Varien_Object $request, $paymentCode)
209
  {
210
  $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
211
+ array_push($redirectPayment, Novalnet_Payment_Model_Config::NN_CC);
212
  $request->setUserVariable_0(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB))
213
  ->setReturnMethod(Novalnet_Payment_Model_Config::NOVALNET_RETURN_METHOD)
214
  ->setErrorReturnMethod(Novalnet_Payment_Model_Config::NOVALNET_RETURN_METHOD);
215
+ if (in_array($paymentCode, $redirectPayment)) {
216
  $request->setReturnUrl($this->getUrl(Novalnet_Payment_Model_Config::GATEWAY_RETURN_URL))
217
  ->setErrorReturnUrl($this->getUrl(Novalnet_Payment_Model_Config::GATEWAY_ERROR_RETURN_URL));
218
  }
229
  {
230
  $encoding = $this->getPciEncodedParam($dataObj, $key);
231
  if ($encoding != true) {
232
+ $this->getCoresession()->addError(
233
+ $this->__('The methods for the handling of character sets are not available!'));
234
  $url = Mage::getModel('core/url')->getUrl("checkout/onepage/failure");
235
  Mage::app()->getResponse()->setRedirect($url);
236
  Mage::app()->getResponse()->sendResponse();
251
  {
252
  $hash = $this->generateHash($dataObj, $key);
253
  if ($hash == false) {
254
+ $this->getCoresession()->addError($this->__('The hash functions are not available!'));
255
  $url = Mage::getModel('core/url')->getUrl("checkout/onepage/failure");
256
  Mage::app()->getResponse()->setRedirect($url);
257
  Mage::app()->getResponse()->sendResponse();
261
  return $dataObj;
262
  }
263
 
264
+ /**
265
+ * Do XML call request to server
266
+ *
267
+ * @param varien_object $requestData
268
+ * @param string $requestUrl
269
+ * @return Mage_Payment_Model_Abstract Object
270
+ */
271
+ public function setRawCallRequest($requestData, $requestUrl)
272
+ {
273
+ $httpClientConfig = array('maxredirects' => 0);
274
+ $client = new Varien_Http_Client($requestUrl, $httpClientConfig);
275
+ $client->setRawData($requestData)->setMethod(Varien_Http_Client::POST);
276
+ $response = $client->request();
277
+ if (!$response->isSuccessful()) {
278
+ Mage::throwException($this->__('Gateway request error: %s', $response->getMessage()));
279
+ }
280
+ $result = new Varien_Object();
281
+ parse_str($response->getBody(), $data);
282
+ $result->addData($data);
283
+ return $result;
284
+ }
285
+
286
  /**
287
  * Retrieve Credit Card Details
288
  *
295
  }
296
 
297
  /**
298
+ * Remove sensitive data form Novalnet log
299
  *
300
  * @param varien_object $request
301
  * @param string $paymentCode
308
  case Novalnet_Payment_Model_Config::NN_CC:
309
  if ($this->getModel($paymentCode)->_getConfigData('active_cc3d')
310
  == 1) {
311
+ unset($request['cc_holder'], $request['cc_exp_month'], $request['cc_exp_year'], $request['cc_cvc2'], $request['pan_hash']);
312
  } else {
313
  $request->unsCcHolder()
 
314
  ->unsCcExpMonth()
315
  ->unsCcExpYear()
316
  ->unsCcCvc2()
 
317
  ->unsPanHash();
318
  }
319
  break;
320
  case Novalnet_Payment_Model_Config::NN_SEPA:
321
+ if ($request != NULL) {
322
+ $request->unsBankAccountHolder()
323
+ ->unsBankAccount()
324
+ ->unsBankCode()
325
+ ->unsBic()
326
+ ->unsIban()
327
+ ->unsSepaHash();
328
+ }
329
+ break;
330
+ case Novalnet_Payment_Model_Config::NN_PREPAYMENT: // refund request sepa Iban and bic are remove senitive data
331
+ case Novalnet_Payment_Model_Config::NN_INVOICE:
332
+ case Novalnet_Payment_Model_Config::NN_SOFORT:
333
+ case Novalnet_Payment_Model_Config::NN_IDEAL:
334
+ if ($request != NULL && isset($request['iban']) && isset($request['bic'])) {
335
+ $request->unsIban()
336
+ ->unsBic();
337
+ }
338
  break;
339
  }
340
  }
341
  return $request;
342
  }
343
 
344
+ /**
345
+ * validate Credit Card expiry date and month
346
+ *
347
+ * @param int $expYear
348
+ * @param int $expMonth
349
+ * @return bool
350
+ */
351
+ protected function _validateExpDate($expYear, $expMonth)
352
+ {
353
+ $date = Mage::app()->getLocale()->date();
354
+ if (!$expYear || !$expMonth || ($date->compareYear($expYear) == 1) || ($date->compareYear($expYear)
355
+ == 0 && ($date->compareMonth($expMonth) == 1))) {
356
+ return false;
357
+ }
358
+ return true;
359
+ }
360
+
361
+ /**
362
+ * Set Novalnet payment note for Invoice & Prepayment
363
+ *
364
+ * @return string
365
+ */
366
+ public function getNoteDescription()
367
+ {
368
+ return "<br /><b>" . $this->__(
369
+ 'Please transfer the invoice amount with the following information to our payment provider Novalnet AG') . "</b><br />";
370
+ }
371
+
372
+ /**
373
+ * Set Novalnet Due Date
374
+ *
375
+ * @param array $result
376
+ * @param int $invoiceDuedate
377
+ * @return mixed
378
+ */
379
+ public function getDueDate($result = NULL, $invoiceDuedate = NULL)
380
+ {
381
+ if ($result != NULL) {
382
+ $dueDate = $result->getDueDate();
383
+ } else if($invoiceDuedate != NULL) {
384
+ $dueDate = $invoiceDuedate;
385
+ }
386
+
387
+ return ($dueDate) ? ($this->__('Due Date') . ' : <b>' . Mage::helper('core')->formatDate($dueDate) . "</b><br />")
388
+ : NULL;
389
+ }
390
+
391
  /**
392
  * Get Novalnet Bank Account Details
393
  *
398
  {
399
  $dueDate = $result->getDueDate();
400
  $note = NULL;
401
+ $note .= $dueDate
402
+ ? 'Due Date: <b>' . Mage::helper('core')->formatDate($dueDate) . '</b>|NN Account Holder: <b>NOVALNET AG</b>'
403
+ : 'NN Account Holder: <b>NOVALNET AG</b>';
 
 
404
  $note .= '|IBAN: <b> ' . $result->getInvoiceIban() . '</b>';
405
  $note .= '|BIC: <b>' . $result->getInvoiceBic() . '</b>';
406
  $note .= '|NN_Bank: <b>' . $result->getInvoiceBankname() . ' ' . trim($result->getInvoiceBankplace()) . '</b>';
418
  return 'NN_Amount: <b>' . Mage::helper('core')->currency($amount, true, false) . '</b>';
419
  }
420
 
421
+
422
  /**
423
  * Return bank details transaction id
424
  *
426
  * @param array $data
427
  * @return string
428
  */
429
+ public function getReferenceDetails($tid,$data)
430
  {
431
  $productId = $data['product'] ? $data['product'] : '';
432
  $orderNo = $data['orderNo'] ? $data['orderNo'] : '';
433
+ $note = "NN_Reference1:<b>BNR-$productId-$orderNo</b>";
 
 
434
  $note .= "|NN_Reference2:<b>TID $tid</b>";
435
+ $note .= "|NN_Reference3:NN Order No&$orderNo";
436
 
437
  return $note;
438
  }
439
 
440
+
441
  /**
442
  * Check whether callback option is enabled
443
  *
446
  */
447
  public function checkCallbackAmount($paymentCode)
448
  {
449
+ $grandTotal = $this->getCheckoutSession()->getQuote()->getBaseGrandTotal();
450
  $grandTotal = $this->getFormatedAmount($grandTotal);
451
  $callBackMinimum = (int) $this->getModel($paymentCode)->_getConfigData('callback_minimum_amount');
452
 
453
  return ($callBackMinimum ? $grandTotal >= $callBackMinimum : true);
454
  }
455
 
456
+ /**
457
+ * Get checkout session
458
+ *
459
+ * @return Mage_Sales_Model_Order
460
+ */
461
+ public function getCheckout()
462
+ {
463
+ if ($this->checkIsAdmin()) {
464
+ return $this->getAdminCheckoutSession();
465
+ } else {
466
+ return $this->getCheckoutSession();
467
+ }
468
+ }
469
  }
app/code/community/Novalnet/Payment/Helper/Data.php CHANGED
@@ -25,7 +25,6 @@
25
  */
26
  class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
27
  {
28
-
29
  /**
30
  * Array values to configure global configuration
31
  */
@@ -36,13 +35,26 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
36
  'next_page' => 'generalGlobal',
37
  ),
38
  'generalGlobal' => array(
39
- 'group_name' => 'novalnet',
40
  'header_text' => 'Novalnet Global Configuration',
41
  'codes' => array(
42
  'page' => 'generalGlobal',
43
  'section' => 'novalnet_global',
44
  ),
45
  'previous_page' => 'index',
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  )
47
  );
48
 
@@ -73,7 +85,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
73
  }
74
 
75
  /**
76
- * Get novalnet configure wizard details
77
  *
78
  * @return varien_object
79
  */
@@ -83,7 +95,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
83
  }
84
 
85
  /**
86
- * Register novalnet configurtion wizard details
87
  *
88
  * @param Varien_Object $config
89
  */
@@ -95,11 +107,10 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
95
  /**
96
  * Get configuration page
97
  *
98
- * @return Varien_Object
99
  */
100
  public function getConfigPage()
101
  {
102
- /** @var $config Varien_Object */
103
  return Mage::registry('novalnet_wizard_config_page');
104
  }
105
 
@@ -116,7 +127,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
116
  /**
117
  * Initiate configuration page process
118
  *
119
- * @param $page
120
  * @return array|null
121
  */
122
  public function initConfigPage($page)
@@ -168,34 +179,10 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
168
  return $url;
169
  }
170
 
171
- /**
172
- * Get the respective payport url
173
- *
174
- * @return string
175
- */
176
- public function getPayportUrl($reqType, $paymentCode = NULL)
177
- {
178
- $protocol = Mage::app()->getStore()->isCurrentlySecure() ? 'https' : 'http';
179
-
180
- if ($paymentCode && $reqType == 'redirect') {
181
- $redirectUrl = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayportUrl');
182
- $payportUrl = $redirectUrl[$paymentCode];
183
- } else {
184
- $urlType = array(
185
- 'paygate' => Novalnet_Payment_Model_Config::PAYPORT_URL,
186
- 'infoport' => Novalnet_Payment_Model_Config::INFO_REQUEST_URL,
187
- 'cc' => Novalnet_Payment_Model_Config::CC_URL,
188
- 'sepa' => Novalnet_Payment_Model_Config::SEPA_URL
189
- );
190
- $payportUrl = $urlType[$reqType];
191
- }
192
- return $protocol . $payportUrl;
193
- }
194
-
195
  /**
196
  * Check whether logged in as admin
197
  *
198
- * @return bool
199
  */
200
  public function checkIsAdmin()
201
  {
@@ -221,7 +208,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
221
  {
222
  $storeId = Mage::getModel('sales/quote')->getStoreId();
223
  if ($this->checkIsAdmin()) {
224
- $storeId = $this->_getAdminCheckoutSession()->getStoreId();
225
  }
226
  return $storeId;
227
  }
@@ -237,20 +224,20 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
237
  }
238
 
239
  /**
240
- * Get current novalnet version
241
  *
242
  * @return string
243
  */
244
  public function getNovalnetVersion()
245
  {
246
  $versionInfo = (string) Mage::getConfig()->getNode('modules/Novalnet_Payment/version');
247
- return "NN_$versionInfo";
248
  }
249
 
250
  /**
251
  * Get customer Ip address
252
  *
253
- * @return string
254
  */
255
  public function getRealIpAddr()
256
  {
@@ -264,7 +251,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
264
  /**
265
  * Get Server Ip address
266
  *
267
- * @return string
268
  */
269
  public function getServerAddr()
270
  {
@@ -307,7 +294,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
307
  *
308
  * @return Mage_Checkout_Model_Session
309
  */
310
- public function _getCheckoutSession()
311
  {
312
  return Mage::getSingleton('checkout/session');
313
  }
@@ -317,29 +304,15 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
317
  *
318
  * @return Mage_adminhtml_Model_Session_quote
319
  */
320
- public function _getAdminCheckoutSession()
321
  {
322
  return Mage::getSingleton('adminhtml/session_quote');
323
  }
324
 
325
- /**
326
- * Get checkout session
327
- *
328
- * @return Mage_Sales_Model_Order
329
- */
330
- public function _getCheckout()
331
- {
332
- if ($this->checkIsAdmin()) {
333
- return $this->_getAdminCheckoutSession();
334
- } else {
335
- return $this->_getCheckoutSession();
336
- }
337
- }
338
-
339
  /**
340
  * Get shop's date and time
341
  *
342
- * @return date/time
343
  */
344
  public function getCurrentDateTime()
345
  {
@@ -356,6 +329,16 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
356
  return Mage::getSingleton('customer/session');
357
  }
358
 
 
 
 
 
 
 
 
 
 
 
359
  /**
360
  * Check customerNo for Logged in user
361
  *
@@ -366,14 +349,13 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
366
  try {
367
  $getCustomerSession = $this->getCustomerSession();
368
  $orderDetails = Mage::getModel('checkout/cart')->getQuote()->getData();
369
-
370
  //Checking customer login status
371
  $loginCheck = $getCustomerSession->isLoggedIn();
372
  if ($loginCheck) {
373
  $customerNo = $getCustomerSession->getCustomer()->getId();
374
  if (empty($customerNo)) {
375
- $coreSession = Mage::getSingleton('core/session');
376
- $customerNo = $coreSession['customer_id']; // Used Only customer id is not assigned in mage session
377
  }
378
  //Log customer Order details
379
  if ($customerNo == "") {
@@ -393,7 +375,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
393
  * for Zero subtotal Checkout
394
  *
395
  * $param int $grandTotal
396
- * @return bool
397
  */
398
  public function isModuleActive($grandTotal = NULL)
399
  {
@@ -407,12 +389,12 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
407
  * Check whether the CallbackTypeCall can be used
408
  *
409
  * $param string $countryCode
410
- * @return bool
411
  */
412
  public function isCallbackTypeAllowed($countryCode)
413
  {
414
- $allowedCountryCode = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('callbackAllowed');
415
- if (in_array($countryCode, $allowedCountryCode) && !(Mage::app()->getStore()->isAdmin())) {
416
  return true;
417
  }
418
  return false;
@@ -443,7 +425,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
443
  {
444
  $customerNo = '';
445
  if ($this->checkIsAdmin()) {
446
- $quoteCustomerNo = $this->_getAdminCheckoutSession()->getQuote()->getCustomerId();
447
  $customerNo = $quoteCustomerNo ? $quoteCustomerNo : 'guest';
448
  } else {
449
  $loginCheck = $this->getCustomerSession()->isLoggedIn();
@@ -506,7 +488,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
506
  if (strlen($exludedGroupes)) {
507
  $exludedGroupes = explode(',', $exludedGroupes);
508
  $custGrpId = $this->getCustomerSession()->getCustomerGroupId();
509
- return !in_array($custGrpId, $exludedGroupes);
510
  }
511
  return true;
512
  }
@@ -521,9 +503,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
521
  public function getEncodedParam($data, $key)
522
  {
523
  $data = trim($data);
524
- if ($data == '') {
525
- return'Error: no data';
526
- }
527
  if (!function_exists('base64_decode') or ! function_exists('pack') or ! function_exists('crc32')) {
528
  return'Error: func n/a';
529
  }
@@ -533,7 +513,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
533
  $data = bin2hex($data . $key);
534
  $data = strrev(base64_encode($data));
535
  } catch (Exception $e) {
536
- return false;
537
  }
538
  return $data;
539
  }
@@ -543,7 +523,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
543
  *
544
  * @param string $data
545
  * @param string $key
546
- * @return string
547
  */
548
  public function getPciEncodedParam(&$fields, $key)
549
  {
@@ -600,7 +580,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
600
  }
601
  return $value;
602
  } catch (Exception $e) {
603
- return false;
604
  }
605
  }
606
 
@@ -608,7 +588,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
608
  * Check whether there is an Empty string
609
  *
610
  * @param string $str
611
- * @return bool
612
  */
613
  public function isEmptyString($str)
614
  {
@@ -639,45 +619,22 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
639
  return md5($str . strrev($key));
640
  }
641
 
642
- /**
643
- * Generate return Hash value for PCI
644
- *
645
- * @param array $data
646
- * @param string $key
647
- * @return string
648
- */
649
- public function generateHashReturn($data, $key)
650
- {
651
- if (!function_exists('md5') || $this->isEmptyString($key)) {
652
- return false;
653
- }
654
- $hashFields = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('novalnetHashParams');
655
- $str = NULL;
656
- foreach ($hashFields as $_value) {
657
- if ($this->isEmptyString($data[$_value])) {
658
- return false;
659
- }
660
- $str .= $data[$_value];
661
- }
662
- return md5($str . strrev($key));
663
- }
664
-
665
  /**
666
  * Hash value getter
667
  *
668
- * @param array $h
669
  * @param string $key
670
  * @return string
671
  */
672
- public function getHash($h, $key)
673
  {
674
- if (empty($h)) {
675
  return'Error: no data';
676
  }
677
  if (!function_exists('md5')) {
678
  return'Error: func n/a';
679
  }
680
- return md5($h['auth_code'] . $h['product'] . $h['tariff'] . $h['amount'] . $h['test_mode'] . $h['uniqid'] . strrev($key));
681
  }
682
 
683
  /**
@@ -685,13 +642,11 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
685
  *
686
  * @param array $request
687
  * @param string $key
688
- * @return bool
689
  */
690
  public function checkHash($request, $key)
691
  {
692
- if (!$request) {
693
- return false;
694
- }
695
  if ($request['hash2'] != $this->getHash($request, $key)) {
696
  return false;
697
  }
@@ -722,8 +677,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
722
  }
723
 
724
  /**
725
- * Retrieve Novalnet Payment Key
726
- * Novalnet Payment Key, is a fixed value, DO NOT CHANGE!!!!!
727
  *
728
  * @param string $code
729
  * @return int
@@ -734,6 +688,18 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
734
  return $arrPaymentId[$code];
735
  }
736
 
 
 
 
 
 
 
 
 
 
 
 
 
737
  /**
738
  * Check orders count by customer id
739
  *
@@ -770,7 +736,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
770
  }
771
 
772
  /**
773
- * Get novalnet model class
774
  *
775
  * @param string $modelclass
776
  * @return Novalnet_Payment_Model_Payment_Method_Abstract
@@ -781,7 +747,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
781
  }
782
 
783
  /**
784
- * Get novalnet transaction status model
785
  *
786
  * @return Novalnet_Payment_Model_Transactionstatus_Collection
787
  */
@@ -791,7 +757,37 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
791
  }
792
 
793
  /**
794
- * Get novalnet transaction overview model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
795
  *
796
  * @return Novalnet_Payment_Model_Transactionoverview_Collection
797
  */
@@ -801,30 +797,50 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
801
  }
802
 
803
  /**
804
- * Get novalnet callback model
805
  *
806
- * @return Novalnet_Payment_Model_Callback_Collection
807
  */
808
- public function getModelCallback()
809
  {
810
- return Mage::getModel('novalnet_payment/callback');
811
  }
812
 
813
  /**
814
- * Get novalnet Affiliate model
815
  *
816
- * @return Novalnet_Payment_Model_Affiliate_Collection
817
  */
818
- public function getModelAffiliate()
819
  {
820
- return Mage::getModel('novalnet_payment/affiliate');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
821
  }
822
 
823
  /**
824
  * Check the value is numeric
825
  *
826
  * @param mixed $value
827
- * @return bool
828
  */
829
  public function checkIsNumeric($value)
830
  {
@@ -835,7 +851,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
835
  * Check the value contains special characters
836
  *
837
  * @param mixed $value
838
- * @return bool
839
  */
840
  public function checkIsValid($value)
841
  {
@@ -846,12 +862,12 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
846
  * Check the email id is valid
847
  *
848
  * @param mixed $value
849
- * @return bool
850
  */
851
  public function validateEmail($emailId)
852
  {
853
- return preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $emailId)
854
- ? true : false;
855
  }
856
 
857
  /**
@@ -870,7 +886,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
870
  *
871
  * @param float $amount
872
  * @param string $type
873
- * @return mixed
874
  */
875
  public function getFormatedAmount($amount, $type = 'CENT')
876
  {
@@ -878,7 +894,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
878
  }
879
 
880
  /**
881
- * Load novalnet transaction status based on tid
882
  *
883
  * @param integer $txnId
884
  * @return object Novalnet_Payment_Model_Transactionstatus
@@ -889,7 +905,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
889
  }
890
 
891
  /**
892
- * Load novalnet callback value based on order-id
893
  *
894
  * @param integer $orderId
895
  * @return object Novalnet_Payment_Model_Callback
@@ -900,7 +916,7 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
900
  }
901
 
902
  /**
903
- * Get novalnet payment configuration global path
904
  *
905
  * @return string
906
  */
@@ -920,61 +936,144 @@ class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
920
  }
921
 
922
  /**
923
- * Log novalnet transaction status data
924
  *
925
- * @param varien_object $response
926
- * @param varien_object $transactionStatus
927
- * @param varien_object $payment
928
- * @param float $amount
929
- * @param int $customerNo
930
- */
931
- public function doTransactionStatusSave($response, $transactionStatus, $payment,
932
- $amount = NULL, $customerNo = NULL
933
- ) {
934
- $paymentObj = $payment->getMethodInstance();
935
- $storeId = $payment->getOrder()->getStoreId();
936
- $ncNo = ($response->getNcNo()) ? $response->getNcNo() : NULL;
937
- $amount = ($response->getAmount() && is_numeric($response->getAmount())) ? $response->getAmount() : $amount;
938
- $customerId = $response->getCustomerNo() ? $response->getCustomerNo() : $customerNo;
939
- $orderId = ($response->getOrderNo()) ? $response->getOrderNo() : $payment->getOrder()->getIncrementId();
940
- $modNnTransStatus = Mage::getModel('novalnet_payment/transactionstatus');
941
- $modNnTransStatus->setTransactionNo($response->getTid())
942
- ->setOrderId($orderId)
943
- ->setTransactionStatus($transactionStatus->getStatus()) //Novalnet Admin transaction status
944
- ->setNcNo($ncNo)
945
- ->setCustomerId($customerId)
946
- ->setPaymentName($paymentObj->getCode())
947
- ->setAmount($amount)
948
- ->setRemoteIp($this->getRealIpAddr())
949
- ->setStoreId($storeId)
950
- ->setShopUrl($this->getCurrentSiteUrl())
951
- ->setCreatedDate($this->getCurrentDateTime())
952
- ->save();
953
- }
954
-
955
- /**
956
- * Log novalnet payment response data
957
- *
958
- * @param varien_object $response
959
- * @param int $orderId
960
- * @param int $storeId
961
- * @param int $customerId
962
- */
963
- public function doTransactionOrderLog($response, $orderId, $storeId = NULL, $customerId = NULL)
964
- {
965
- $customerId = ($customerId != NULL) ? $customerId : $this->getCustomerId();
966
- $storeId = ($storeId != NULL) ? $storeId : $this->getMagentoStoreId();
967
- $modNnTransOverview = $this->getModelTransactionOverview()->loadByAttribute('order_id', $orderId);
968
- $response = ($modNnTransOverview->getResponseData())
969
- ? new Varien_Object(array_merge(unserialize($modNnTransOverview->getResponseData()), $response->getData()))
970
- : $response;
971
- $modNnTransOverview->setTransactionId($response->gettid())
972
- ->setResponseData(serialize($response->getData()))
973
- ->setCustomerId($customerId)
974
- ->setStatus($response->getstatus()) //transaction status code
975
- ->setStoreId($storeId)
976
- ->setShopUrl($this->getCurrentSiteUrl())
977
- ->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
978
  }
979
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
980
  }
25
  */
26
  class Novalnet_Payment_Helper_Data extends Mage_Core_Helper_Abstract
27
  {
 
28
  /**
29
  * Array values to configure global configuration
30
  */
35
  'next_page' => 'generalGlobal',
36
  ),
37
  'generalGlobal' => array(
38
+ 'group_name' => array('novalnet', 'novalnetsetting'),
39
  'header_text' => 'Novalnet Global Configuration',
40
  'codes' => array(
41
  'page' => 'generalGlobal',
42
  'section' => 'novalnet_global',
43
  ),
44
  'previous_page' => 'index',
45
+ 'next_page' => 'save',
46
+ ),
47
+ 'paymentSave' => array(
48
+ 'group_name' => array('novalnetCc', 'novalnetSepa', 'novalnetInvoice',
49
+ 'novalnetPrepayment',
50
+ 'novalnetBanktransfer', 'novalnetPaypal', 'novalnetEps', 'novalnetIdeal'),
51
+ 'header_text' => 'Novalnet Global Configuration',
52
+ 'codes' => array(
53
+ 'page' => 'paymentSave',
54
+ 'section' => 'novalnet_paymethods',
55
+ ),
56
+ 'previous_page' => 'generalGlobal',
57
+ 'next_page' => '',
58
  )
59
  );
60
 
85
  }
86
 
87
  /**
88
+ * Get Novalnet configure wizard details
89
  *
90
  * @return varien_object
91
  */
95
  }
96
 
97
  /**
98
+ * Register Novalnet configurtion wizard details
99
  *
100
  * @param Varien_Object $config
101
  */
107
  /**
108
  * Get configuration page
109
  *
110
+ * @return varien_object
111
  */
112
  public function getConfigPage()
113
  {
 
114
  return Mage::registry('novalnet_wizard_config_page');
115
  }
116
 
127
  /**
128
  * Initiate configuration page process
129
  *
130
+ * @param string $page
131
  * @return array|null
132
  */
133
  public function initConfigPage($page)
179
  return $url;
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  /**
183
  * Check whether logged in as admin
184
  *
185
+ * @return boolean
186
  */
187
  public function checkIsAdmin()
188
  {
208
  {
209
  $storeId = Mage::getModel('sales/quote')->getStoreId();
210
  if ($this->checkIsAdmin()) {
211
+ $storeId = $this->getAdminCheckoutSession()->getStoreId();
212
  }
213
  return $storeId;
214
  }
224
  }
225
 
226
  /**
227
+ * Get current Novalnet version
228
  *
229
  * @return string
230
  */
231
  public function getNovalnetVersion()
232
  {
233
  $versionInfo = (string) Mage::getConfig()->getNode('modules/Novalnet_Payment/version');
234
+ return "NN({$versionInfo})";
235
  }
236
 
237
  /**
238
  * Get customer Ip address
239
  *
240
+ * @return int
241
  */
242
  public function getRealIpAddr()
243
  {
251
  /**
252
  * Get Server Ip address
253
  *
254
+ * @return int
255
  */
256
  public function getServerAddr()
257
  {
294
  *
295
  * @return Mage_Checkout_Model_Session
296
  */
297
+ public function getCheckoutSession()
298
  {
299
  return Mage::getSingleton('checkout/session');
300
  }
304
  *
305
  * @return Mage_adminhtml_Model_Session_quote
306
  */
307
+ public function getAdminCheckoutSession()
308
  {
309
  return Mage::getSingleton('adminhtml/session_quote');
310
  }
311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  /**
313
  * Get shop's date and time
314
  *
315
+ * @return mixed
316
  */
317
  public function getCurrentDateTime()
318
  {
329
  return Mage::getSingleton('customer/session');
330
  }
331
 
332
+ /**
333
+ * Get the core session
334
+ *
335
+ * @return Mage_Core_Model_Session
336
+ */
337
+ public function getCoresession()
338
+ {
339
+ return Mage::getSingleton('core/session');
340
+ }
341
+
342
  /**
343
  * Check customerNo for Logged in user
344
  *
349
  try {
350
  $getCustomerSession = $this->getCustomerSession();
351
  $orderDetails = Mage::getModel('checkout/cart')->getQuote()->getData();
 
352
  //Checking customer login status
353
  $loginCheck = $getCustomerSession->isLoggedIn();
354
  if ($loginCheck) {
355
  $customerNo = $getCustomerSession->getCustomer()->getId();
356
  if (empty($customerNo)) {
357
+ $visitorData = $this->getCoresession()->getVisitorData();
358
+ $customerNo = $visitorData['customer_id']; // Used Only customer id is not assigned in mage session
359
  }
360
  //Log customer Order details
361
  if ($customerNo == "") {
375
  * for Zero subtotal Checkout
376
  *
377
  * $param int $grandTotal
378
+ * @return boolean
379
  */
380
  public function isModuleActive($grandTotal = NULL)
381
  {
389
  * Check whether the CallbackTypeCall can be used
390
  *
391
  * $param string $countryCode
392
+ * @return boolean
393
  */
394
  public function isCallbackTypeAllowed($countryCode)
395
  {
396
+ $allowedCountryCode = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('callbackAllowedCountry');
397
+ if (in_array($countryCode, $allowedCountryCode) && !($this->checkIsAdmin())) {
398
  return true;
399
  }
400
  return false;
425
  {
426
  $customerNo = '';
427
  if ($this->checkIsAdmin()) {
428
+ $quoteCustomerNo = $this->getAdminCheckoutSession()->getQuote()->getCustomerId();
429
  $customerNo = $quoteCustomerNo ? $quoteCustomerNo : 'guest';
430
  } else {
431
  $loginCheck = $this->getCustomerSession()->isLoggedIn();
488
  if (strlen($exludedGroupes)) {
489
  $exludedGroupes = explode(',', $exludedGroupes);
490
  $custGrpId = $this->getCustomerSession()->getCustomerGroupId();
491
+ return !in_array($custGrpId, $exludedGroupes,true);
492
  }
493
  return true;
494
  }
503
  public function getEncodedParam($data, $key)
504
  {
505
  $data = trim($data);
506
+ if ($data == '') return'Error: no data';
 
 
507
  if (!function_exists('base64_decode') or ! function_exists('pack') or ! function_exists('crc32')) {
508
  return'Error: func n/a';
509
  }
513
  $data = bin2hex($data . $key);
514
  $data = strrev(base64_encode($data));
515
  } catch (Exception $e) {
516
+ Mage::logException('Error: ' . $e);
517
  }
518
  return $data;
519
  }
523
  *
524
  * @param string $data
525
  * @param string $key
526
+ * @return boolean
527
  */
528
  public function getPciEncodedParam(&$fields, $key)
529
  {
580
  }
581
  return $value;
582
  } catch (Exception $e) {
583
+ Mage::logException('Error: ' . $e);
584
  }
585
  }
586
 
588
  * Check whether there is an Empty string
589
  *
590
  * @param string $str
591
+ * @return boolean
592
  */
593
  public function isEmptyString($str)
594
  {
619
  return md5($str . strrev($key));
620
  }
621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  /**
623
  * Hash value getter
624
  *
625
+ * @param array $request
626
  * @param string $key
627
  * @return string
628
  */
629
+ public function getHash($request, $key)
630
  {
631
+ if (empty($request)) {
632
  return'Error: no data';
633
  }
634
  if (!function_exists('md5')) {
635
  return'Error: func n/a';
636
  }
637
+ return md5($request['auth_code'] . $request['product'] . $request['tariff'] . $request['amount'] . $request['test_mode'] . $request['uniqid'] . strrev($key));
638
  }
639
 
640
  /**
642
  *
643
  * @param array $request
644
  * @param string $key
645
+ * @return boolean
646
  */
647
  public function checkHash($request, $key)
648
  {
649
+ if (!$request) return false;
 
 
650
  if ($request['hash2'] != $this->getHash($request, $key)) {
651
  return false;
652
  }
677
  }
678
 
679
  /**
680
+ * Retrieve Novalnet payment key
 
681
  *
682
  * @param string $code
683
  * @return int
688
  return $arrPaymentId[$code];
689
  }
690
 
691
+ /**
692
+ * Retrieve Novalnet Payment Type
693
+ *
694
+ * @param string $code
695
+ * @return string
696
+ */
697
+ public function getPaymentType($code)
698
+ {
699
+ $arrPaymentType = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('novalnetPaymentTypes');
700
+ return $arrPaymentType[$code];
701
+ }
702
+
703
  /**
704
  * Check orders count by customer id
705
  *
736
  }
737
 
738
  /**
739
+ * Get Novalnet model class
740
  *
741
  * @param string $modelclass
742
  * @return Novalnet_Payment_Model_Payment_Method_Abstract
747
  }
748
 
749
  /**
750
+ * Get Novalnet transaction status model
751
  *
752
  * @return Novalnet_Payment_Model_Transactionstatus_Collection
753
  */
757
  }
758
 
759
  /**
760
+ * Get Novalnet callback model
761
+ *
762
+ * @return Novalnet_Payment_Model_Callback_Collection
763
+ */
764
+ public function getModelCallback()
765
+ {
766
+ return Mage::getModel('novalnet_payment/callback');
767
+ }
768
+
769
+ /**
770
+ * Get Novalnet Affiliate model
771
+ *
772
+ * @return Novalnet_Payment_Model_Affiliate_Collection
773
+ */
774
+ public function getModelAffiliate()
775
+ {
776
+ return Mage::getModel('novalnet_payment/affiliate');
777
+ }
778
+
779
+ /**
780
+ * Get Novalnet Affiliate User model
781
+ *
782
+ * @return Novalnet_Payment_Model_Affiliateuser_Collection
783
+ */
784
+ public function getModelAffiliateuser()
785
+ {
786
+ return Mage::getModel('novalnet_payment/affiliateuser');
787
+ }
788
+
789
+ /**
790
+ * Get Novalnet transaction overview model
791
  *
792
  * @return Novalnet_Payment_Model_Transactionoverview_Collection
793
  */
797
  }
798
 
799
  /**
800
+ * Get Novalnet Separefill model
801
  *
802
+ * @return Novalnet_Payment_Model_Separefill_Collection
803
  */
804
+ public function getModelSepaRefill()
805
  {
806
+ return Mage::getModel('novalnet_payment/separefill');
807
  }
808
 
809
  /**
810
+ * Get Novalnet Amountchanged model
811
  *
812
+ * @return Novalnet_Payment_Model_Amountchanged_Collection
813
  */
814
+ public function getModelAmountchanged()
815
  {
816
+ return Mage::getModel('novalnet_payment/amountchanged');
817
+ }
818
+
819
+ /**
820
+ * Get Novalnet Recurring model
821
+ *
822
+ * @return Novalnet_Payment_Model_Recurring_Collection
823
+ */
824
+ public function getModelRecurring()
825
+ {
826
+ return Mage::getModel('novalnet_payment/recurring');
827
+ }
828
+
829
+ /**
830
+ * Get Novalnet Factory model
831
+ *
832
+ * @return Novalnet_Payment_Model_Factory
833
+ */
834
+ public function getModelFactory()
835
+ {
836
+ return Mage::getModel('novalnet_payment/factory');
837
  }
838
 
839
  /**
840
  * Check the value is numeric
841
  *
842
  * @param mixed $value
843
+ * @return boolean
844
  */
845
  public function checkIsNumeric($value)
846
  {
851
  * Check the value contains special characters
852
  *
853
  * @param mixed $value
854
+ * @return boolean
855
  */
856
  public function checkIsValid($value)
857
  {
862
  * Check the email id is valid
863
  *
864
  * @param mixed $value
865
+ * @return boolean
866
  */
867
  public function validateEmail($emailId)
868
  {
869
+ $validatorEmail = new Zend_Validate_EmailAddress();
870
+ return $validatorEmail->isValid($emailId) ? true : false;
871
  }
872
 
873
  /**
886
  *
887
  * @param float $amount
888
  * @param string $type
889
+ * @return int
890
  */
891
  public function getFormatedAmount($amount, $type = 'CENT')
892
  {
894
  }
895
 
896
  /**
897
+ * Load Novalnet transaction status based on tid
898
  *
899
  * @param integer $txnId
900
  * @return object Novalnet_Payment_Model_Transactionstatus
905
  }
906
 
907
  /**
908
+ * Load Novalnet callback value based on order-id
909
  *
910
  * @param integer $orderId
911
  * @return object Novalnet_Payment_Model_Callback
916
  }
917
 
918
  /**
919
+ * Get Novalnet payment configuration global path
920
  *
921
  * @return string
922
  */
936
  }
937
 
938
  /**
939
+ * Get Amount collection
940
  *
941
+ * $param int $orderId
942
+ * $param int $confirm
943
+ * $param int $param
944
+ * @return int
945
+ */
946
+ public function getAmountCollection($orderId, $confirm, $param)
947
+ {
948
+ $countofCollection = '';
949
+ $modNovalAmountcollection = $this->getModelAmountchanged()->getCollection();
950
+ $modNovalAmountcollection->addFieldToFilter('order_id', $orderId);
951
+ $modNovalAmountcollection->addFieldToSelect('amount_changed');
952
+ $modNovalAmountcollection->addFieldToSelect('amount_datetime');
953
+ $countofCollectionvalue = count($modNovalAmountcollection);
954
+ if ($confirm != 1 && $param != 1) {
955
+ $countofCollection = count($modNovalAmountcollection);
956
+ } else if ($confirm == 1 && $param == 1 && $countofCollectionvalue != 0) {
957
+ foreach ($modNovalAmountcollection as $modNovalAmountcollectionValue) {
958
+ $countofCollection .= $modNovalAmountcollectionValue->getAmountChanged();
959
+ $countofCollection .= '<br>';
960
+ $countofCollection .= $modNovalAmountcollectionValue->getAmountDatetime();
961
+ }
962
+ } else if ($confirm == 1 && $countofCollectionvalue != 0) {
963
+ foreach ($modNovalAmountcollection as $modNovalAmountcollectionValue) {
964
+ $countofCollection .= $modNovalAmountcollectionValue->getAmountChanged();
965
+ }
966
+ }
967
+ return $countofCollection;
968
+ }
969
+
970
+ /**
971
+ * Check Nominal item or not
972
+ *
973
+ * $param varien_object $orderItems
974
+ * @return mixed
975
+ */
976
+ public function checkNominalItem($orderItems)
977
+ {
978
+ foreach ($orderItems as $orderItemsValue) {
979
+ if ($orderItemsValue) {
980
+ $nominalItem = $orderItemsValue->getIsNominal();
981
+ break;
982
+ }
983
+ }
984
+ return $nominalItem;
985
+ }
986
+
987
+ /**
988
+ * Get profile information's
989
+ *
990
+ * @return mixed
991
+ */
992
+ public function getProfileInfodata()
993
+ {
994
+ $profile = Mage::getSingleton('checkout/session')->getOptionprofile();
995
+ $getBillingPeriod = array_pop($profile);
996
+ $getCycleInfo = next($getBillingPeriod);
997
+ $getCycles = array_shift($getCycleInfo);
998
+ $value = explode(' ', $getCycles);
999
+ return $value;
1000
+ }
1001
+
1002
+ /**
1003
+ * Get the respective payport url
1004
+ *
1005
+ * @param string $reqType
1006
+ * @param string $paymentCode
1007
+ * @return string
1008
+ */
1009
+ public function getPayportUrl($reqType, $paymentCode = NULL)
1010
+ {
1011
+ $protocol = Mage::app()->getStore()->isCurrentlySecure() ? 'https' : 'http';
1012
+
1013
+ if ($paymentCode && $reqType == 'redirect') {
1014
+ $redirectUrl = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayportUrl');
1015
+ $payportUrl = $redirectUrl[$paymentCode];
1016
+ } else {
1017
+ $urlType = array(
1018
+ 'paygate' => Novalnet_Payment_Model_Config::PAYPORT_URL,
1019
+ 'infoport' => Novalnet_Payment_Model_Config::INFO_REQUEST_URL
1020
+ );
1021
+ $payportUrl = $urlType[$reqType];
1022
+ }
1023
+ return $protocol . $payportUrl;
1024
  }
1025
 
1026
+ /**
1027
+ * Get Next Cycle Date
1028
+ *
1029
+ * @param $nextCycleId
1030
+ * @return mixed
1031
+ */
1032
+ public function getCycleDate($nextCycleId)
1033
+ {
1034
+ $_order = new Mage_Sales_Model_Order();
1035
+ $orderId = Mage::app()->getRequest()->getParam('order_id');
1036
+ if ($orderId == '') {
1037
+ $request = Mage::app()->getRequest();
1038
+ $invoiceId = $request->getParam('invoice_id');
1039
+ $shipmentId = $request->getParam('shipment_id');
1040
+ $creditmemoId = $request->getParam('creditmemo_id');
1041
+ if ($invoiceId) {
1042
+ $invoice = Mage::getModel('sales/order_invoice')->load($invoiceId);
1043
+ $orderId = $invoice->getOrder()->getId();
1044
+ } else if ($shipmentId) {
1045
+ $ship = Mage::getModel('sales/order_shipment')->load($shipmentId);
1046
+ $orderId = $ship->getOrder()->getId();
1047
+ } else if ($creditmemoId) {
1048
+ $creditmemo = Mage::getModel('sales/order_creditmemo')->load($creditmemoId);
1049
+ $orderId = $creditmemo->getOrder()->getId();
1050
+ }
1051
+ }
1052
+ if (isset($orderId) && $orderId) {
1053
+ $order = $_order->load($orderId);
1054
+ $payment = $order->getPayment();
1055
+ if ($payment) {
1056
+ $paymentObj = $payment->getMethodInstance();
1057
+ $statusCall = $paymentObj->doNovalnetStatusCall($nextCycleId,$payment);
1058
+ return $statusCall->getNextSubsCycle();
1059
+ }
1060
+ }
1061
+ }
1062
+
1063
+ /**
1064
+ * Get checkout session
1065
+ *
1066
+ * @return string
1067
+ */
1068
+ public function getCurrency()
1069
+ {
1070
+ $_order = new Mage_Sales_Model_Order();
1071
+ $orderId = Mage::app()->getRequest()->getParam('order_id');
1072
+ if (isset($orderId) && $orderId) {
1073
+ $order = $_order->load($orderId);
1074
+ $currency = $order->getOrderCurrency();
1075
+ $currencyCode = $currency->getCurrencyCode();
1076
+ return $currencyCode;
1077
+ }
1078
+ }
1079
  }
app/code/community/Novalnet/Payment/Model/Adminhtml/Sales/Order/Create.php CHANGED
@@ -25,7 +25,6 @@
25
  */
26
  class Novalnet_Payment_Model_Adminhtml_Sales_Order_Create extends Mage_Adminhtml_Model_Sales_Order_Create
27
  {
28
-
29
  /**
30
  * Create new order
31
  *
@@ -59,15 +58,16 @@ class Novalnet_Payment_Model_Adminhtml_Sales_Order_Create extends Mage_Adminhtml
59
  }
60
 
61
  $order = $service->submit();
62
- $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
63
 
64
- if (preg_match("/novalnet/i", $paymentCode)) {
65
  $payment = $order->getPayment();
66
  $paymentObj = $payment->getMethodInstance();
67
- $request = $this->getSession()->getData($paymentCode)->getPaymentReqData();
68
  $response = $paymentObj->postRequest($request);
69
- $paymentObj->validateNovalnetResponse($payment, $response);
70
- $paymentObj->unsetMethodSession($paymentCode);
 
71
  }
72
 
73
  if ((!$quote->getCustomer()->getId() || !$quote->getCustomer()->isInStore($this->getSession()->getStore()))
@@ -77,7 +77,6 @@ class Novalnet_Payment_Model_Adminhtml_Sales_Order_Create extends Mage_Adminhtml
77
  $quote->getCustomer()
78
  ->save()
79
  ->sendNewAccountEmail('registered', '', $quote->getStoreId());
80
- ;
81
  }
82
  if ($this->getSession()->getOrder()->getId()) {
83
  $oldOrder = $this->getSession()->getOrder();
@@ -97,5 +96,4 @@ class Novalnet_Payment_Model_Adminhtml_Sales_Order_Create extends Mage_Adminhtml
97
 
98
  return $order;
99
  }
100
-
101
  }
25
  */
26
  class Novalnet_Payment_Model_Adminhtml_Sales_Order_Create extends Mage_Adminhtml_Model_Sales_Order_Create
27
  {
 
28
  /**
29
  * Create new order
30
  *
58
  }
59
 
60
  $order = $service->submit();
61
+ $paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
62
 
63
+ if (preg_match("/novalnet/i", $paymentMethod)) {
64
  $payment = $order->getPayment();
65
  $paymentObj = $payment->getMethodInstance();
66
+ $request = $this->getSession()->getPaymentReqData();
67
  $response = $paymentObj->postRequest($request);
68
+ $status = $paymentObj->validateNovalnetResponse($payment, $response);
69
+ $this->getSession()->unsPaymentReqData()
70
+ ->unsPaymentResData();
71
  }
72
 
73
  if ((!$quote->getCustomer()->getId() || !$quote->getCustomer()->isInStore($this->getSession()->getStore()))
77
  $quote->getCustomer()
78
  ->save()
79
  ->sendNewAccountEmail('registered', '', $quote->getStoreId());
 
80
  }
81
  if ($this->getSession()->getOrder()->getId()) {
82
  $oldOrder = $this->getSession()->getOrder();
96
 
97
  return $order;
98
  }
 
99
  }
app/code/community/Novalnet/Payment/Model/Affiliate.php CHANGED
@@ -38,7 +38,7 @@ class Novalnet_Payment_Model_Affiliate extends Mage_Core_Model_Abstract
38
  }
39
 
40
  /**
41
- * Load order transaction status by custom attribute value. Attribute value should be unique
42
  *
43
  * @param string $attribute
44
  * @param string $value
38
  }
39
 
40
  /**
41
+ * Load affiliate by custom attribute value. Attribute value should be unique
42
  *
43
  * @param string $attribute
44
  * @param string $value
app/code/community/Novalnet/Payment/Model/Amountchanged.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Amountchanged extends Mage_Core_Model_Abstract
27
+ {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Amountchanged
33
+ */
34
+ public function _construct()
35
+ {
36
+ parent::_construct();
37
+ $this->_init('novalnet_payment/amountchanged');
38
+ }
39
+ }
app/code/community/Novalnet/Payment/Model/Callback.php CHANGED
@@ -25,7 +25,6 @@
25
  */
26
  class Novalnet_Payment_Model_Callback extends Mage_Core_Model_Abstract
27
  {
28
-
29
  /**
30
  * Constructor
31
  *
@@ -62,5 +61,4 @@ class Novalnet_Payment_Model_Callback extends Mage_Core_Model_Abstract
62
  $this->load($orderId, 'order_id');
63
  return $this;
64
  }
65
-
66
  }
25
  */
26
  class Novalnet_Payment_Model_Callback extends Mage_Core_Model_Abstract
27
  {
 
28
  /**
29
  * Constructor
30
  *
61
  $this->load($orderId, 'order_id');
62
  return $this;
63
  }
 
64
  }
app/code/community/Novalnet/Payment/Model/Callbackscript.php CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the Payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,23 +20,29 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  class Novalnet_Payment_Model_Callbackscript
27
  {
28
-
29
- var $debug = false; //false|true; adapt: set to false for go-live
30
- var $test = false; //false|true; adapt: set to false for go-live
31
  var $log = false; //false|true; adapt
32
  var $createInvoice = true; //false|true; adapt for your need
33
  var $useZendEmail = true; //false|true; adapt for your need
34
  var $addSubsequentTidToDb = true; //whether to add the new tid to db; adapt if necessary
35
- //Security Setting; only this IP is allowed for call back script
36
- var $ipAllowed = array('195.143.189.210', '195.143.189.214'); //Novalnet IP, is a fixed value, DO NOT CHANGE!!!!!
37
 
38
  public function Callback()
39
  {
 
 
 
 
 
 
 
 
 
 
 
40
  $this->allowedPayment = array(
41
  'novalnetcc' => array('CREDITCARD', 'CREDITCARD_BOOKBACK', 'CREDITCARD_CHARGEBACK',
42
  'CREDIT_ENTRY_CREDITCARD', 'SUBSCRIPTION_STOP', 'DEBT_COLLECTION_CREDITCARD'),
@@ -45,16 +51,18 @@ class Novalnet_Payment_Model_Callbackscript
45
  'novalnetideal' => array('IDEAL'),
46
  'novalnetpaypal' => array('PAYPAL'),
47
  'novalneteps' => array('EPS'),
48
- 'novalnetsofortueberweisung' => array('ONLINE_TRANSFER', 'REFUND_BY_BANK_TRANSFER_EU'),
49
  'novalnetsepa' => array('DIRECT_DEBIT_SEPA', 'RETURN_DEBIT_SEPA', 'SUBSCRIPTION_STOP',
50
  'DEBT_COLLECTION_SEPA', 'CREDIT_ENTRY_SEPA'));
51
  $this->invoiceAllowed = array('INVOICE_CREDIT', 'INVOICE_START');
 
 
52
 
53
  /** @Array Type of payment available - Level : 0 */
54
  $this->paymentTypes = array('INVOICE_START', 'PAYPAL', 'ONLINE_TRANSFER',
55
  'CREDITCARD', 'IDEAL', 'DIRECT_DEBIT_SEPA', 'PAYSAFECARD', 'EPS', 'GUARANTEED_INVOICE_START');
56
- /** @Array Type of Charge backs available - Level : 1 */
57
- $this->chargeBackPayments = array('CREDITCARD_CHARGEBACK', 'RETURN_DEBIT_SEPA',
58
  'CREDITCARD_BOOKBACK', 'REFUND_BY_BANK_TRANSFER_EU');
59
  /** @Array Type of CreditEntry payment and Collections available - Level : 2 */
60
  $this->aryCollection = array('INVOICE_CREDIT', 'GUARANTEED_INVOICE_CREDIT',
@@ -62,8 +70,12 @@ class Novalnet_Payment_Model_Callbackscript
62
  'DEBT_COLLECTION_CREDITCARD');
63
  $this->arySubscription = array('SUBSCRIPTION_STOP');
64
 
65
- $this->request = $this->getParams();
66
- $this->helper = Mage::helper('novalnet_payment');
 
 
 
 
67
  $httpHost = Mage::helper('core/http')->getHttpHost();
68
  $this->lineBreak = empty($httpHost) ? PHP_EOL : '<br />';
69
 
@@ -71,29 +83,22 @@ class Novalnet_Payment_Model_Callbackscript
71
  $this->shopInfo = 'Magento ' . $this->lineBreak; //mandatory;adapt for your need
72
  $this->mailHost = Mage::getStoreConfig('system/smtp/host'); //adapt or Mage::getStoreConfig('system/smtp/host')
73
  $this->mailPort = Mage::getStoreConfig('system/smtp/port'); //adapt or Mage::getStoreConfig('system/smtp/port')
74
- $this->emailFromAddr = ''; //sender email address., mandatory, adapt it
75
- $this->emailToAddr = ''; //recipient email address., mandatory, adapt it
76
- $this->emailSubject = 'Novalnet Callback Script Access Report'; //adapt if necessary;
77
- $this->emailBody = ""; //Email text's 1. line, can be let blank, adapt for your need
78
- $this->emailFromName = ""; // Sender name, adapt
79
- $this->emailToName = ""; // Recipient name, adapt
80
- $this->callBackExecuted = false;
81
-
82
- if (isset($this->request['debug_mode']) && $this->request['debug_mode'] == 1) {
83
- $this->debug = true;
84
- $this->test = true;
85
- $this->emailFromAddr = 'testadmin@novalnet.de';
86
- $this->emailFromName = 'Novalnet';
87
- $this->emailToAddr = 'test@novalnet.de';
88
- $this->emailToName = 'Novalnet';
89
- }
90
-
91
 
92
  if (isset($this->request['vendor_activation']) && $this->request['vendor_activation'] == 1) {
93
  $this->doNovalnetAffAccInfoLog();
94
  return false;
95
  }
96
- //Parameters Settings
 
 
 
 
 
 
 
 
 
 
97
  $this->hParamsRequired = array(
98
  'vendor_id' => '',
99
  'tid' => '',
@@ -101,118 +106,125 @@ class Novalnet_Payment_Model_Callbackscript
101
  'status' => '',
102
  'amount' => '',
103
  'tid_payment' => '',
104
- 'tid' => ''
105
  );
106
 
107
- if (!in_array($this->request['payment_type'], array_merge($this->invoiceAllowed, $this->chargeBackPayments))) {
 
 
 
 
 
 
108
  unset($this->hParamsRequired['tid_payment']);
 
109
  }
110
 
111
  ksort($this->hParamsRequired);
112
 
 
113
  try {
114
 
115
  //Check Params
116
  if ($this->checkIP()) {
117
- $request = $this->request;
118
- $this->orderNo = isset($request['order_no']) && $request['order_no'] ? $request['order_no']
119
- : '';
120
- if ($this->orderNo == '') {
121
- unset($this->hParamsRequired['order_no']);
122
- $this->orderNo = $this->getOrderIdByTransId();
 
 
 
 
 
 
123
  }
124
 
125
- if (empty($request['payment_type'])) {
126
  echo "Required param (payment_type) missing!";
127
  } elseif (empty($this->orderNo)) {
128
- echo "Order no is missing !" . $this->lineBreak;
129
- } elseif (!empty($request['payment_type']) && in_array(strtoupper($request['payment_type']), array_merge($this->paymentTypes, $this->chargeBackPayments, $this->aryCollection, $this->arySubscription))) {
130
- //Complete the order in-case response failure from novalnet server
131
  $order = $this->getOrderByIncrementId($this->orderNo);
132
-
 
 
133
  if ($order->getIncrementId()) {
134
  $payment = $order->getPayment();
135
  $paymentObj = $payment->getMethodInstance();
136
- $this->storeId = $order->getStoreId();
137
- $this->redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
138
- $paymentTid = (in_array($request['payment_type'], $this->invoiceAllowed))
139
- || (in_array($request['payment_type'], $this->chargeBackPayments))
140
- ? $request['tid_payment'] : $request['tid'];
 
 
 
141
  // Get Admin Transaction status via API
 
 
 
 
 
 
 
142
  $this->getAdminTransaction = $paymentObj->doNovalnetStatusCall($paymentTid, $payment);
143
- // Validate the payment type for the particular order
144
- $this->paymentTypeValidation($order);
145
  $checkTidExist = $payment->getLastTransId();
146
-
147
- if (!empty($this->orderNo) && $order->getIncrementId() == $this->orderNo
148
- && empty($checkTidExist)) {
149
 
150
  //Unhold an order:-
151
  if ($order->canUnhold()) {
152
  $order->unhold()->save();
153
  }
154
 
155
- // save the payment additional information
156
- $serverResMode = $request['test_mode'];
157
- $shopMode = $paymentObj->_getConfigData('live_mode', '', $this->storeId);
158
- $this->testMode = (((isset($serverResMode) && $serverResMode
159
- == 1) || (isset($shopMode) && $shopMode == 0))
160
- ? 1 : 0 );
161
- $data = array('NnTestOrder' => $this->testMode);
162
- $additionalData = unserialize($payment->getAdditionalData());
163
- $data = $additionalData ? array_merge($additionalData, $data)
164
- : $data;
165
  $payment->setStatus(Novalnet_Payment_Model_Payment_Method_Abstract::STATUS_SUCCESS)
166
- ->setStatusDescription($this->helper->__('Payment was successful.'))
167
  ->setAdditionalData(serialize($data))
 
168
  ->save();
169
- // save the order transaction information
170
- $dataObj = new Varien_Object($request);
171
- if (in_array($paymentObj->getCode(), $this->redirectPayment)) {
172
- $authorizeKey = $paymentObj->_getConfigData('password', true);
173
- $responseAmount = is_numeric($request['amount'])
174
- ? $request['amount'] : $this->helper->getDecodedParam($request['amount'], $authorizeKey);
175
- $amount = $this->helper->getFormatedAmount($responseAmount, 'RAW');
176
- } else {
177
- $amount = $this->helper->getFormatedAmount($request['amount'], 'RAW');
178
- }
179
- $this->helper->doTransactionStatusSave($dataObj, $this->getAdminTransaction, $payment, $amount);
180
-
181
  // Payment process based on response status
182
  if ($payment->getAdditionalInformation($paymentObj->getCode() . '_successAction')
183
- != 1) {
184
- $payment->setAdditionalInformation($paymentObj->getCode() . '_successAction', 1);
185
  if ($order->canInvoice() && $this->getAdminTransaction->getStatus()
186
  == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
187
- $payment->setTransactionId($paymentTid) // Add capture text to make the new transaction
188
  ->setParentTransactionId(null)
189
  ->setIsTransactionClosed(true)
190
- ->setLastTransId($paymentTid)
191
  ->capture(null)
192
  ->save();
193
  } else {
194
- $payment->setTransactionId($paymentTid)
195
- ->setLastTransId($paymentTid)
196
  ->setParentTransactionId(null)
197
  ->save();
198
  }
199
-
200
  $onHoldStatus = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('paymentOnholdStaus');
201
  array_push($onHoldStatus, '100', '90');
202
-
203
  if (in_array($this->getAdminTransaction->getStatus(), $onHoldStatus)) {
204
- $orderStatus = $this->getOrderStatus($order, $this->getAdminTransaction);
205
- $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $orderStatus, $this->helper->__('Customer successfully returned from Novalnet'), true
206
  )->save();
207
- } else {
208
  $paymentObj->saveCancelledOrder($dataObj, $payment);
209
- }
210
  }
211
- $this->callBackExecuted = true;
212
- $customerId = $order->getCustomerId();
213
- // save the server response details
214
- $this->helper->doTransactionOrderLog($dataObj, $this->orderNo, $this->storeId, $customerId);
215
 
 
 
216
  //sendNewOrderEmail
217
  if (!$order->getEmailSent() && $order->getId() && in_array($this->getAdminTransaction->getStatus(), $onHoldStatus)) {
218
  try {
@@ -220,17 +232,19 @@ class Novalnet_Payment_Model_Callbackscript
220
  ->setEmailSent(true)
221
  ->save();
222
  } catch (Exception $e) {
223
- Mage::throwException($this->helper->__('Cannot send new order email.'));
224
  }
225
  }
226
  $order->save();
 
227
  }
228
- if ($this->checkParams()) {
229
- //Get Order ID and Set New Order Status
230
- $ordercheckstatus = $this->BasicValidation($this->orderNo, $order);
231
- if ($ordercheckstatus) {
232
- if ($this->getAdminTransaction->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
233
- $this->setOrderStatus($this->orderNo, $order);
 
234
  } else {
235
  echo isset($this->getAdminTransaction['transaction_status']['status_message'])
236
  ? ($this->getAdminTransaction['transaction_status']['status_message'])
@@ -239,34 +253,34 @@ class Novalnet_Payment_Model_Callbackscript
239
  }
240
  }
241
  }
242
- if ($this->log) {
243
- $logFile = 'novalnet_callback_script_' . date('Y-m-d') . '.log';
244
- Mage::log('Ein Haendlerskript-Aufruf fand statt mit StoreId ' . $this->storeId . " und Parametern:$this->lineBreak" . print_r($request, true), null, $logFile);
245
- }
246
  } else {
247
  echo "Order no [" . $this->orderNo . "] is not valid! $this->lineBreak";
248
  }
249
  } else {
250
- echo "Payment type [" . $request['payment_type'] . "] is mismatched! $this->lineBreak";
251
  }
252
  }
 
 
 
 
 
253
  } catch (Exception $e) {
254
  $this->emailBody .= "Exception catched: $this->lineBreak\$e:" . $e->getMessage() . $this->lineBreak;
255
  }
256
- // Callback E-mail Notification
257
- $this->callbackMail();
258
- }
259
 
260
- // ############## Sub Routines #####################
 
261
 
262
  /**
263
- * Callback E-mail Notification
264
  *
 
265
  */
266
- private function callbackMail()
267
  {
268
- if ($this->emailBody && $this->emailFromAddr && ($this->emailToAddr && $this->validateEmail())) {
269
- if (!$this->sendMail()) {
270
  if ($this->debug) {
271
  echo "Mailing failed!" . $this->lineBreak;
272
  echo "This mail text should be sent: " . $this->lineBreak;
@@ -274,7 +288,7 @@ class Novalnet_Payment_Model_Callbackscript
274
  }
275
  }
276
 
277
- if ($this->debug) {
278
  echo $this->emailBody;
279
  }
280
  }
@@ -282,16 +296,23 @@ class Novalnet_Payment_Model_Callbackscript
282
  /**
283
  * Send callback notification E-mail
284
  *
 
 
285
  */
286
- private function sendMail()
287
  {
 
 
 
 
 
288
 
289
  if ($this->useZendEmail) {
290
- if (!$this->sendEmailZend()) {
291
  return false;
292
  }
293
  } else {
294
- if (!$this->sendEmailMagento()) {
295
  return false;
296
  }
297
  }
@@ -302,8 +323,10 @@ class Novalnet_Payment_Model_Callbackscript
302
  /**
303
  * Send callback notification E-mail via Magento
304
  *
 
 
305
  */
306
- private function sendEmailMagento()
307
  {
308
  /*
309
  * Loads the html file named 'novalnet_callback_email.html' from
@@ -315,21 +338,15 @@ class Novalnet_Payment_Model_Callbackscript
315
  ->loadDefault('novalnet_callback_email_template');
316
 
317
  //Define some variables to assign to template
318
- $emailTemplVariables = array();
319
- $emailTemplVariables['fromName'] = $this->emailFromName;
320
- $emailTemplVariables['fromEmail'] = $this->emailFromAddr;
321
- $emailTemplVariables['toName'] = $this->emailToName;
322
- $emailTemplVariables['toEmail'] = $this->emailToAddr;
323
- $emailTemplVariables['subject'] = $this->emailSubject;
324
- $emailTemplVariables['body'] = $this->emailBody;
325
  $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplVariables);
326
 
327
- //Send Email
328
- if ($this->mailHost && $this->mailPort) {
329
- ini_set('SMTP', $this->mailHost);
330
- ini_set('smtp_port', $this->mailPort);
331
- }
332
-
333
  $mail = new Zend_Mail();
334
  $mail->setBodyHtml($processedTemplate);
335
  $mail->setFrom($this->emailFromAddr, $this->emailFromName);
@@ -337,14 +354,12 @@ class Novalnet_Payment_Model_Callbackscript
337
  $mail->setSubject($this->emailSubject);
338
 
339
  try {
340
- //Confirmation E-Mail Send
341
- $mail->send();
342
  if ($this->debug) {
343
- echo __FUNCTION__ . ': Sending Email succeeded!' . $this->lineBreak;
344
  }
 
345
  } catch (Exception $e) {
346
- Mage::getSingleton('core/session')
347
- ->addError($this->helper->__('Unable to send email'));
348
  if ($this->debug) {
349
  echo 'Email sending failed: ' . $e->getMessage();
350
  }
@@ -356,25 +371,24 @@ class Novalnet_Payment_Model_Callbackscript
356
  /**
357
  * Send callback notification E-mail via zend
358
  *
 
 
359
  */
360
- private function sendEmailZend()
361
  {
362
-
363
- if ($this->mailHost && $this->mailPort) {
364
- ini_set('SMTP', $this->mailHost);
365
- ini_set('smtp_port', $this->mailPort);
366
- }
367
 
368
  $mail = new Zend_Mail();
369
- $mail->setBodyHtml($this->emailBody);
370
  $mail->setFrom($this->emailFromAddr, $this->emailFromName);
371
- $mail->addTo($this->emailToAddr, $this->emailToName);
 
372
  $mail->setSubject($this->emailSubject);
373
 
374
  try {
375
  $mail->send();
376
  if ($this->debug) {
377
- echo __FUNCTION__ . ': Sending Email succeeded!' . $this->lineBreak;
378
  }
379
  } catch (Exception $e) {
380
  if ($this->debug) {
@@ -386,203 +400,258 @@ class Novalnet_Payment_Model_Callbackscript
386
  }
387
 
388
  /**
389
- * validate the payment type.
390
  *
 
 
 
 
391
  */
392
- private function paymentTypeValidation($order)
393
  {
394
- $request = $this->request;
395
- $orderPaymentName = strtolower($this->getPaymentMethod($order));
396
- $paymentType = $this->allowedPayment[$orderPaymentName];
397
-
398
- if (!in_array($request['payment_type'], $paymentType)) {
399
- echo "Novalnet callback received. Payment type (" . $request['payment_type'] . ") is not matched with $orderPaymentName!$this->lineBreak$this->lineBreak";
400
- exit;
401
- }
402
 
403
- return true;
404
- }
405
 
406
- /**
407
- * Check the email id is valid
408
- *
409
- * @param $emailId
410
- * @return bool
411
- */
412
- private function validateEmail()
413
- {
414
- $validatorEmail = new Zend_Validate_EmailAddress();
415
- if (!$validatorEmail->isValid(trim($this->emailToAddr))) {
416
- return false;
417
  }
418
- return true;
419
  }
420
 
421
  /**
422
  * Check the callback mandatory parameters.
423
  *
 
 
424
  */
425
- private function checkParams()
426
  {
427
- $error = false;
428
- $request = $this->request;
429
  if (!$request) {
430
  echo 'Novalnet callback received. No params passed over!' . $this->lineBreak;
431
- exit;
432
  }
433
 
434
- if ($this->hParamsRequired) {
435
- foreach ($this->hParamsRequired as $k => $v) {
436
- if (!isset($request[$k]) || empty($request[$k])) {
437
- $error = true;
438
- echo 'Required param (' . $k . ') missing!' . $this->lineBreak;
439
- }
440
- }
441
- if ($error) {
442
- exit;
443
- }
444
  }
445
 
446
- if ((in_array($request['payment_type'], $this->invoiceAllowed)) || (in_array($request['payment_type'], $this->chargeBackPayments))) {
447
- if (strlen($request['tid_payment']) != 17) {
448
- echo 'Novalnet callback received. Invalid TID [' . $request['tid_payment'] . '] for Order:' . $this->orderNo . ' ' . "$this->lineBreak$this->lineBreak" . $this->lineBreak;
449
- exit;
 
 
 
450
  }
451
  }
452
 
453
- if (strlen($request['tid']) != 17) {
454
- if ((in_array($request['payment_type'], $this->invoiceAllowed)) || (in_array($request['payment_type'], $this->chargeBackPayments))) {
455
- echo 'Novalnet callback received. New TID is not valid.' . "$this->lineBreak$this->lineBreak" . $this->lineBreak;
456
  } else {
457
- echo 'Novalnet callback received. Invalid TID [' . $request['tid'] . '] for Order:' . $this->orderNo . ' ' . "$this->lineBreak$this->lineBreak" . $this->lineBreak;
458
  }
459
- exit;
460
  }
461
 
462
- if (!empty($request['status']) && 100 != $request['status']) {
463
- echo "Novalnet callback received. Callback Script executed already. Refer Order :" . $this->orderNo . $this->lineBreak;
464
- exit;
465
  }
 
466
  return true;
467
  }
468
 
469
  /**
470
  * validate the callback parameters.
471
  *
 
472
  */
473
- private function BasicValidation($orderNo, $order)
474
  {
 
 
 
 
 
 
 
 
 
475
 
476
  if ($order->getIncrementId() == $orderNo && !empty($orderNo)) {
477
- $request = $this->request;
478
  //check amount
479
  $amount = $request['amount'];
480
  if (!$amount || intval($amount) < 0) {
481
- echo "Novalnet callback received. The requested amount ($amount) must be greater than zero.$this->lineBreak$this->lineBreak";
482
- exit;
483
  }
484
 
485
- if ((in_array($request['payment_type'], $this->invoiceAllowed)) || (in_array($request['payment_type'], $this->chargeBackPayments))) {
 
 
 
486
  $orgTid = $request['tid_payment'];
487
  } else {
488
  $orgTid = $request['tid'];
489
  }
490
 
 
 
 
 
 
 
491
  $payment = $order->getPayment();
492
  $additionalData = unserialize($payment->getAdditionalData());
493
- $orderTid = ((in_array($request['payment_type'], $this->chargeBackPayments)) && $additionalData['NnTid'])
494
  ? $additionalData['NnTid'] : $order->getPayment()->getLastTransId();
495
- if (!preg_match('/^' . $orgTid . '/i', $orderTid)) {
496
- echo 'Novalnet callback received. Order no is not valid' . "$this->lineBreak$this->lineBreak" . $this->lineBreak;
497
- exit;
 
 
 
 
 
 
 
498
  }
499
 
500
  return true;
501
  } else {
502
- echo 'Transaction mapping failed. no order data found' . $this->lineBreak;
503
- exit;
504
  }
505
  }
506
 
507
  /**
508
- * Set the status and state to an order payment
509
  *
 
510
  */
511
- private function setOrderStatus($incrementId, $order)
512
  {
 
 
 
 
513
 
514
  if ($order) {
 
 
515
  $request = $this->request;
516
  $order->getPayment()->getMethodInstance()->setCanCapture(true);
517
- $orderStatus = $this->getOrderStatus($order);
518
- $orderState = Mage_Sales_Model_Order::STATE_PROCESSING; //processing: ok; complete: not ok -> would cause the error msg: 'Der Bestellzustand "complete" darf nicht manuell gesetzt werden'
519
-
520
- // add some feature regarding subscription and collection; adapt for your need.
521
- $this->subsCollectionInfo();
522
-
523
- if (in_array($request['payment_type'], $this->chargeBackPayments)) {
524
- $payment = $order->getPayment();
525
- $data = unserialize($payment->getAdditionalData());
526
- $currency = $this->getAdminTransaction->getCurrency();
527
- $script = 'Novalnet Callback received. Charge back was executed sucessfully for the TID ' . $request['tid_payment'] . ' amount ' . ($request['amount'])
528
- / 100 . ' ' . $currency . " on " . date('Y-m-d H:i:s');
529
- $this->emailBody = $script;
 
530
 
531
- $data['NnComments'] = empty($data['NnComments']) ? '<br>' . $script
532
- : $data['NnComments'] . '<br>' . $script;
533
- $this->saveAdditionalInfo($payment, $data);
 
 
 
 
 
 
534
  return true;
535
  }
536
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  if ($this->createInvoice) {
538
- $saveinvoice = $this->saveInvoice($order);
539
  }
540
 
541
- if ($order->getInvoiceCollection()->getFirstItem()) {
542
  if ($saveinvoice) {
543
- $order->setState($orderState, true, 'Novalnet callback set state ' . $orderState . ' for Order-ID = ' . $incrementId);
544
- $order->addStatusToHistory($orderStatus, 'Novalnet callback added order status ' . $orderStatus); // this line must be located after $order->setState()
545
- $this->emailBody .= 'Novalnet callback set state to ' . $orderState . $this->lineBreak;
546
- $this->emailBody .= 'Novalnet callback set status to ' . $orderStatus . ' ... ' . $this->lineBreak;
547
  $order->save();
548
 
549
  //Add subsequent TID to DB column last_trans_id
550
  if ($this->addSubsequentTidToDb) {
551
- $payment = $order->getPayment();
552
- $data = unserialize($payment->getAdditionalData());
553
- $magentoVersion = $this->helper->getMagentoVersion();
554
- $transMode = (version_compare($magentoVersion, '1.6', '<'))
555
  ? false : true;
556
- $amount = $this->helper->getFormatedAmount($request['amount'], 'RAW');
557
- $currency = $this->getAdminTransaction->getCurrency();
558
  if (in_array($request['payment_type'], $this->invoiceAllowed)) {
559
- $payment->setTransactionId($request['tid'])
 
 
 
 
 
560
  ->setIsTransactionClosed($transMode);
561
  $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
562
  $transaction->setParentTxnId(null)
563
- ->save();
564
- $script = "Novalnet Callback Script executed successfully for the TID: " . $request['tid_payment'] . " with amount " . $amount ." ". $currency . " on " . date('Y-m-d H:i:s') . ". Please refer PAID transaction in our Novalnet Merchant Administration with the TID: " . $request['tid'] . ". ";
 
 
565
  } else {
566
- if ($request['payment_type'] == 'PAYPAL') {
567
- $loadTransaction = $this->helper->loadTransactionStatus(trim($request['tid']));
568
- $loadTransaction->setTransactionStatus($this->getAdminTransaction->getStatus())
569
- ->save();
570
- }
571
- $script = "Novalnet Callback Script executed successfully for the TID: " . $request['tid'] . " with amount " . $amount ." ". $currency . " on " . date('d-m-Y H:i:s');
572
  }
 
 
573
 
574
- $data['NnComments'] = empty($data['NnComments']) ? '<br>' . $script
575
- : $data['NnComments'] . '<br>' . $script;
576
- $this->saveAdditionalInfo($payment, $data);
 
 
577
  }
578
  }
579
  } else {
580
  echo "Novalnet Callback: No invoice for order (" . $order->getId() . ") found";
581
- exit;
582
  }
 
583
  } else {
584
- echo "Novalnet Callback: No order for Increment-ID $incrementId found.";
585
- exit;
586
  }
587
  return true;
588
  }
@@ -590,39 +659,44 @@ class Novalnet_Payment_Model_Callbackscript
590
  /**
591
  * Create invoice to order payment
592
  *
 
 
 
 
593
  */
594
- private function saveInvoice($order)
595
  {
596
-
597
  if (!$this->callBackExecuted) {
598
  $request = $this->request;
 
 
599
  $payment = $order->getPayment();
600
  $paymentObj = $payment->getMethodInstance();
601
  $data = unserialize($payment->getAdditionalData());
602
- $modNovalCallback = Mage::getModel('novalnet_payment/callback')->loadLogByOrderId($this->orderNo);
603
- $amount = $this->helper->getFormatedAmount($request['amount'], 'RAW');
604
  $sum = sprintf( ($request['amount'] + $modNovalCallback->getCallbackAmount()) , 0.2);
605
- $grandTotal = sprintf( ($order->getGrandTotal() * 100) , 0.2);
 
 
 
 
 
 
606
 
607
  if (in_array($request['payment_type'], $this->invoiceAllowed) && $sum
608
  < $grandTotal) {
609
-
610
- $this->doNovalnetCallbackLog($modNovalCallback, $sum);
611
-
612
- $this->emailBody = "Novalnet Callback Script executed successfully for the TID: " . $request['tid_payment'] . " with amount " . $amount ." ". $this->getAdminTransaction->getCurrency() . " on " . date('Y-m-d H:i:s') . ". Please refer PAID transaction in our Novalnet Merchant Administration with the TID: " . $request['tid'] . "$this->lineBreak$this->lineBreak";
613
-
614
- $callbackComments = "Novalnet Callback Script executed successfully. Payment for order id :" . $this->orderNo . '. New TID: ' . $request['tid'] . ' on ' . date('Y-m-d H:i:s') . ' for the amount : ' . $amount . ' ' . $this->getAdminTransaction->getCurrency() . $this->lineBreak;
615
- $data['NnComments'] = empty($data['NnComments']) ? '<br>' . $callbackComments
616
- : $data['NnComments'] . '<br>' . $callbackComments;
617
- $this->saveAdditionalInfo($payment, $data);
618
  return false;
619
  } else {
620
-
621
- $this->doNovalnetCallbackLog($modNovalCallback, $sum);
622
-
623
  if ($order->canInvoice()) {
624
- $tid = in_array($request['payment_type'], $this->invoiceAllowed)
625
- ? $request['tid_payment'] : $request['tid'];
626
  $invoice = $order->prepareInvoice();
627
  $invoice->setTransactionId($tid);
628
  $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
@@ -632,31 +706,37 @@ class Novalnet_Payment_Model_Callbackscript
632
  ->addObject($invoice)
633
  ->addObject($invoice->getOrder())
634
  ->save();
 
 
 
 
 
635
 
 
636
  if (in_array($request['payment_type'], $this->invoiceAllowed)) {
637
- $emailText = "Novalnet Callback Script executed successfully for the TID: " . $request['tid_payment'] . " with amount " . $amount ." ".$this->getAdminTransaction->getCurrency() . " on " . date('Y-m-d H:i:s') . ". Please refer PAID transaction in our Novalnet Merchant Administration with the TID: " . $request['tid'] . ". ";
638
- $this->emailBody = ($sum > $grandTotal) ? $emailText . "Customer paid amount is greater than the order total amount. $this->lineBreak$this->lineBreak"
639
- : $emailText . "$this->lineBreak$this->lineBreak";
 
640
  } else {
641
- $this->emailBody = "Novalnet Callback Script executed successfully for the TID: " . $request['tid'] . " with amount " . $amount ." ". $this->getAdminTransaction->getCurrency() . " on " . date('d-m-Y H:i:s') . ". $this->lineBreak$this->lineBreak";
642
  }
643
  } else {
644
- if ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_INVOICE &&
645
- $payment->getAdditionalInformation($paymentObj->getCode() . '_callbackSuccess') != 1) {
646
  $currency = $this->getAdminTransaction->getCurrency();
647
- $script = "Novalnet Callback Script executed successfully for the TID: " . $request['tid_payment'] . " with amount " . $amount ." ". $currency . " on " . date('Y-m-d H:i:s') . ". Please refer PAID transaction in our Novalnet Merchant Administration with the TID: " . $request['tid'] . ". ";
648
- $data['NnComments'] = empty($data['NnComments']) ? '<br>' . $script
649
- : $data['NnComments'] . '<br>' . $script;
650
- $payment->setAdditionalInformation($paymentObj->getCode() . '_callbackSuccess', 1);
651
- $this->saveAdditionalInfo($payment, $data);
652
- $this->saveOrderStatus($order);
653
  $this->emailBody = $script;
654
- $this->callbackMail();
 
 
 
655
  }
656
 
657
  $invoicePayments = array(Novalnet_Payment_Model_Config::NN_PREPAYMENT, Novalnet_Payment_Model_Config::NN_INVOICE);
658
  if (in_array($paymentObj->getCode(), $invoicePayments)) {
659
  echo "Novalnet callback received. Callback Script executed already. Refer Order :" . $this->orderNo . $this->lineBreak;
 
 
660
  } else {
661
  echo "Novalnet Callbackscript received. Payment type ( " . $request['payment_type'] . " ) is not applicable for this process!" . $this->lineBreak;
662
  }
@@ -668,96 +748,140 @@ class Novalnet_Payment_Model_Callbackscript
668
  }
669
 
670
  /**
671
- * save the order status for invoice payment method
672
  *
 
 
673
  */
674
- function saveOrderStatus($order)
675
  {
676
- $request = $this->request;
677
  $payment = $order->getPayment();
678
  $originalTid = trim($payment->getLastTransId());
679
- // save paid transaction id
680
- $transaction = Mage::getModel('sales/order_payment')->getCollection()
681
- ->addFieldToFilter('last_trans_id', $originalTid)
682
- ->addFieldToSelect('entity_id');
683
- foreach ($transaction as $transactionId) {
684
- $entitiyId = $transactionId->getEntityId();
685
- }
686
- Mage::getModel('sales/order_payment')->load($entitiyId)
687
- ->setLastTransId(trim($request['tid']))
688
- ->save();
689
- // change the order status
 
690
  $orderStatus = $this->getOrderStatus($order);
691
  $orderState = Mage_Sales_Model_Order::STATE_PROCESSING; //processing: ok; complete: not ok -> would cause the error msg: 'Der Bestellzustand "complete" darf nicht manuell gesetzt werden'
692
  $order->setState($orderState, true, 'Novalnet callback set state ' . $orderState . ' for Order-ID = ' . $this->orderNo);
693
  $order->addStatusToHistory($orderStatus, 'Novalnet callback added order status ' . $orderStatus); // this line must be located after $order->setState()
694
  $order->save();
695
- // change invoice status to paid
696
  $invoice = $order->getInvoiceCollection()->getFirstItem();
697
  $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
698
  $invoice->save();
 
 
 
 
 
 
699
  }
700
 
701
  /**
702
- * save the payment additional data for the order
703
  *
 
 
704
  */
705
- private function saveAdditionalInfo($payment, $data)
706
  {
707
- if ($payment && $data) {
708
- $order = $payment->getOrder();
709
- $payment->setAdditionalData(serialize($data));
710
- $order->setPayment($payment)
711
- ->save();
 
 
 
 
 
 
 
 
 
 
712
  }
 
 
713
  }
714
 
715
  /**
716
- * Get the order payment status
717
  *
718
- * @return Order_status
719
  */
720
- private function getOrderStatus($order)
721
  {
 
 
 
 
 
 
722
  $payment = $order->getPayment();
723
  $paymentObj = $payment->getMethodInstance();
724
- $getresponseData = unserialize($payment->getAdditionalData());
725
- array_push($this->redirectPayment, Novalnet_Payment_Model_Config::NN_PREPAYMENT, Novalnet_Payment_Model_Config::NN_INVOICE);
726
-
727
- $status = $paymentObj->_getConfigData('order_status', '', $this->storeId);
 
 
 
 
 
 
 
 
 
 
 
728
 
729
- if (($paymentObj->getCode() && (in_array($paymentObj->getCode(), $this->redirectPayment)))
730
- || ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_CC
731
- && $getresponseData['ActiveCc3d'])) {
732
- $status = $paymentObj->_getConfigData('order_status_after_payment', '', $this->storeId);
733
- }
734
- if ($paymentObj->getCode() && $paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_PAYPAL
735
- && ($this->getAdminTransaction->getStatus() == Novalnet_Payment_Model_Config::PAYPAL_PENDING_CODE)) {
736
- $status = $paymentObj->_getConfigData('order_status', '', $this->storeId)
737
- ? $paymentObj->_getConfigData('order_status', '', $this->storeId)
738
- : Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
739
- }
740
- if (!$status) {
741
- $status = Mage_Sales_Model_Order::STATE_PROCESSING;
742
- }
743
- return $status;
 
 
 
744
  }
745
 
746
  /**
747
  * Log partial callback data
748
  *
 
 
 
749
  */
750
- private function doNovalnetCallbackLog($modNovalCallback, $sum)
751
  {
752
- $request = $this->request;
753
- $orgTid = $request['payment_type'] == 'INVOICE_CREDIT' ? trim($request['tid_payment'])
754
- : trim($request['tid']);
755
- $requestUri = Mage::helper('core/http')->getRequestUri();
756
- $modNovalCallback->setOrderId($this->orderNo)
757
  ->setCallbackAmount($sum)
758
  ->setReferenceTid($orgTid)
759
- ->setCallbackDatetime(date('Y-m-d H:i:s'))
760
- ->setCallbackLog($requestUri)
761
  ->save();
762
  }
763
 
@@ -768,7 +892,8 @@ class Novalnet_Payment_Model_Callbackscript
768
  private function doNovalnetAffAccInfoLog()
769
  {
770
  $request = $this->request;
771
- $affiliateAccInfo = $this->helper->getModelAffiliate();
 
772
  $affiliateAccInfo->setVendorId($request['vendor_id'])
773
  ->setVendorAuthcode($request['vendor_authcode'])
774
  ->setProductId($request['product_id'])
@@ -779,110 +904,311 @@ class Novalnet_Payment_Model_Callbackscript
779
  ->setAffAccesskey($request['aff_accesskey'])
780
  ->save();
781
  //Send notification mail to Merchant
 
782
  $this->emailBody = 'Novalnet callback script executed successfully with Novalnet account activation information.';
783
- $this->callbackMail();
 
 
 
 
 
 
 
 
 
 
784
  }
785
 
786
  /**
787
  * Get order object for specific order id
788
  *
789
- * @return payment object
 
790
  */
791
- private function getOrderByIncrementId($incrementId)
792
  {
793
  $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
794
  return $order;
795
  }
796
 
797
  /**
798
- * Get the payment method code from order
799
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
800
  * @return string
801
  */
802
- private function getPaymentMethod($order)
803
  {
804
- return $order->getPayment()->getData('method');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805
  }
806
 
807
  /**
808
- * Get parameters GET/POST
809
  *
 
 
810
  */
811
- private function getParams()
812
  {
813
- if (Mage::app()->getRequest()->getParams()) {
814
- $data = Mage::app()->getRequest()->getParams();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815
  } else {
816
- $data = Mage::app()->getRequest()->getQuery();
 
 
 
 
 
 
 
817
  }
818
- return $data;
819
  }
820
 
821
  /**
822
- * Check whether the ip address is authorised
823
  *
 
 
 
824
  */
825
- private function checkIP()
826
  {
827
- $callerIp = $this->helper->getRealIpAddr();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
828
 
829
- if (!in_array($callerIp, $this->ipAllowed) && !$this->test) {
830
- echo 'Unauthorised access from the IP [' . $callerIp . ']' . $this->lineBreak . $this->lineBreak;
831
- exit;
 
 
 
 
 
 
 
 
 
 
832
  }
 
833
  return true;
834
  }
835
 
836
  /**
837
- * add some feature regarding subscription and collection; adapt for your need.
838
  *
 
 
 
 
839
  */
840
- private function subsCollectionInfo()
841
  {
842
- $request = $this->request;
 
 
 
 
 
 
 
843
 
844
- if (in_array($request['payment_type'], $this->paymentTypes)) { ### Incoming of a payment
845
- if (isset($request['subs_billing']) && $request['subs_billing'] == 1) { ##IF PAYMENT MADE ON SUBSCRIPTION RENEWAL
846
- #### Step1: THE SUBSCRIPTION IS RENEWED, PAYMENT IS MADE, SO JUST CREATE A NEW ORDER HERE WITHOUT A PAYMENT PROCESS AND SET THE ORDER STATUS AS PAID ####
847
- #### Step2: THIS IS OPTIONAL: UPDATE THE BOOKING REFERENCE AT NOVALNET WITH YOUR ORDER_NO BY CALLING NOVALNET GATEWAY, IF U WANT THE USER TO USE ORDER_NO AS PAYMENT REFERENCE ###
848
- #### Step3: ADJUST THE NEW ORDER CONFIRMATION EMAIL TO INFORM THE USER THAT THIS ORDER IS MADE ON SUBSCRIPTION RENEWAL ###
849
- }
850
- if ($request['payment_type'] == 'INVOICE_START') { ##INVOICE START
851
- if (isset($request['subs_billing']) && $request['subs_billing'] == 1) {
852
- #### Step4: ENTER THE NECESSARY REFERENCE & BANK ACCOUNT DETAILS IN THE NEW ORDER CONFIRMATION EMAIL ####
853
- }
854
- }
855
- ### DO THE STEPS TO UPDATE THE STATUS OF THE PAYMENT ###
856
- } elseif (in_array($request['payment_type'], $this->aryCollection)) { ### Incoming of collection of a payment OR Bank transfer OR invoice OR Advance payment through Customer
857
- ### DO THE STEPS TO UPDATE THE STATUS OF THE ORDER OR THE USER ###
858
- if ($request['payment_type'] == 'INVOICE_CREDIT') { #if settlement of Advance payment through Customer
859
- #### UPDATE THE STATUS OF THE USER ORDER HERE AND NOTE THAT THE ORDER HAS BEEN PAID ####
860
- }
861
- } elseif ($request['payment_type'] == 'SUBSCRIPTION_STOP') { ### Cancellation of a Subscription
862
- ### UPDATE THE STATUS OF THE USER SUBSCRIPTION ###
863
  }
 
 
864
  }
865
 
866
  /**
867
- * get order id based on last transaction id.
868
  *
 
 
 
 
869
  */
870
- private function getOrderIdByTransId()
871
  {
872
- $request = $this->request;
 
 
 
 
 
 
873
 
874
- if ((in_array($request['payment_type'], $this->invoiceAllowed)) || (in_array($request['payment_type'], $this->chargeBackPayments))) {
875
- $orgTid = $request['tid_payment'];
876
- } else {
877
- $orgTid = $request['tid'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
878
  }
 
879
 
880
- if ($orgTid == '') {
881
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
882
  }
 
 
 
 
 
 
 
 
 
 
 
 
883
 
884
  $tablePrefix = Mage::getConfig()->getTablePrefix();
885
- if (in_array($request['payment_type'], $this->chargeBackPayments)) {
886
  $orderPayment = $tablePrefix.'sales_payment_transaction';
887
  $onCondition = "main_table.entity_id = $orderPayment.order_id";
888
  $orderCollection = Mage::getModel('sales/order')->getCollection()
@@ -903,9 +1229,433 @@ class Novalnet_Payment_Model_Callbackscript
903
  $orderid = $order->getIncrementId();
904
  }
905
  }
906
- $orderId = (isset($orderid) && $orderid != NULL) ? $orderid : '';
907
 
 
908
  return $orderId;
909
  }
910
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
911
  }
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  class Novalnet_Payment_Model_Callbackscript
27
  {
 
 
 
28
  var $log = false; //false|true; adapt
29
  var $createInvoice = true; //false|true; adapt for your need
30
  var $useZendEmail = true; //false|true; adapt for your need
31
  var $addSubsequentTidToDb = true; //whether to add the new tid to db; adapt if necessary
 
 
32
 
33
  public function Callback()
34
  {
35
+ //Security Setting; only this IP is allowed for call back script
36
+ $this->ipAllowed = array('195.143.189.210', '195.143.189.214');//Novalnet IP, is a fixed value, DO NOT CHANGE!!!!!
37
+ $this->debug = Mage::getStoreConfig('payment/novalnetcallback/enabledebugmode');
38
+ $this->test = Mage::getStoreConfig('payment/novalnetcallback/enabletestmode');
39
+
40
+ $this->callback = false;
41
+ $this->recurring = false;
42
+ $this->request = $this->getParam();
43
+ $this->currenttime = Mage::getModel('core/date')->date('Y-m-d H:i:s');
44
+ $this->emailSendOption = Mage::getStoreConfig('payment/novalnetcallback/emailsendoption');
45
+
46
  $this->allowedPayment = array(
47
  'novalnetcc' => array('CREDITCARD', 'CREDITCARD_BOOKBACK', 'CREDITCARD_CHARGEBACK',
48
  'CREDIT_ENTRY_CREDITCARD', 'SUBSCRIPTION_STOP', 'DEBT_COLLECTION_CREDITCARD'),
51
  'novalnetideal' => array('IDEAL'),
52
  'novalnetpaypal' => array('PAYPAL'),
53
  'novalneteps' => array('EPS'),
54
+ 'novalnetbanktransfer' => array('ONLINE_TRANSFER', 'REFUND_BY_BANK_TRANSFER_EU'),
55
  'novalnetsepa' => array('DIRECT_DEBIT_SEPA', 'RETURN_DEBIT_SEPA', 'SUBSCRIPTION_STOP',
56
  'DEBT_COLLECTION_SEPA', 'CREDIT_ENTRY_SEPA'));
57
  $this->invoiceAllowed = array('INVOICE_CREDIT', 'INVOICE_START');
58
+ $this->recurringAllowed = array('INVOICE_CREDIT', 'INVOICE_START', 'CREDITCARD',
59
+ 'DIRECT_DEBIT_SEPA', 'SUBSCRIPTION_STOP');
60
 
61
  /** @Array Type of payment available - Level : 0 */
62
  $this->paymentTypes = array('INVOICE_START', 'PAYPAL', 'ONLINE_TRANSFER',
63
  'CREDITCARD', 'IDEAL', 'DIRECT_DEBIT_SEPA', 'PAYSAFECARD', 'EPS', 'GUARANTEED_INVOICE_START');
64
+ /** @Array Type of Chargebacks available - Level : 1 */
65
+ $this->chargebacks = array('CREDITCARD_CHARGEBACK', 'RETURN_DEBIT_SEPA',
66
  'CREDITCARD_BOOKBACK', 'REFUND_BY_BANK_TRANSFER_EU');
67
  /** @Array Type of CreditEntry payment and Collections available - Level : 2 */
68
  $this->aryCollection = array('INVOICE_CREDIT', 'GUARANTEED_INVOICE_CREDIT',
70
  'DEBT_COLLECTION_CREDITCARD');
71
  $this->arySubscription = array('SUBSCRIPTION_STOP');
72
 
73
+ if (isset($this->request['debug_mode']) && $this->request['debug_mode'] == 1) {
74
+ $this->debug = true;
75
+ $this->test = true;
76
+ $this->emailSendOption = true;
77
+ }
78
+
79
  $httpHost = Mage::helper('core/http')->getHttpHost();
80
  $this->lineBreak = empty($httpHost) ? PHP_EOL : '<br />';
81
 
83
  $this->shopInfo = 'Magento ' . $this->lineBreak; //mandatory;adapt for your need
84
  $this->mailHost = Mage::getStoreConfig('system/smtp/host'); //adapt or Mage::getStoreConfig('system/smtp/host')
85
  $this->mailPort = Mage::getStoreConfig('system/smtp/port'); //adapt or Mage::getStoreConfig('system/smtp/port')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  if (isset($this->request['vendor_activation']) && $this->request['vendor_activation'] == 1) {
88
  $this->doNovalnetAffAccInfoLog();
89
  return false;
90
  }
91
+
92
+ $this->level = $this->getPaymentTypeLevel();
93
+
94
+ if (in_array($this->request['payment_type'], $this->recurringAllowed) && (!empty($this->request['signup_tid'])
95
+ || !empty($this->request['subs_billing']))) {
96
+ $this->recurring = true;
97
+ } else {
98
+ $this->callback = true;
99
+ }
100
+
101
+ //Parameter Settings
102
  $this->hParamsRequired = array(
103
  'vendor_id' => '',
104
  'tid' => '',
106
  'status' => '',
107
  'amount' => '',
108
  'tid_payment' => '',
109
+ 'signup_tid' => ''
110
  );
111
 
112
+ if ($this->callback) {
113
+ unset($this->hParamsRequired['signup_tid']);
114
+ $invChargeback = array_merge($this->invoiceAllowed, $this->chargebacks);
115
+ if ((!in_array($this->request['payment_type'], $invChargeback))) {
116
+ unset($this->hParamsRequired['tid_payment']);
117
+ }
118
+ } else {
119
  unset($this->hParamsRequired['tid_payment']);
120
+ unset($this->hParamsRequired['order_no']);
121
  }
122
 
123
  ksort($this->hParamsRequired);
124
 
125
+ // ################### Main Prog. ##########################
126
  try {
127
 
128
  //Check Params
129
  if ($this->checkIP()) {
130
+
131
+ $response = $this->request;
132
+ $helper = $this->_getNovalnetHelper();
133
+ if ($this->recurring) {
134
+ $recurringProfileId = $this->getProfileInformation($this->request);
135
+ $orderNo = $this->getRecurringOrderNo($recurringProfileId);
136
+ $this->orderNo = $orderNo;
137
+ } else {
138
+ $this->orderNo = isset($response['order_no']) && $response['order_no'] ? $response['order_no'] : '';
139
+ if ($this->orderNo == '') {
140
+ $this->orderNo = $this->getOrderIdByTransId();
141
+ }
142
  }
143
 
144
+ if (empty($response['payment_type'])) {
145
  echo "Required param (payment_type) missing!";
146
  } elseif (empty($this->orderNo)) {
147
+ echo "Required (Transaction ID) not Found!" . $this->lineBreak;
148
+ } elseif (!empty($response['payment_type']) && in_array(strtoupper($response['payment_type']), array_merge($this->paymentTypes, $this->chargebacks, $this->aryCollection, $this->arySubscription))) {
149
+ //Complete the order incase response failure from novalnet server
150
  $order = $this->getOrderByIncrementId($this->orderNo);
151
+ $storeId = $order->getStoreId();
152
+ $this->getEmailConfig($storeId);
153
+ $this->setLanguageStore($storeId);
154
  if ($order->getIncrementId()) {
155
  $payment = $order->getPayment();
156
  $paymentObj = $payment->getMethodInstance();
157
+ $this->paymentCode = $paymentObj->getCode();
158
+ $additionalData = $getresponseData = unserialize($payment->getAdditionalData());
159
+ $paymentObj->_vendorId = ($getresponseData['vendor']) ? $getresponseData['vendor']
160
+ : $paymentObj->_getConfigData('merchant_id', true, $storeId);
161
+ $paymentObj->_authCode = ($getresponseData['auth_code'])
162
+ ? $getresponseData['auth_code'] : $paymentObj->_getConfigData('auth_code', true, $storeId);
163
+ $paymentObj->_productId = ($getresponseData['product']) ? $getresponseData['product']
164
+ : $paymentObj->_getConfigData('product_id', true, $storeId);
165
  // Get Admin Transaction status via API
166
+ if ($this->recurring) {
167
+ $paymentTid = $response['signup_tid'];
168
+ } else {
169
+ $paymentTid = (in_array($response['payment_type'], $this->chargebacks))
170
+ ? $response['tid_payment'] : (in_array($response['payment_type'], $this->invoiceAllowed))
171
+ ? $response['tid_payment'] : $response['tid'];
172
+ }
173
  $this->getAdminTransaction = $paymentObj->doNovalnetStatusCall($paymentTid, $payment);
 
 
174
  $checkTidExist = $payment->getLastTransId();
175
+ $this->paymentTypeValidation($order);
176
+ if (!empty($this->orderNo) && $order->getIncrementId() == $this->orderNo && empty($checkTidExist)) {
 
177
 
178
  //Unhold an order:-
179
  if ($order->canUnhold()) {
180
  $order->unhold()->save();
181
  }
182
 
183
+ $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
184
+ $serverResponse = $response['test_mode'];
185
+ $shopMode = $paymentObj->_getConfigData('live_mode', '', $storeId);
186
+ $testMode = ((isset($serverResponse) && $serverResponse == 1) || (isset($shopMode) && $shopMode == 0))
187
+ ? 1 : 0;
188
+ $data = array('NnTestOrder' => $testMode);
189
+ $data = $additionalData ? array_merge($additionalData, $data) : $data;
190
+ $txnId = $response['tid'];
 
 
191
  $payment->setStatus(Novalnet_Payment_Model_Payment_Method_Abstract::STATUS_SUCCESS)
192
+ ->setStatusDescription($helper->__('Payment was successful.'))
193
  ->setAdditionalData(serialize($data))
194
+ ->setIsTransactionClosed(true)
195
  ->save();
196
+ $dataObj = new Varien_Object($response);
197
+ $this->doTransactionStatusSave($dataObj); // Save the Transaction status
 
 
 
 
 
 
 
 
 
 
198
  // Payment process based on response status
199
  if ($payment->getAdditionalInformation($paymentObj->getCode() . '_successAction')
200
+ != 1) {
 
201
  if ($order->canInvoice() && $this->getAdminTransaction->getStatus()
202
  == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
203
+ $payment->setTransactionId($txnId) // Add capture text to make the new transaction
204
  ->setParentTransactionId(null)
205
  ->setIsTransactionClosed(true)
206
+ ->setLastTransId($txnId)
207
  ->capture(null)
208
  ->save();
209
  } else {
210
+ $payment->setTransactionId($txnId)
211
+ ->setLastTransId($txnId)
212
  ->setParentTransactionId(null)
213
  ->save();
214
  }
 
215
  $onHoldStatus = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('paymentOnholdStaus');
216
  array_push($onHoldStatus, '100', '90');
 
217
  if (in_array($this->getAdminTransaction->getStatus(), $onHoldStatus)) {
218
+ $orderStatus = $this->getOrderStatus($order);
219
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $orderStatus, $helper->__('Customer successfully returned from Novalnet'), true
220
  )->save();
221
+ } else {
222
  $paymentObj->saveCancelledOrder($dataObj, $payment);
223
+ }
224
  }
 
 
 
 
225
 
226
+ $this->callBackExecuted = true;
227
+ $this->doTransactionOrderLog($response);
228
  //sendNewOrderEmail
229
  if (!$order->getEmailSent() && $order->getId() && in_array($this->getAdminTransaction->getStatus(), $onHoldStatus)) {
230
  try {
232
  ->setEmailSent(true)
233
  ->save();
234
  } catch (Exception $e) {
235
+ Mage::throwException($helper->__('Cannot send new order email.'));
236
  }
237
  }
238
  $order->save();
239
+ $this->emailBody = "Novalnet Callback received for the TID: " . $txnId;
240
  }
241
+
242
+ //Get Order ID and Set New Order Status
243
+ if ($this->checkParams($response)) {
244
+ $orderCheckStatus = $this->BasicValidation();
245
+ if ($orderCheckStatus) {
246
+ if ($response['payment_type'] != 'INVOICE_CREDIT' || ($response['payment_type'] == 'INVOICE_CREDIT' && $this->getAdminTransaction->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED)) {
247
+ $this->setOrderStatus(); //and send error mails if any
248
  } else {
249
  echo isset($this->getAdminTransaction['transaction_status']['status_message'])
250
  ? ($this->getAdminTransaction['transaction_status']['status_message'])
253
  }
254
  }
255
  }
 
 
 
 
256
  } else {
257
  echo "Order no [" . $this->orderNo . "] is not valid! $this->lineBreak";
258
  }
259
  } else {
260
+ echo "Payment type [" . $response['payment_type'] . "] is mismatched! $this->lineBreak";
261
  }
262
  }
263
+
264
+ if ($this->log) {
265
+ $logFile = 'novalnet_callback_script_' . date('Y-m-d') . '.log';
266
+ Mage::log('Ein Haendlerskript-Aufruf fand statt mit StoreId ' . $storeId . " und Parametern:$this->lineBreak" . print_r($this->request, true), NULL, $logFile);
267
+ }
268
  } catch (Exception $e) {
269
  $this->emailBody .= "Exception catched: $this->lineBreak\$e:" . $e->getMessage() . $this->lineBreak;
270
  }
 
 
 
271
 
272
+ $this->sendCallbackMail();
273
+ }
274
 
275
  /**
276
+ * Send callback notification E-mail
277
  *
278
+ * @return boolean
279
  */
280
+ private function sendCallbackMail()
281
  {
282
+ if (isset($this->emailBody) && $this->emailBody && $this->emailFromAddr && $this->emailToAddr) {
283
+ if (!$this->sendMail($this->emailBody)) {
284
  if ($this->debug) {
285
  echo "Mailing failed!" . $this->lineBreak;
286
  echo "This mail text should be sent: " . $this->lineBreak;
288
  }
289
  }
290
 
291
+ if ($this->debug && isset($this->emailBody)) {
292
  echo $this->emailBody;
293
  }
294
  }
296
  /**
297
  * Send callback notification E-mail
298
  *
299
+ * @param string $emailBody
300
+ * @return boolean
301
  */
302
+ public function sendMail($emailBody)
303
  {
304
+ //Send Email
305
+ if ($this->mailHost && $this->mailPort) {
306
+ ini_set('SMTP', $this->mailHost);
307
+ ini_set('smtp_port', $this->mailPort);
308
+ }
309
 
310
  if ($this->useZendEmail) {
311
+ if ($this->emailSendOption && !$this->sendEmailZend($emailBody)) {
312
  return false;
313
  }
314
  } else {
315
+ if ($this->emailSendOption && !$this->sendEmailMagento($emailBody)) {
316
  return false;
317
  }
318
  }
323
  /**
324
  * Send callback notification E-mail via Magento
325
  *
326
+ * @param string $emailBody
327
+ * @return boolean
328
  */
329
+ public function sendEmailMagento($emailBody)
330
  {
331
  /*
332
  * Loads the html file named 'novalnet_callback_email.html' from
338
  ->loadDefault('novalnet_callback_email_template');
339
 
340
  //Define some variables to assign to template
341
+ $emailTemplateVariables = array();
342
+ $emailTemplateVariables['fromName'] = $this->emailFromName;
343
+ $emailTemplateVariables['fromEmail'] = $this->emailFromAddr;
344
+ $emailTemplateVariables['toName'] = $this->emailToName;
345
+ $emailTemplateVariables['toEmail'] = $this->emailToAddr;
346
+ $emailTemplateVariables['subject'] = $this->emailSubject;
347
+ $emailTemplateVariables['body'] = $emailBody;
348
  $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplVariables);
349
 
 
 
 
 
 
 
350
  $mail = new Zend_Mail();
351
  $mail->setBodyHtml($processedTemplate);
352
  $mail->setFrom($this->emailFromAddr, $this->emailFromName);
354
  $mail->setSubject($this->emailSubject);
355
 
356
  try {
 
 
357
  if ($this->debug) {
358
+ echo __FUNCTION__ . ': Sending Email suceeded!' . $this->lineBreak;
359
  }
360
+ $emailTemplate->send($this->emailToAddr, $this->emailToName, $emailTemplateVariables);
361
  } catch (Exception $e) {
362
+ Mage::getSingleton('core/session')->addError($this->_getNovalnetHelper()->__('Unable to send email'));
 
363
  if ($this->debug) {
364
  echo 'Email sending failed: ' . $e->getMessage();
365
  }
371
  /**
372
  * Send callback notification E-mail via zend
373
  *
374
+ * @param string $emailBody
375
+ * @return boolean
376
  */
377
+ public function sendEmailZend($emailBody)
378
  {
379
+ $this->validatorEmail = new Zend_Validate_EmailAddress();
 
 
 
 
380
 
381
  $mail = new Zend_Mail();
382
+ $mail->setBodyHtml($emailBody);
383
  $mail->setFrom($this->emailFromAddr, $this->emailFromName);
384
+ $this->emailSeparate($this->emailToAddr, $mail, 'To');
385
+ $this->emailSeparate($this->emailBCcAddr, $mail, 'Bcc');
386
  $mail->setSubject($this->emailSubject);
387
 
388
  try {
389
  $mail->send();
390
  if ($this->debug) {
391
+ echo __FUNCTION__ . ': Sending Email suceeded!' . $this->lineBreak;
392
  }
393
  } catch (Exception $e) {
394
  if ($this->debug) {
400
  }
401
 
402
  /**
403
+ * E-mail TO and Bcc address comma separate
404
  *
405
+ * @param string $emailaddr
406
+ * @param string $mail
407
+ * @param string $addr
408
+ * @return string
409
  */
410
+ public function emailSeparate($emailaddr, $mail, $addr)
411
  {
 
 
 
 
 
 
 
 
412
 
413
+ $email = explode(',', $emailaddr);
414
+ $validatorEmail = $this->validatorEmail;
415
 
416
+ foreach ($email as $emailAddrVal) {
417
+ if ($validatorEmail->isValid(trim($emailAddrVal))) {
418
+ ($addr == 'To') ? $mail->addTo($emailAddrVal) : $mail->addBcc($emailAddrVal);
419
+ }
 
 
 
 
 
 
 
420
  }
421
+ return $mail;
422
  }
423
 
424
  /**
425
  * Check the callback mandatory parameters.
426
  *
427
+ * @param array $request
428
+ * @return boolean
429
  */
430
+ public function checkParams($request)
431
  {
 
 
432
  if (!$request) {
433
  echo 'Novalnet callback received. No params passed over!' . $this->lineBreak;
434
+ die;
435
  }
436
 
437
+ foreach ($this->hParamsRequired as $k => $v) {
438
+ if (!isset($request[$k]) || empty($request[$k])) {
439
+ echo 'Required param (' . $k . ') missing!' . $this->lineBreak;
440
+ die;
441
+ }
 
 
 
 
 
442
  }
443
 
444
+ if ($this->recurring && !preg_match('/^\d{17}$/', $request['signup_tid'])) {
445
+ echo 'Novalnet callback received. Invalid TID [' . $request['signup_tid'] . '] for Order.';
446
+ die;
447
+ } else if ((in_array($request['payment_type'], $this->invoiceAllowed)) || (in_array($request['payment_type'], $this->chargebacks))) {
448
+ if (!$this->recurring && !preg_match('/^\d{17}$/', $request['tid_payment'])) {
449
+ echo 'Novalnet callback received. Invalid TID [' . $request['tid_payment'] . '] for Order:' . $this->orderNo . ' ' . $this->lineBreak;
450
+ die;
451
  }
452
  }
453
 
454
+ if (!preg_match('/^\d{17}$/', $request['tid'])) {
455
+ if ((in_array($request['payment_type'], $this->invoiceAllowed)) || (in_array($request['payment_type'], $this->chargebacks))) {
456
+ echo 'Novalnet callback received. New TID is not valid.' . $this->lineBreak;
457
  } else {
458
+ echo 'Novalnet callback received. Invalid TID [' . $request['tid'] . '] for Order:' . $this->orderNo . ' ' . $this->lineBreak;
459
  }
460
+ die;
461
  }
462
 
463
+ if ($request['payment_type'] == 'INVOICE_CREDIT' && !empty($request['status']) && 100 != $request['status']) {
464
+ echo 'Novalnet callback received. Callback Script executed already. Refer Order :' . $this->orderNo . $this->lineBreak;
465
+ die;
466
  }
467
+
468
  return true;
469
  }
470
 
471
  /**
472
  * validate the callback parameters.
473
  *
474
+ * @return boolean
475
  */
476
+ public function BasicValidation()
477
  {
478
+ $request = $this->request;
479
+ $orderNo = $this->orderNo;
480
+ $order = $this->getOrderByIncrementId($orderNo);
481
+
482
+ if ($this->recurring && $request['subs_billing'] && $request['signup_tid']) {
483
+ $recurringProfileId = $this->getProfileInformation($request);
484
+ $activeState = $recurringProfileId->getState();
485
+ $orderNo = $this->getRecurringOrderNo($recurringProfileId);
486
+ }
487
 
488
  if ($order->getIncrementId() == $orderNo && !empty($orderNo)) {
 
489
  //check amount
490
  $amount = $request['amount'];
491
  if (!$amount || intval($amount) < 0) {
492
+ echo "Novalnet callback received. The requested amount ($amount) must be greater than zero." . $this->lineBreak;
493
+ die;
494
  }
495
 
496
+ $orderPaymentName = strtolower($this->paymentCode);
497
+ if ($request['subs_billing'] == 1) {
498
+ $orgTid = $request['signup_tid'];
499
+ } else if ((in_array($request['payment_type'], $this->chargebacks)) || $request['payment_type'] == 'INVOICE_CREDIT') {
500
  $orgTid = $request['tid_payment'];
501
  } else {
502
  $orgTid = $request['tid'];
503
  }
504
 
505
+ $paymentType = $this->allowedPayment[$orderPaymentName];
506
+ if (!in_array($request['payment_type'], $paymentType)) {
507
+ echo "Novalnet callback received. Payment type (" . $request['payment_type'] . ") is not matched with $orderPaymentName!" . $this->lineBreak;
508
+ die;
509
+ }
510
+
511
  $payment = $order->getPayment();
512
  $additionalData = unserialize($payment->getAdditionalData());
513
+ $orderTid = ((in_array($request['payment_type'], $this->chargebacks)) && $additionalData['NnTid'])
514
  ? $additionalData['NnTid'] : $order->getPayment()->getLastTransId();
515
+
516
+ if (!preg_match('/^' . $orgTid . '/i', $orderTid)
517
+ && !$this->recurring) {
518
+ echo 'Novalnet callback received. Order no is not valid' . $this->lineBreak;
519
+ die;
520
+ }
521
+
522
+ if ($this->recurring && $request['subs_billing'] && $activeState == 'canceled') {
523
+ echo 'Subscription already Cancelled. Refer Order : ' . $orderNo . $this->lineBreak;
524
+ die;
525
  }
526
 
527
  return true;
528
  } else {
529
+ echo 'Novalnet callback received. Order no is not valid' . $this->lineBreak;
530
+ die;
531
  }
532
  }
533
 
534
  /**
535
+ * Set the staus and state to an order payment
536
  *
537
+ * @return boolean
538
  */
539
+ public function setOrderStatus()
540
  {
541
+ $order = $this->getOrderByIncrementId($this->orderNo);
542
+ $orderItems = $order->getAllItems();
543
+ $helper = $this->_getNovalnetHelper();
544
+ $nominalItem = $helper->checkNominalItem($orderItems);
545
 
546
  if ($order) {
547
+ $status = $this->getOrderStatus($order);
548
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
549
  $request = $this->request;
550
  $order->getPayment()->getMethodInstance()->setCanCapture(true);
551
+ $payment = $order->getPayment();
552
+ $data = unserialize($payment->getAdditionalData());
553
+ $currency = $this->getAdminTransaction->getCurrency();
554
+ if ($this->level == 1) { //level 1 payments - Type of Chargebacks
555
+ // Update callback comments for Chargebacks
556
+ if (in_array($this->request['payment_type'], $this->chargebacks)) {
557
+ $tId = !$this->recurring ? $request['tid_payment'] : $request['signup_tid'];
558
+ $script = 'Novalnet Callback script received. Charge back was executed sucessfully for the TID ' . $tId . ' amount ' . ($request['amount'])
559
+ / 100 . ' ' . $currency . " on " . $this->currenttime;
560
+ $this->emailBody = $script;
561
+ $this->saveAdditionalInfo($payment, $data, $script, $order);
562
+ return true;
563
+ }
564
+ }
565
 
566
+ if ($request['payment_type'] == 'SUBSCRIPTION_STOP') { ### Cancellation of a Subscription
567
+ ### UPDATE THE STATUS OF THE USER SUBSCRIPTION ###
568
+ $script = 'Novalnet Callback script received. Subscription has been stopped for the TID:' . $request['signup_tid'] . " on " . $this->currenttime;
569
+ $script .= '<br>Reason for Cancellation: ' . $request['termination_reason'];
570
+ $this->emailBody = $script;
571
+ $this->saveAdditionalInfo($payment, $data, $script, $order);
572
+ $recurringProfileId = $this->getProfileInformation($request);
573
+ $recurringProfileId->setState('canceled');
574
+ $recurringProfileId->save();
575
  return true;
576
  }
577
 
578
+ $invoice = $order->getInvoiceCollection()->getFirstItem();
579
+ $paid = $invoice->getState();
580
+ if ($this->level == 0 || $this->level == 2) {
581
+ $subsPaymentType = array('CREDITCARD', 'DIRECT_DEBIT_SEPA', 'INVOICE_START');
582
+ if ($this->recurring && in_array($this->request['payment_type'], $subsPaymentType) && !empty($this->request['signup_tid'])
583
+ && $this->request['subs_billing'] == 1) {
584
+ $recurringProfileId = $this->getProfileInformation($request);
585
+ $periodMaxCycles = $recurringProfileId->getPeriodMaxCycles();
586
+ $profileId = $recurringProfileId->getId();
587
+ $helper = $this->_getNovalnetHelper();
588
+ if ($this->getAdminTransaction->getNextSubsCycle() == '') {
589
+ echo "Novalnet callback received. Subscription Suspended. Refer Order :" . $this->orderNo . $this->lineBreak;
590
+ die;
591
+ }
592
+ $script = 'Novalnet Callback script received. Recurring was executed sucessfully for the TID ' . $request['signup_tid'] . ' with amount ' . ($request['amount']) / 100 . ' ' . $currency . ' ' . " on " . $this->currenttime.'.';
593
+
594
+ $callbackCycle = $this->getRecurringCallbackSave($request, $periodMaxCycles, $helper, $profileId);
595
+ $this->getEndTime($request, $recurringProfileId, $callbackCycle);
596
+ $paidAmount = ($request['amount'] / 100);
597
+ $loadTransaction = $helper->loadTransactionStatus($request['signup_tid'])
598
+ ->setAmount($paidAmount)
599
+ ->save();
600
+ $this->createOrder($order,$script,$data,$payment,$profileId);
601
+ return true;
602
+ }
603
+
604
  if ($this->createInvoice) {
605
+ $saveinvoice = $this->saveInvoice($order,$nominalItem,$paid);
606
  }
607
 
608
+ if ($invoice) {
609
  if ($saveinvoice) {
610
+ $order->setState($state, true, 'Novalnet callback set state ' . $state . ' for Order-ID = ' . $this->orderNo); //processing: ok; complete: not ok -> would cause the error msg: 'Der Bestellzustand "complete" darf nicht manuell gesetzt werden'
611
+ $order->addStatusToHistory($status, 'Novalnet callback added order status ' . $status); // this line must be located after $order->setState()
612
+ $this->emailBody .= 'Novalnet callback set state to ' . $state . $this->lineBreak;
613
+ $this->emailBody .= 'Novalnet callback set status to ' . $status . ' ... ' . $this->lineBreak;
614
  $order->save();
615
 
616
  //Add subsequent TID to DB column last_trans_id
617
  if ($this->addSubsequentTidToDb) {
618
+ $transMode = (version_compare($helper->getMagentoVersion(), '1.6', '<'))
 
 
 
619
  ? false : true;
 
 
620
  if (in_array($request['payment_type'], $this->invoiceAllowed)) {
621
+ if ($nominalItem) {
622
+ $tidPayment = isset($request['signup_tid']) && $request['signup_tid'] && $request['subs_billing'] ? trim($request['signup_tid']) : trim($request['tid_payment']);
623
+ } else {
624
+ $tidPayment = trim($request['tid']);
625
+ }
626
+ $payment->setTransactionId($tidPayment)
627
  ->setIsTransactionClosed($transMode);
628
  $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
629
  $transaction->setParentTxnId(null)
630
+ ->save();
631
+ $amount = $this->_getNovalnetHelper()->getFormatedAmount($request['amount'], 'RAW');
632
+ $currency = $this->getAdminTransaction->getCurrency();
633
+ $script = 'Novalnet Callback Script executed successfully. The subsequent TID: ' . $request['tid'] . ' on ' . $this->currenttime . ' for the amount : ' . $amount . ' ' . $currency;
634
  } else {
635
+ $script = 'Novalnet Callback Script executed successfully on ' . $this->currenttime;
 
 
 
 
 
636
  }
637
+ $this->saveAdditionalInfo($payment, $data, $script, $order);
638
+ }
639
 
640
+ $changeAmount = $helper->getAmountCollection($order->getId(), 1, NULL);
641
+ if ($changeAmount != '') {
642
+ $loadTransStatus = $helper->loadTransactionStatus($request['tid_payment']);
643
+ $loadTransStatus->setAmount($changeAmount)
644
+ ->save();
645
  }
646
  }
647
  } else {
648
  echo "Novalnet Callback: No invoice for order (" . $order->getId() . ") found";
649
+ die;
650
  }
651
+ }
652
  } else {
653
+ echo "Novalnet Callback: No order for Increment-ID $this->orderNo found.";
654
+ die;
655
  }
656
  return true;
657
  }
659
  /**
660
  * Create invoice to order payment
661
  *
662
+ * @param varien_object $order
663
+ * @param varien_object $nominalItem
664
+ * @param int $paid
665
+ * @return boolean
666
  */
667
+ public function saveInvoice(Mage_Sales_Model_Order $order,$nominalItem,$paid)
668
  {
 
669
  if (!$this->callBackExecuted) {
670
  $request = $this->request;
671
+ $orderNo = $this->orderNo;
672
+ $helper = $this->_getNovalnetHelper();
673
  $payment = $order->getPayment();
674
  $paymentObj = $payment->getMethodInstance();
675
  $data = unserialize($payment->getAdditionalData());
676
+
677
+ $modNovalCallback = Mage::getModel('novalnet_payment/callback')->loadLogByOrderId($orderNo);
678
  $sum = sprintf( ($request['amount'] + $modNovalCallback->getCallbackAmount()) , 0.2);
679
+ $amountvalue = $this->getRecurringTotal($request, $order,$nominalItem);
680
+ $grandTotal = sprintf( ($amountvalue * 100) , 0.2);
681
+ if (!$this->recurring) {
682
+ $tidpayment = $request['tid_payment'];
683
+ } else {
684
+ $tidpayment = $request['signup_tid'];
685
+ }
686
 
687
  if (in_array($request['payment_type'], $this->invoiceAllowed) && $sum
688
  < $grandTotal) {
689
+ $this->doNovalnetCallbackLog($modNovalCallback, $request, $sum);
690
+ $amount = $helper->getFormatedAmount($request['amount'], 'RAW');
691
+ $this->emailBody = "Novalnet Callback Script executed successfully for the TID: " . $tidpayment . " with amount " . $amount . $this->getAdminTransaction->getCurrency() . " on " . $this->currenttime . ". Please refer PAID transaction in our Novalnet Merchant Administration with the TID: " . $request['tid'] . "$this->lineBreak$this->lineBreak";
692
+ $script = "Novalnet Callback Script executed successfully. Payment for order id :" . $orderNo . '. New TID: ' . $request['tid'] . ' on ' . $this->currenttime . ' for the amount : ' . $amount . ' ' . $this->getAdminTransaction->getCurrency() . $this->lineBreak;
693
+ $this->saveAdditionalInfo($payment, $data, $script, $order);
 
 
 
 
694
  return false;
695
  } else {
696
+ $this->doNovalnetCallbackLog($modNovalCallback, $request, $sum);
697
+ $amount = $helper->getFormatedAmount($request['amount'], 'RAW');
 
698
  if ($order->canInvoice()) {
699
+ $tid = $this->requestTid($request);
 
700
  $invoice = $order->prepareInvoice();
701
  $invoice->setTransactionId($tid);
702
  $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
706
  ->addObject($invoice)
707
  ->addObject($invoice->getOrder())
708
  ->save();
709
+ if ($this->recurring || $nominalItem) {
710
+ $profileInfo = $this->getProfileInformation($request);
711
+ $profileInfo->setState('active');
712
+ $profileInfo->save();
713
+ }
714
 
715
+ $amount = $helper->getFormatedAmount($request['amount'], 'RAW');
716
  if (in_array($request['payment_type'], $this->invoiceAllowed)) {
717
+ $emailText = "Novalnet Callback Script executed successfully for the TID: " . $tidpayment . " with amount " . $amount . $this->getAdminTransaction->getCurrency() . " on " . $this->currenttime . ". Please refer PAID transaction in our Novalnet Merchant Administration with the TID: " . $request['tid'] . "$this->lineBreak$this->lineBreak";
718
+
719
+ $this->emailBody = ($sum > $grandTotal) ? $emailText . "Your paid amount is greater than the order total amount. $this->lineBreak"
720
+ : $emailText;
721
  } else {
722
+ $this->emailBody = "Novalnet Callback Script executed successfully for the TID: " . $request['tid'] . " with amount " . $amount . $this->getAdminTransaction->getCurrency() . " on " . $this->currenttime . ". $this->lineBreak$this->lineBreak";
723
  }
724
  } else {
725
+ if ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_INVOICE && $paid == 1) {
 
726
  $currency = $this->getAdminTransaction->getCurrency();
727
+ $script = 'Novalnet Callback Script executed successfully. The subsequent TID: ' . $this->request['tid'] . ' on ' . $this->currenttime . ' for the amount : ' . $currency . ' ' . $amount;
 
 
 
 
 
728
  $this->emailBody = $script;
729
+ $this->saveAdditionalInfo($payment, $data, $script, $order);
730
+ $this->saveOrderStatus($order,$nominalItem);
731
+ $this->sendCallbackMail();
732
+ die;
733
  }
734
 
735
  $invoicePayments = array(Novalnet_Payment_Model_Config::NN_PREPAYMENT, Novalnet_Payment_Model_Config::NN_INVOICE);
736
  if (in_array($paymentObj->getCode(), $invoicePayments)) {
737
  echo "Novalnet callback received. Callback Script executed already. Refer Order :" . $this->orderNo . $this->lineBreak;
738
+ } elseif ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_PAYPAL) {
739
+ echo "Novalnet callback received. Order already paid." . $this->lineBreak;
740
  } else {
741
  echo "Novalnet Callbackscript received. Payment type ( " . $request['payment_type'] . " ) is not applicable for this process!" . $this->lineBreak;
742
  }
748
  }
749
 
750
  /**
751
+ * Save order status invoice payment
752
  *
753
+ * @param varien_object $order
754
+ * @param varien_object $nominalItem
755
  */
756
+ private function saveOrderStatus($order,$nominalItem)
757
  {
 
758
  $payment = $order->getPayment();
759
  $originalTid = trim($payment->getLastTransId());
760
+ if (!$this->recurring && !$nominalItem) {
761
+ $transaction = Mage::getModel('sales/order_payment')->getCollection()
762
+ ->addFieldToFilter('last_trans_id', $originalTid)
763
+ ->addFieldToSelect('entity_id');
764
+ foreach ($transaction as $transactionId) {
765
+ $entitiyId = $transactionId->getEntityId();
766
+ }
767
+ Mage::getModel('sales/order_payment')->load($entitiyId)
768
+ ->setLastTransId(trim($this->request['tid']))
769
+ ->save();
770
+ }
771
+
772
  $orderStatus = $this->getOrderStatus($order);
773
  $orderState = Mage_Sales_Model_Order::STATE_PROCESSING; //processing: ok; complete: not ok -> would cause the error msg: 'Der Bestellzustand "complete" darf nicht manuell gesetzt werden'
774
  $order->setState($orderState, true, 'Novalnet callback set state ' . $orderState . ' for Order-ID = ' . $this->orderNo);
775
  $order->addStatusToHistory($orderStatus, 'Novalnet callback added order status ' . $orderStatus); // this line must be located after $order->setState()
776
  $order->save();
777
+
778
  $invoice = $order->getInvoiceCollection()->getFirstItem();
779
  $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
780
  $invoice->save();
781
+
782
+ if ($this->recurring || $nominalItem) {
783
+ $profileInfo = $this->getProfileInformation($this->request);
784
+ $profileInfo->setState('active');
785
+ $profileInfo->save();
786
+ }
787
  }
788
 
789
  /**
790
+ * Get the payment method code from order
791
  *
792
+ * @param varien_object $order
793
+ * @return string
794
  */
795
+ private function getPaymentMethod($order)
796
  {
797
+ return $order->getPayment()->getData('method');
798
+ }
799
+
800
+ /**
801
+ * Check whether the ip address is authorised
802
+ *
803
+ * @return boolean
804
+ */
805
+ public function checkIP()
806
+ {
807
+ $callerIp = $this->_getNovalnetHelper()->getRealIpAddr();
808
+
809
+ if (!in_array($callerIp, $this->ipAllowed) && !$this->test) {
810
+ echo 'Novalnet callback received. Unauthorised access from the IP [' . $callerIp . ']' . $this->lineBreak . $this->lineBreak;
811
+ die;
812
  }
813
+
814
+ return true;
815
  }
816
 
817
  /**
818
+ * Log Novalnet transaction status data
819
  *
820
+ * @param array $response
821
  */
822
+ public function doTransactionStatusSave($response)
823
  {
824
+ $transactionStatus = $this->getAdminTransaction;
825
+ $order = $this->getOrderByIncrementId($this->orderNo);
826
+ $amount = $response['amount'];
827
+ $status = trim($transactionStatus->getStatus());
828
+ $ncNo = (isset($response['nc_no'])) ? $response['nc_no'] : NULL;
829
+ $helper = $this->_getNovalnetHelper();
830
  $payment = $order->getPayment();
831
  $paymentObj = $payment->getMethodInstance();
832
+ $storeId = $order->getStoreId();
833
+ $modNovalTransactionStatus = Mage::getModel('novalnet_payment/transactionstatus');
834
+ $modNovalTransactionStatus->setTransactionNo($response['tid'])
835
+ ->setOrderId($this->orderNo)
836
+ ->setTransactionStatus($status) //Novalnet Admin transaction status
837
+ ->setNcNo($ncNo) //nc number
838
+ ->setCustomerId($response['customer_no'])
839
+ ->setPaymentName($this->paymentCode)
840
+ ->setAmount($helper->getFormatedAmount($amount, 'RAW'))
841
+ ->setRemoteIp($helper->getRealIpAddr())
842
+ ->setStoreId($storeId)
843
+ ->setShopUrl($helper->getCurrentSiteUrl())
844
+ ->setCreatedDate($helper->getCurrentDateTime())
845
+ ->save();
846
+ }
847
 
848
+ /**
849
+ * Log Novalnet transaction data
850
+ *
851
+ * @param array $response
852
+ */
853
+ public function doTransactionOrderLog($response)
854
+ {
855
+ $order = $this->getOrderByIncrementId($this->orderNo);
856
+ $helper = $this->_getNovalnetHelper();
857
+ $storeId = $order->getStoreId();
858
+ $modNovalTransactionOverview = $helper->getModelTransactionOverview()->loadByAttribute('order_id', $this->orderNo);
859
+ $modNovalTransactionOverview->setTransactionId($response['tid'])
860
+ ->setResponseData(base64_encode(serialize($response)))
861
+ ->setCustomerId($response['customer_no'])
862
+ ->setStatus($response['status']) //transaction status code
863
+ ->setStoreId($storeId)
864
+ ->setShopUrl($helper->getCurrentSiteUrl())
865
+ ->save();
866
  }
867
 
868
  /**
869
  * Log partial callback data
870
  *
871
+ * @param Novalnet_Payment_Model_Callback $modNovalCallback
872
+ * @param array $response
873
+ * @param int $sum
874
  */
875
+ public function doNovalnetCallbackLog($modNovalCallback, $response, $sum)
876
  {
877
+ $orgTid = $this->requestTid($response);
878
+ $orderNo = $this->orderNo;
879
+ $reqUrl = Mage::helper('core/http')->getRequestUri();
880
+ $modNovalCallback->setOrderId($orderNo)
 
881
  ->setCallbackAmount($sum)
882
  ->setReferenceTid($orgTid)
883
+ ->setCallbackDatetime($this->currenttime)
884
+ ->setCallbackLog($reqUrl)
885
  ->save();
886
  }
887
 
892
  private function doNovalnetAffAccInfoLog()
893
  {
894
  $request = $this->request;
895
+ $helper = $this->_getNovalnetHelper();
896
+ $affiliateAccInfo = $helper->getModelAffiliate();
897
  $affiliateAccInfo->setVendorId($request['vendor_id'])
898
  ->setVendorAuthcode($request['vendor_authcode'])
899
  ->setProductId($request['product_id'])
904
  ->setAffAccesskey($request['aff_accesskey'])
905
  ->save();
906
  //Send notification mail to Merchant
907
+ $this->getEmailConfig();
908
  $this->emailBody = 'Novalnet callback script executed successfully with Novalnet account activation information.';
909
+ $this->sendCallbackMail();
910
+ }
911
+
912
+ /**
913
+ * Get Novalnet Helper
914
+ *
915
+ * @return Novalnet_Payment_Helper_Data
916
+ */
917
+ private function _getNovalnetHelper()
918
+ {
919
+ return Mage::helper('novalnet_payment');
920
  }
921
 
922
  /**
923
  * Get order object for specific order id
924
  *
925
+ * @param int $incrementId
926
+ * @return varien_object
927
  */
928
+ public function getOrderByIncrementId($incrementId)
929
  {
930
  $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
931
  return $order;
932
  }
933
 
934
  /**
935
+ * Get Request param
936
  *
937
+ * @return array
938
+ */
939
+ public function getParam()
940
+ {
941
+ return Mage::app()->getRequest()->getPost()
942
+ ? Mage::app()->getRequest()->getPost()
943
+ : Mage::app()->getRequest()->getQuery();
944
+ }
945
+
946
+ /**
947
+ * Get the order payment status
948
+ *
949
+ * @param varien_object $order
950
  * @return string
951
  */
952
+ private function getOrderStatus($order)
953
  {
954
+ $payment = $order->getPayment();
955
+ $paymentObj = $payment->getMethodInstance();
956
+ $storeId = $order->getStoreId();
957
+ $getresponseData = unserialize($payment->getAdditionalData());
958
+ $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
959
+ array_push($redirectPayment, Novalnet_Payment_Model_Config::NN_PREPAYMENT,Novalnet_Payment_Model_Config::NN_INVOICE);
960
+
961
+ $status = $paymentObj->_getConfigData('order_status', '', $storeId);
962
+ if (($paymentObj->getCode() && (in_array($paymentObj->getCode(), $redirectPayment)))
963
+ || ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_CC
964
+ && isset($getresponseData['ActiveCc3d']) && $getresponseData['ActiveCc3d'])) {
965
+ $status = $paymentObj->_getConfigData('order_status_after_payment', '', $storeId);
966
+ }
967
+ if ($paymentObj->getCode() && $paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_PAYPAL
968
+ && ($this->getAdminTransaction->getStatus() == Novalnet_Payment_Model_Config::PAYPAL_PENDING_CODE)) {
969
+ $status = $paymentObj->_getConfigData('order_status', '', $storeId)
970
+ ? $paymentObj->_getConfigData('order_status', '', $storeId)
971
+ : Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
972
+ }
973
+ if (!$status) {
974
+ $status = Mage_Sales_Model_Order::STATE_PROCESSING;
975
+ }
976
+ return $status;
977
  }
978
 
979
  /**
980
+ * Get the Recurring Profile Order No
981
  *
982
+ * @param int $recurringProfileId
983
+ * @return int
984
  */
985
+ private function getRecurringOrderNo($recurringProfileId)
986
  {
987
+ $orderNo = '';
988
+ $recurringProfileCollection = Mage::getResourceModel('sales/order_grid_collection')
989
+ ->addRecurringProfilesFilter($recurringProfileId->getId());
990
+ foreach ($recurringProfileCollection as $recurringProfileCollectionValue) {
991
+ $orderNo = $recurringProfileCollectionValue->getIncrementId();
992
+ }
993
+ return $orderNo;
994
+ }
995
+
996
+ /**
997
+ * Get the Recurring Profile Information
998
+ *
999
+ * @param varien_object $request
1000
+ * @return int
1001
+ */
1002
+ private function getProfileInformation($request)
1003
+ {
1004
+ $tid = (isset($request['signup_tid']) && $request['signup_tid']) ? $request['signup_tid'] : $request['tid_payment'];
1005
+
1006
+ $recurringProfileId = Mage::getModel('sales/recurring_profile')->load($tid, 'reference_id');
1007
+ return $recurringProfileId;
1008
+ }
1009
+
1010
+ /**
1011
+ * Get the Recurring Callback save
1012
+ *
1013
+ * @param varien_object $request
1014
+ * @param int $periodMaxCycles
1015
+ * @param Novalnet_Payment_Helper_Data $helper
1016
+ * @param int $profileId
1017
+ * @return int
1018
+ */
1019
+ private function getRecurringCallbackSave($request, $periodMaxCycles, $helper, $profileId)
1020
+ {
1021
+ $recurringCollection = $helper->getModelRecurring()->getCollection();
1022
+ $recurringCollection->addFieldToFilter('profile_id', $profileId);
1023
+ $recurringCollection->addFieldToSelect('callbackcycle');
1024
+ $countRecurring = count($recurringCollection);
1025
+ if ($countRecurring == 0) {
1026
+ $callbackCycle = 1;
1027
+ $recurringSave = $helper->getModelRecurring();
1028
+ $recurringSave->setProfileId($profileId);
1029
+ $recurringSave->setSignupTid($request['signup_tid']);
1030
+ $recurringSave->setBillingcycle($periodMaxCycles);
1031
+ $recurringSave->setCallbackcycle($callbackCycle);
1032
+ $recurringSave->setCycleDatetime($this->currenttime);
1033
+ $recurringSave->save();
1034
  } else {
1035
+ foreach ($recurringCollection as $recurringValue) {
1036
+ $callbackCycle = $recurringValue->getCallbackcycle();
1037
+ }
1038
+ $callbackCycle = $callbackCycle + 1;
1039
+ $recurringSave = $helper->getModelRecurring()->load($profileId, 'profile_id');
1040
+ $recurringSave->setCallbackcycle($callbackCycle);
1041
+ $recurringSave->setCycleDatetime($this->currenttime);
1042
+ $recurringSave->save();
1043
  }
1044
+ return $callbackCycle;
1045
  }
1046
 
1047
  /**
1048
+ * Get the Recurring End Time
1049
  *
1050
+ * @param varien_object $request
1051
+ * @param int $recurringProfileId
1052
+ * @param int $callbackCycle
1053
  */
1054
+ private function getEndTime($request, $recurringProfileId, $callbackCycle)
1055
  {
1056
+ $periodUnit = $recurringProfileId->getPeriodUnit();
1057
+ $periodFrequency = $recurringProfileId->getPeriodFrequency();
1058
+ $periodMaxCycles = $recurringProfileId->getPeriodMaxCycles();
1059
+ $this->endTime = 0;
1060
+
1061
+ if ($callbackCycle == $periodMaxCycles) {
1062
+ $requestdata = new Varien_Object();
1063
+ $order = $this->getOrderByIncrementId($this->orderNo);
1064
+ $payment = $order->getPayment()->getMethodInstance();
1065
+ $helper = $this->_getNovalnetHelper();
1066
+ $orderItems = $order->getAllItems();
1067
+ $nominalItem = $helper->checkNominalItem($orderItems);
1068
+ $storeId = $helper->getMagentoStoreId();
1069
+ $payment->assignOrderBasicParams($requestdata, $payment, $storeId, $nominalItem);
1070
+ $requestdata->setNnLang(strtoupper($helper->getDefaultLanguage()))
1071
+ ->setCancelSub(1)
1072
+ ->setCancelReason('other')
1073
+ ->setTid($request['signup_tid']);
1074
+ $buildNovalnetParam = http_build_query($requestdata->getData());
1075
+ $recurringcancelUrl = $helper->getPayportUrl('paygate');
1076
+ $response = Mage::helper('novalnet_payment/AssignData')->setRawCallRequest($buildNovalnetParam, $recurringcancelUrl);
1077
+ $recurringProfileId->setState('canceled');
1078
+ $recurringProfileId->save();
1079
+ $this->endTime = 1;
1080
+ }
1081
+ }
1082
 
1083
+ /**
1084
+ * validate the payment type.
1085
+ *
1086
+ * @param varien_object $order
1087
+ * @return boolean
1088
+ */
1089
+ private function paymentTypeValidation($order)
1090
+ {
1091
+ $orderPaymentName = strtolower($this->getPaymentMethod($order));
1092
+ $paymentType = $this->allowedPayment[$orderPaymentName];
1093
+ if (!in_array($this->request['payment_type'], $paymentType)) {
1094
+ echo "Novalnet callback received. Payment type (" . $this->request['payment_type'] . ") is not matched with $orderPaymentName!" . $this->lineBreak . $this->lineBreak;
1095
+ die;
1096
  }
1097
+
1098
  return true;
1099
  }
1100
 
1101
  /**
1102
+ * Get Recurring total.
1103
  *
1104
+ * @param varien_object $request
1105
+ * @param varien_object $order
1106
+ * @param mixed $nominalItem
1107
+ * @return float
1108
  */
1109
+ private function getRecurringTotal($request, $order,$nominalItem)
1110
  {
1111
+ if ($this->recurring || $nominalItem) {
1112
+ $profileInfo = $this->getProfileInformation($request);
1113
+ $billingAmount = $profileInfo->getBillingAmount();
1114
+ $initialAmount = $profileInfo->getInitAmount();
1115
+ $trialAmount = $profileInfo->getTrialBillingAmount();
1116
+ $shippingAmount = $profileInfo->getShippingAmount();
1117
+ $taxAmount = $profileInfo->getTaxAmount();
1118
+ }
1119
 
1120
+ $changeAmount = $this->_getNovalnetHelper()->getAmountCollection($order->getId(), 1, NULL);
1121
+ if ($changeAmount != '') {
1122
+ $amountvalue = $changeAmount;
1123
+ } else if (($this->recurring || $nominalItem) && ($initialAmount != '' && $trialAmount != ''
1124
+ && $billingAmount != '')) {
1125
+ $amountvalue = round(($trialAmount + $initialAmount + $shippingAmount
1126
+ + $taxAmount), 2);
1127
+ } else if (($this->recurring || $nominalItem) && ($trialAmount != '' && $billingAmount != '')) {
1128
+ $amountvalue = round(($trialAmount + $shippingAmount + $taxAmount), 2);
1129
+ } else if (($this->recurring || $nominalItem) && ($initialAmount != '' && $billingAmount != '')) {
1130
+ $amountvalue = round(($initialAmount + $billingAmount + $shippingAmount
1131
+ + $taxAmount), 2);
1132
+ } else {
1133
+ $amountvalue = $order->getGrandTotal();
 
 
 
 
 
1134
  }
1135
+
1136
+ return $amountvalue;
1137
  }
1138
 
1139
  /**
1140
+ * Save the additional data.
1141
  *
1142
+ * @param varien_object $payment
1143
+ * @param array $data
1144
+ * @param string $script
1145
+ * @param varien_object $order
1146
  */
1147
+ private function saveAdditionalInfo($payment, $data, $script, $order)
1148
  {
1149
+ $data['NnComments'] = empty($data['NnComments']) ? '<br>' . $script : $data['NnComments'] . '<br>' . $script;
1150
+ if ($payment && $data) {
1151
+ $payment->setAdditionalData(serialize($data));
1152
+ $order->setPayment($payment)
1153
+ ->save();
1154
+ }
1155
+ }
1156
 
1157
+ /**
1158
+ * Get email config
1159
+ *
1160
+ * @param int $storeId
1161
+ */
1162
+ private function getEmailConfig($storeId = NULL)
1163
+ {
1164
+ $this->emailFromAddr = Mage::getStoreConfig('trans_email/ident_general/email', $storeId); //sender email addr., mandatory, adapt it
1165
+ $this->emailToAddr = Mage::getStoreConfig('payment/novalnetcallback/emailtoaddr',$storeId); //recipient email addr., mandatory, adapt it
1166
+ $this->emailBCcAddr = Mage::getStoreConfig('payment/novalnetcallback/emailBcc',$storeId); //Bcc mail
1167
+ $this->emailSubject = 'Novalnet Callback Script Access Report'; //adapt if necessary;
1168
+ $this->emailBody = ""; //Email text's 1. line, can be let blank, adapt for your need
1169
+ $this->emailFromName = Mage::getStoreConfig('trans_email/ident_general/name', $storeId); // Sender name, adapt
1170
+ $this->emailToName = ""; // Recipient name, adapt
1171
+ $this->callBackExecuted = false;
1172
+
1173
+ if (isset($this->request['debug_mode']) && $this->request['debug_mode'] == 1) {
1174
+ $this->emailFromAddr = 'testadmin@novalnet.de';
1175
+ $this->emailFromName = 'Novalnet';
1176
+ $this->emailToAddr = 'test@novalnet.de';
1177
+ $this->emailToName = 'Novalnet';
1178
  }
1179
+ }
1180
 
1181
+ /*
1182
+ * Get given payment_type level for process
1183
+ *
1184
+ * @return Integer | boolean
1185
+ */
1186
+ private function getPaymentTypeLevel()
1187
+ {
1188
+ if (!empty($this->request)) {
1189
+ if (in_array($this->request['payment_type'], $this->paymentTypes)) {
1190
+ return 0;
1191
+ } else if(in_array($this->request['payment_type'], $this->chargebacks)) {
1192
+ return 1;
1193
+ } else if(in_array($this->request['payment_type'], $this->aryCollection)) {
1194
+ return 2;
1195
+ }
1196
  }
1197
+ return false;
1198
+ }
1199
+
1200
+ /**
1201
+ * get order id based on last transaction id.
1202
+ *
1203
+ * @return int
1204
+ */
1205
+ private function getOrderIdByTransId()
1206
+ {
1207
+ $request = $this->request;
1208
+ $orgTid = $this->requestTid($request);
1209
 
1210
  $tablePrefix = Mage::getConfig()->getTablePrefix();
1211
+ if (in_array($request['payment_type'], $this->chargebacks)) {
1212
  $orderPayment = $tablePrefix.'sales_payment_transaction';
1213
  $onCondition = "main_table.entity_id = $orderPayment.order_id";
1214
  $orderCollection = Mage::getModel('sales/order')->getCollection()
1229
  $orderid = $order->getIncrementId();
1230
  }
1231
  }
 
1232
 
1233
+ $orderId = (isset($orderid) && $orderid != NULL) ? $orderid : '';
1234
  return $orderId;
1235
  }
1236
 
1237
+ /**
1238
+ * Get transaction id based on payment type
1239
+ *
1240
+ * @param array $request
1241
+ * @return int $tidPayment
1242
+ */
1243
+ private function requestTid($request)
1244
+ {
1245
+ if (isset($request['signup_tid']) && $request['signup_tid']) {
1246
+ $tidPayment = trim($request['signup_tid']);
1247
+ } elseif ((in_array($this->request['payment_type'], $this->chargebacks))
1248
+ || ($this->request['payment_type'] == 'INVOICE_CREDIT')) {
1249
+ $tidPayment = trim($request['tid_payment']);
1250
+ } else {
1251
+ $tidPayment = trim($request['tid']);
1252
+ }
1253
+
1254
+ return $tidPayment;
1255
+ }
1256
+
1257
+ /**
1258
+ * New order create process
1259
+ *
1260
+ * @param varien_object $order
1261
+ * @param string $script
1262
+ * @param array $data
1263
+ * @param varien_object $paymentold
1264
+ * @param int $profileId
1265
+ */
1266
+ private function createOrder($order,$script,$data,$paymentold,$profileId)
1267
+ {
1268
+ $helper = $this->_getNovalnetHelper();
1269
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
1270
+ $additionalInfo = $order->getPayment()->getAdditionalInformation();
1271
+ $storeId = $order->getStoreId();
1272
+ $this->setLanguageStore($storeId);
1273
+ $ordernew = Mage::getModel('sales/order')
1274
+ ->setState('new');
1275
+
1276
+ $orderPayment = Mage::getModel('sales/order_payment')
1277
+ ->setStoreId($storeId)
1278
+ ->setMethod($paymentCode)
1279
+ ->setPo_number('-');
1280
+ $ordernew->setPayment($orderPayment);
1281
+ $ordernew = $this->setOrderDetails($order,$ordernew);
1282
+ $billingAddress = Mage::getModel('sales/order_address');
1283
+ $getBillingAddress = Mage::getModel('sales/order_address')->load($order->getBillingAddress()->getId());
1284
+ $ordernew = $this->setBillingShippingAddress($getBillingAddress,$billingAddress,$ordernew,$order);
1285
+ $isVirtual = $order->getIsVirtual();
1286
+
1287
+ if ($isVirtual == 0) {
1288
+ $shippingAddress = Mage::getModel('sales/order_address');
1289
+ $getShippingAddress = Mage::getModel('sales/order_address')->load($order->getShippingAddress()->getId());
1290
+ $ordernew = $this->setBillingShippingAddress($getShippingAddress,$shippingAddress,$ordernew,$order);
1291
+ }
1292
+
1293
+ $ordernew = $this->setOrderItemsDetails($order,$ordernew);
1294
+ $payment = $ordernew->getPayment();
1295
+ $paymentObj = $payment->getMethodInstance();
1296
+ $setOrderAfterStatus = $paymentObj->getConfigData('order_status',$storeId);
1297
+ $setOrderAfterStatus = $setOrderAfterStatus ? $setOrderAfterStatus : Mage_Sales_Model_Order::STATE_PROCESSING;
1298
+ $ordernew->addStatusToHistory($setOrderAfterStatus, $helper->__('Novalnet Recurring Callback script Executed Successfully'), false);
1299
+ $tid = trim($this->request['tid']);
1300
+ $ordernew->save();
1301
+ $newOrderId = $ordernew->getId();
1302
+ $parentOrderNo = $this->getOrderIdByTransId() ? $this->getOrderIdByTransId() : $ordernew->getIncrementId();
1303
+ $script .= ' Recurring Payment for order id : '.$parentOrderNo;
1304
+
1305
+ $script .= !$this->endTime ? '<br>Next Payment Date is: '.$this->getAdminTransaction->getNextSubsCycle() : '';
1306
+ $this->emailBody = $script;
1307
+
1308
+ $newData = array('NnTestOrder' => $this->request['test_mode'],
1309
+ 'NnTid' => $tid,
1310
+ 'orderNo' => $ordernew->getIncrementId(),
1311
+ 'vendor' => $data['vendor'],
1312
+ 'auth_code' => $data['auth_code'],
1313
+ 'product' => $data['product'],
1314
+ 'tariff' => $data['tariff'],
1315
+ 'key' => $data['key']
1316
+ );
1317
+ if ($paymentCode == 'novalnetPrepayment' || $paymentCode == 'novalnetInvoice') {
1318
+ $dataObj = new Varien_Object($this->request);
1319
+ $dataHelper = Mage::helper('novalnet_payment/AssignData');
1320
+ $newData['NnNoteDesc'] = $dataHelper->getNoteDescription();
1321
+ $newData['NnDueDate'] = isset($this->request['due_date']) ? ($helper->__('Due Date') . ' : <b>' . Mage::helper('core')->formatDate($this->request['due_date']) . "</b><br />") : '';
1322
+ $newData['NnNote'] = $dataHelper->getNote($dataObj);
1323
+ $newData['NnNoteAmount'] = $dataHelper->getBankDetailsAmount(($this->request['amount'] / 100));
1324
+ $newData['NnNoteTID'] = $dataHelper->getReferenceDetails($tid,$newData);
1325
+ }
1326
+ // save subscription informations in parent order
1327
+ $this->saveParentInfo($script, $parentOrderNo);
1328
+
1329
+ $payment->setTransactionId($tid)
1330
+ ->setAdditionalData(serialize($newData))
1331
+ ->setAdditionalInformation($additionalInfo)
1332
+ ->setLastTransId($tid)
1333
+ ->setParentTransactionId(null)
1334
+ ->save();
1335
+ $ordernew->sendNewOrderEmail()
1336
+ ->setEmailSent(true)
1337
+ ->setPayment($payment)
1338
+ ->save();
1339
+ $this->insertOrderId($newOrderId,$profileId);
1340
+ $getTransactionStatus = $paymentObj->doNovalnetStatusCall($tid,$payment);
1341
+ if ($ordernew->canInvoice() && $getTransactionStatus->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
1342
+ && $paymentCode != Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
1343
+ $invoice = $ordernew->prepareInvoice();
1344
+ $invoice->setTransactionId($tid);
1345
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
1346
+ ->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID)
1347
+ ->register();
1348
+
1349
+ Mage::getModel('core/resource_transaction')
1350
+ ->addObject($invoice)
1351
+ ->addObject($invoice->getOrder())
1352
+ ->save();
1353
+
1354
+ $magentoVersion = $this->_getNovalnetHelper()->getMagentoVersion();
1355
+ $transMode = (version_compare($magentoVersion, '1.6', '<'))
1356
+ ? false : true;
1357
+
1358
+ $payment->setTransactionId($tid)
1359
+ ->setIsTransactionClosed($transMode);
1360
+ }
1361
+ $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
1362
+ $transaction->setParentTxnId(null)
1363
+ ->save();
1364
+ $this->updateInventory($order);
1365
+ }
1366
+
1367
+ /**
1368
+ * Save the subscription details in parent order
1369
+ *
1370
+ * @param string $script
1371
+ * @param int $orderNo
1372
+ * @return null
1373
+ */
1374
+ private function saveParentInfo($script, $orderNo) {
1375
+ $parentOrder = $this->getOrderByIncrementId($orderNo);
1376
+ $getayment = $parentOrder->getPayment();
1377
+ $additionalData = $getresponseData = unserialize($getayment->getAdditionalData());
1378
+ $additionalData['NnComments'] = empty($additionalData['NnComments']) ? $script : $additionalData['NnComments'] . '<br><br>' . $script;
1379
+ $getayment->setAdditionalData(serialize($additionalData));
1380
+ $parentOrder->setPayment($getayment)->save();
1381
+ }
1382
+
1383
+ /**
1384
+ * Set billing and sipping address informations
1385
+ *
1386
+ * @param varien_object $getBillingAddress
1387
+ * @param varien_object $billingAddress
1388
+ * @param varien_object $ordernew
1389
+ * @param varien_object $order
1390
+ * @return mixed
1391
+ */
1392
+ private function setBillingShippingAddress($getBillingAddress,$billingAddress,$ordernew,$order)
1393
+ {
1394
+ $addressType = $getBillingAddress->getAddressType();
1395
+ $prefix = $getBillingAddress->getPrefix();
1396
+ $firstName = $getBillingAddress->getFirstname();
1397
+ $lastName = $getBillingAddress->getLastname();
1398
+ $middlename = $getBillingAddress->getMiddlename();
1399
+ $company = $getBillingAddress->getCompany();
1400
+ $suffix = $getBillingAddress->getSuffix();
1401
+ $street = $getBillingAddress->getStreet();
1402
+
1403
+ if (isset($street[1])) {
1404
+ $street = array($street[0], $street[1]);
1405
+ } else {
1406
+ $street = array($street[0]);
1407
+ }
1408
+ $city = $getBillingAddress->getCity();
1409
+ $countryId = $getBillingAddress->getCountryId();
1410
+ $postCode = $getBillingAddress->getPostcode();
1411
+ $regionId = $getBillingAddress->getRegionId();
1412
+ $telephone = $getBillingAddress->getTelephone();
1413
+ $fax = $getBillingAddress->getFax();
1414
+ $vatId = $getBillingAddress->getVatId();
1415
+ $storeId = $order->getStoreId();
1416
+
1417
+ $billingAddress->setStoreId($storeId)
1418
+ ->setAddressType($addressType)
1419
+ ->setPrefix($prefix)
1420
+ ->setFirstname($firstName)
1421
+ ->setLastname($lastName)
1422
+ ->setMiddlename($middlename)
1423
+ ->setSuffix($suffix)
1424
+ ->setCompany($company)
1425
+ ->setStreet($street)
1426
+ ->setCity($city)
1427
+ ->setCountryId($countryId)
1428
+ ->setRegionId($regionId)
1429
+ ->setTelephone($telephone)
1430
+ ->setFax($fax)
1431
+ ->setVatId($vatId)
1432
+ ->setPostcode($postCode);
1433
+
1434
+ if ($addressType == Mage_Sales_Model_Quote_Address::TYPE_BILLING) {
1435
+ $ordernew->setBillingAddress($billingAddress);
1436
+ } else {
1437
+ $shippingMethod = $order->getShippingMethod();
1438
+ $shippingDescription = $order->getShippingDescription();
1439
+ $ordernew->setShippingAddress($billingAddress)
1440
+ ->setShippingMethod($shippingMethod)
1441
+ ->setShippingDescription($shippingDescription);
1442
+ }
1443
+ return $ordernew;
1444
+
1445
+ }
1446
+
1447
+ /**
1448
+ * Set order amount and customer informations
1449
+ *
1450
+ * @param varien_object $order
1451
+ * @param varien_object $ordernew
1452
+ * @return mixed
1453
+ */
1454
+ private function setOrderDetails($order,$ordernew)
1455
+ {
1456
+ $customerGroupId = $order->getCustomerGroupId();
1457
+ $globalCurrencyCode = $order->getGlobalCurrencyCode();
1458
+ $baseCurrencyCode = $order->getBaseCurrencyCode();
1459
+ $storeCurrencyCode = $order->getStoreCurrencyCode();
1460
+ $orderCurrencyCode = $order->getOrderCurrencyCode();
1461
+ $status = $order->getStatus();
1462
+ $state = $order->getState();
1463
+ $isVirtual = $order->getIsVirtual();
1464
+ $storeName = $order->getStoreName();
1465
+ $customerEmail = $order->getCustomerEmail();
1466
+ $customerFirstName = $order->getCustomerFirstname();
1467
+ $customerLastName = $order->getCustomerLastname();
1468
+ $customerId = $order->getCustomerId();
1469
+ $customerIsGuest = $order->getCustomerIsGuest();
1470
+ $shippingMethod = $order->getShippingMethod();
1471
+ $shippingDescription = $order->getShippingDescription();
1472
+ $subtotal = $order->getSubtotal();
1473
+ $baseSubtoal = $order->getBaseSubtotal();
1474
+ $subtotalInclTax = $order->getSubtotalInclTax();
1475
+ $baseSubtotalInclTax = $order->getBaseSubtotalInclTax();
1476
+ $totalQtyOrdered = $order->getTotalQtyOrdered();
1477
+ $shippingAmount = $order->getShippingAmount();
1478
+ $baseShippingAmount = $order->getBaseShippingAmount();
1479
+ $taxAmount = $order->getTaxAmount();
1480
+ $baseTaxAmount = $order->getBaseTaxAmount();
1481
+ $baseGrandTotal = $order->getBaseGrandTotal();
1482
+ $grandTotal = $order->getGrandTotal();
1483
+ $storeId = $order->getStoreId();
1484
+ $baseTaxAmount = $order->getBaseTaxAmount();
1485
+ $baseToGlobalRate = $order->getBaseToGlobalRate();
1486
+ $baseToOrderRate = $order->getBaseToOrderRate();
1487
+ $storeToBaseRate = $order->getStoreToBaseRate();
1488
+ $storeToOrderRate = $order->getStoreToOrderRate();
1489
+ $weight = $order->getWeight();
1490
+ $customerNoteNotify = $order->getCustomerNoteNotify();
1491
+
1492
+ $ordernew->setStoreId($storeId)
1493
+ ->setCustomerGroupId($customerGroupId)
1494
+ ->setQuoteId(0)
1495
+ ->setIsVirtual($isVirtual)
1496
+ ->setGlobalCurrencyCode($globalCurrencyCode)
1497
+ ->setBaseCurrencyCode($baseCurrencyCode)
1498
+ ->setStoreCurrencyCode($storeCurrencyCode)
1499
+ ->setOrderCurrencyCode($orderCurrencyCode)
1500
+ ->setStoreName($storeName)
1501
+ ->setCustomerEmail($customerEmail)
1502
+ ->setCustomerFirstname($customerFirstName)
1503
+ ->setCustomerLastname($customerLastName)
1504
+ ->setCustomerId($customerId)
1505
+ ->setCustomerIsGuest($customerIsGuest)
1506
+ ->setState('processing')
1507
+ ->setStatus($status)
1508
+ ->setSubtotal($subtotal)
1509
+ ->setBaseSubtotal($baseSubtoal)
1510
+ ->setSubtotalInclTax($subtotalInclTax)
1511
+ ->setBaseSubtotalInclTax($baseSubtotalInclTax)
1512
+ ->setShippingAmount($shippingAmount)
1513
+ ->setBaseShippingAmount($baseShippingAmount)
1514
+ ->setGrandTotal($grandTotal)
1515
+ ->setBaseGrandTotal($baseGrandTotal)
1516
+ ->setTaxAmount($taxAmount)
1517
+ ->setTotalQtyOrdered($totalQtyOrdered)
1518
+ ->setBaseTaxAmount($baseTaxAmount)
1519
+ ->setBaseToGlobalRate($baseToGlobalRate)
1520
+ ->setBaseToOrderRate($baseToOrderRate)
1521
+ ->setStoreToBaseRate($storeToBaseRate)
1522
+ ->setStoreToOrderRate($storeToOrderRate)
1523
+ ->setWeight($weight)
1524
+ ->setCustomerNoteNotify($customerNoteNotify);
1525
+
1526
+ return $ordernew;
1527
+ }
1528
+
1529
+ /**
1530
+ * Set product informations (product, discount, tax, etc.,)
1531
+ *
1532
+ * @param varien_object $order
1533
+ * @param varien_object $ordernew
1534
+ * @return mixed
1535
+ */
1536
+ private function setOrderItemsDetails($order,$ordernew)
1537
+ {
1538
+ foreach ($order->getAllItems() as $orderValue) {
1539
+ $getItemProdutType = $orderValue->getProductType();
1540
+ $getProductId = $orderValue->getProductId();
1541
+ $getIsVirtual = $orderValue->getIsVirtual();
1542
+ $getItemStoreId = $orderValue->getStoreId();
1543
+ $getItemQtyOrdered = $orderValue->getQtyOrdered();
1544
+ $getItemName = $orderValue->getName();
1545
+ $getItemSku = $orderValue->getSku();
1546
+ $getItemWeight = $orderValue->getWeight();
1547
+ $getItemPrice = $orderValue->getPrice();
1548
+ $getItemBasePrice = $orderValue->getBasePrice();
1549
+ $getItemOrginalPrice = $orderValue->getOriginalPrice();
1550
+ $getItemRowTotal = $orderValue->getRowTotal();
1551
+ $getItemBaseRowTotal = $orderValue->getBaseRowTotal();
1552
+ $getItemTaxAmount = $orderValue->getTaxAmount();
1553
+ $getItemTaxPercent = $orderValue->getTaxPercent();
1554
+ $getItemDiscountAmount = $orderValue->getDiscountAmount();
1555
+ $getIsNominal = $orderValue->getIsNominal();
1556
+ $baseweeeTaxAppliedAmount = $orderValue->getBaseWeeeTaxAppliedAmount();
1557
+ $weeeTaxAppliedAmount = $orderValue->getWeeeTaxAppliedAmount();
1558
+ $weeeTaxAppliedRowAmount = $orderValue->getWeeeTaxAppliedRowAmount();
1559
+ $weeeTaxApplied = $orderValue->getWeeeTaxApplied();
1560
+ $weeeTaxDisposition = $orderValue->getWeeeTaxDisposition();
1561
+ $weeeTaxRowDisposition = $orderValue->getWeeeTaxRowDisposition();
1562
+ $baseWeeeTaxDisposition = $orderValue->getBaseWeeeTaxDisposition();
1563
+ $baseWeeeTaxRowDisposition = $orderValue->getBaseWeeeTaxRowDisposition();
1564
+ }
1565
+
1566
+ $orderItem = Mage::getModel('sales/order_item')
1567
+ ->setStoreId($getItemStoreId)
1568
+ ->setQuoteItemId(0)
1569
+ ->setQuoteParentItemId(NULL)
1570
+ ->setQtyBackordered(NULL)
1571
+ ->setQtyOrdered($getItemQtyOrdered)
1572
+ ->setName($getItemName)
1573
+ ->setIsVirtual($getIsVirtual)
1574
+ ->setProductId($getProductId)
1575
+ ->setProductType($getItemProdutType)
1576
+ ->setSku($getItemSku)
1577
+ ->setWeight($getItemWeight)
1578
+ ->setPrice($getItemPrice)
1579
+ ->setBasePrice($getItemBasePrice)
1580
+ ->setOriginalPrice($getItemOrginalPrice)
1581
+ ->setTaxAmount($getItemTaxAmount)
1582
+ ->setTaxPercent($getItemTaxPercent)
1583
+ ->setIsNominal($getIsNominal)
1584
+ ->setRowTotal($getItemRowTotal)
1585
+ ->setBaseRowTotal($getItemBaseRowTotal)
1586
+ ->setBaseWeeeTaxAppliedAmount($baseweeeTaxAppliedAmount)
1587
+ ->setWeeeTaxAppliedAmount($weeeTaxAppliedAmount)
1588
+ ->setWeeeTaxAppliedRowAmount($weeeTaxAppliedRowAmount)
1589
+ ->setWeeeTaxApplied($weeeTaxApplied)
1590
+ ->setWeeeTaxDisposition($weeeTaxDisposition)
1591
+ ->setWeeeTaxRowDisposition($weeeTaxRowDisposition)
1592
+ ->setBaseWeeeTaxDisposition($baseWeeeTaxDisposition)
1593
+ ->setBaseWeeeTaxRowDisposition($baseWeeeTaxRowDisposition);
1594
+ $ordernew->addItem($orderItem);
1595
+
1596
+ return $ordernew;
1597
+ }
1598
+
1599
+ /**
1600
+ * Set the language by storeid
1601
+ *
1602
+ * @param int $storeId
1603
+ */
1604
+ private function setLanguageStore($storeId)
1605
+ {
1606
+ $app = Mage::app();
1607
+ $app->setCurrentStore($storeId);
1608
+ $locale = Mage::getStoreConfig('general/locale/code', $storeId);
1609
+ $app->getLocale()->setLocaleCode($locale);
1610
+ Mage::getSingleton('core/translate')->setLocale($locale)->init('frontend', true);
1611
+ }
1612
+
1613
+ /**
1614
+ * Insert the order id in recurring order table
1615
+ *
1616
+ * @param int $newOrderId
1617
+ * @param int $profileId
1618
+ */
1619
+ private function insertOrderId($newOrderId,$profileId)
1620
+ {
1621
+ if ($newOrderId && $profileId) {
1622
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
1623
+ $connection->beginTransaction();
1624
+ $tablePrefix = Mage::getConfig()->getTablePrefix();
1625
+ $orderTable = $tablePrefix.'sales_recurring_profile_order';
1626
+ $fields = array();
1627
+ $fields['profile_id'] = $profileId;
1628
+ $fields['order_id'] = $newOrderId;
1629
+ $connection->insert($orderTable, $fields);
1630
+ $connection->commit();
1631
+ }
1632
+ }
1633
+
1634
+ /**
1635
+ * update the product inventory (stock)
1636
+ *
1637
+ * @param varien_object $order
1638
+ */
1639
+ private function updateInventory($order)
1640
+ {
1641
+ foreach($order->getAllItems() as $orderValue)
1642
+ {
1643
+ $itemsQtyOrdered = floor($orderValue->getQtyOrdered());
1644
+ $productId = $orderValue->getProductId();
1645
+ break;
1646
+ }
1647
+
1648
+ if ($productId) {
1649
+ $stockObj = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
1650
+ $productQtyBefore = (int)$stockObj->getQty();
1651
+ }
1652
+
1653
+ if (isset($productQtyBefore) && $productQtyBefore > 0) {
1654
+ $productQtyAfter = (int)($productQtyBefore - $itemsQtyOrdered);
1655
+ $stockData['qty'] = $productQtyAfter;
1656
+ $stockObj->setQty($productQtyAfter);
1657
+ $stockObj->save();
1658
+ }
1659
+ }
1660
+
1661
  }
app/code/community/Novalnet/Payment/Model/Config.php CHANGED
@@ -40,12 +40,10 @@ class Novalnet_Payment_Model_Config
40
  const GATEWAY_ERROR_RETURN_URL = 'novalnet_payment/gateway/error';
41
  const PAYPORT_URL = '://payport.novalnet.de/paygate.jsp';
42
  const INFO_REQUEST_URL = '://payport.novalnet.de/nn_infoport.xml';
43
- const CC_URL = '://payport.novalnet.de/direct_form.jsp';
44
- const SEPA_URL = '://payport.novalnet.de/direct_form_sepa.jsp';
45
  const INVOICE_PAYMENT_METHOD = 'Invoice';
46
  const PREPAYMENT_PAYMENT_METHOD = 'Prepayment';
47
- const NOVALTEL_STATUS = 'NOVALTEL_STATUS';
48
  const TRANS_STATUS = 'TRANSACTION_STATUS';
 
49
  const TRANSMIT_PIN_AGAIN = 'TRANSMIT_PIN_AGAIN';
50
  const REPLY_EMAIL_STATUS = 'REPLY_EMAIL_STATUS';
51
  const PIN_STATUS = 'PIN_STATUS';
@@ -56,18 +54,26 @@ class Novalnet_Payment_Model_Config
56
 
57
  static protected $_instance;
58
  protected $_novalnetPaymentKey = array('novalnetCc' => 6, 'novalnetInvoice' => 27,
59
- 'novalnetPrepayment' => 27, 'novalnetPaypal' => 34,
60
- 'novalnetSofortueberweisung' => 33, 'novalnetIdeal' => 49, 'novalnetSepa' => 37);
 
 
 
 
 
 
 
61
  protected $_redirectPayportUrl = array('novalnetPaypal' => '://payport.novalnet.de/paypal_payport',
62
- 'novalnetSofortueberweisung' => '://payport.novalnet.de/online_transfer_payport',
63
- 'novalnetIdeal' => '://payport.novalnet.de/online_transfer_payport',
64
  'novalnetCc' => '://payport.novalnet.de/global_pci_payport');
65
- protected $_novalnetPaymentMethods = array('novalnetCc' => 'Novalnet Credit Card', 'novalnetInvoice' => 'Novalnet Invoice',
66
- 'novalnetPrepayment' => 'Novalnet Prepayment', 'novalnetPaypal' => 'Novalnet PayPal', 'novalnetSofortueberweisung' => 'Novalnet Instant Bank Transfer', 'novalnetIdeal' => 'Novalnet iDEAL', 'novalnetSepa' => 'Novalnet Direct Debit SEPA');
67
- protected $_callbackAllowed = array('AT', 'DE', 'CH');
 
 
 
68
  protected $_paymentOnholdStaus = array('91', '98', '99');
69
- protected $_redirectPayments = array('novalnetPaypal', 'novalnetSofortueberweisung',
70
- 'novalnetIdeal');
71
  protected $_novalnetEncodeParams = array('auth_code', 'product', 'tariff', 'test_mode',
72
  'uniqid', 'amount');
73
  protected $_novalnetHashParams = array('auth_code', 'product', 'tariff', 'amount',
@@ -77,6 +83,7 @@ class Novalnet_Payment_Model_Config
77
  /* ******************************************** */
78
  /* NOVALNET CC PARAMS */
79
  /* ******************************************* */
 
80
  const NN_CC = 'novalnetCc';
81
  const NN_CC_CAN_CAPTURE = true;
82
  const NN_CC_CAN_USE_INTERNAL = true;
@@ -94,12 +101,13 @@ class Novalnet_Payment_Model_Config
94
  const NN_SEPA_FORM_BLOCK = 'novalnet_payment/payment_method_form_Sepa';
95
  const NN_SEPA_INFO_BLOCK = 'novalnet_payment/payment_method_info_Sepa';
96
 
 
97
  /* ******************************************** */
98
  /* NOVALNET INVOICE PARAMS */
99
  /* ******************************************* */
100
  const NN_INVOICE = 'novalnetInvoice';
101
  const NN_INVOICE_CAN_CAPTURE = true;
102
- const NN_INVOICE_CAN_USE_MULTISHIPPING = true;
103
  const NN_INVOICE_FORM_BLOCK = 'novalnet_payment/payment_method_form_Invoice';
104
  const NN_INVOICE_INFO_BLOCK = 'novalnet_payment/payment_method_info_Invoice';
105
 
@@ -108,7 +116,7 @@ class Novalnet_Payment_Model_Config
108
  /* ******************************************* */
109
  const NN_PREPAYMENT = 'novalnetPrepayment';
110
  const NN_PREPAYMENT_CAN_CAPTURE = true;
111
- const NN_PREPAYMENT_CAN_USE_MULTISHIPPING = true;
112
  const NN_PREPAYMENT_FORM_BLOCK = 'novalnet_payment/payment_method_form_Prepayment';
113
  const NN_PREPAYMENT_INFO_BLOCK = 'novalnet_payment/payment_method_info_Prepayment';
114
 
@@ -118,10 +126,18 @@ class Novalnet_Payment_Model_Config
118
  const NN_IDEAL = 'novalnetIdeal';
119
  const NN_IDEAL_CAN_CAPTURE = true;
120
  const NN_IDEAL_CAN_USE_INTERNAL = false;
121
- const NN_IDEAL_CAN_REFUND = false;
122
  const NN_IDEAL_CAN_USE_MULTISHIPPING = false;
123
  const NN_IDEAL_FORM_BLOCK = 'novalnet_payment/payment_method_form_Ideal';
124
  const NN_IDEAL_INFO_BLOCK = 'novalnet_payment/payment_method_info_Ideal';
 
 
 
 
 
 
 
 
 
125
 
126
  /* ******************************************** */
127
  /* NOVALNET PAYPAL PARAMS */
@@ -129,7 +145,6 @@ class Novalnet_Payment_Model_Config
129
  const NN_PAYPAL = 'novalnetPaypal';
130
  const NN_PAYPAL_CAN_CAPTURE = true;
131
  const NN_PAYPAL_CAN_USE_INTERNAL = false;
132
- const NN_PAYPAL_CAN_REFUND = false;
133
  const NN_PAYPAL_CAN_USE_MULTISHIPPING = false;
134
  const NN_PAYPAL_FORM_BLOCK = 'novalnet_payment/payment_method_form_Paypal';
135
  const NN_PAYPAL_INFO_BLOCK = 'novalnet_payment/payment_method_info_Paypal';
@@ -137,13 +152,12 @@ class Novalnet_Payment_Model_Config
137
  /* ******************************************** */
138
  /* NOVALNET SOFORT PARAMS */
139
  /* ******************************************* */
140
- const NN_SOFORT = 'novalnetSofortueberweisung';
141
  const NN_SOFORT_CAN_CAPTURE = true;
142
  const NN_SOFORT_CAN_USE_INTERNAL = false;
143
- const NN_SOFORT_CAN_REFUND = false;
144
  const NN_SOFORT_CAN_USE_MULTISHIPPING = false;
145
- const NN_SOFORT_FORM_BLOCK = 'novalnet_payment/payment_method_form_Sofortueberweisung';
146
- const NN_SOFORT_INFO_BLOCK = 'novalnet_payment/payment_method_info_Sofortueberweisung';
147
 
148
  /* ******************************************** */
149
  /* NOVALNET ABSTRACT FUNCTIONS */
@@ -161,5 +175,4 @@ class Novalnet_Payment_Model_Config
161
  {
162
  return $this->{'_' . $key};
163
  }
164
-
165
  }
40
  const GATEWAY_ERROR_RETURN_URL = 'novalnet_payment/gateway/error';
41
  const PAYPORT_URL = '://payport.novalnet.de/paygate.jsp';
42
  const INFO_REQUEST_URL = '://payport.novalnet.de/nn_infoport.xml';
 
 
43
  const INVOICE_PAYMENT_METHOD = 'Invoice';
44
  const PREPAYMENT_PAYMENT_METHOD = 'Prepayment';
 
45
  const TRANS_STATUS = 'TRANSACTION_STATUS';
46
+ const SUBS_PAUSE = 'SUBSCRIPTION_PAUSE';
47
  const TRANSMIT_PIN_AGAIN = 'TRANSMIT_PIN_AGAIN';
48
  const REPLY_EMAIL_STATUS = 'REPLY_EMAIL_STATUS';
49
  const PIN_STATUS = 'PIN_STATUS';
54
 
55
  static protected $_instance;
56
  protected $_novalnetPaymentKey = array('novalnetCc' => 6, 'novalnetInvoice' => 27,
57
+ 'novalnetPrepayment' => 27, 'novalnetPaypal' => 34, 'novalnetBanktransfer' => 33,
58
+ 'novalnetIdeal' => 49, 'novalnetEps' => 50, 'novalnetSepa' => 37);
59
+ protected $_novalnetPaymentMethods = array('novalnetCc' => 'Novalnet Credit Card', 'novalnetInvoice' => 'Novalnet Invoice',
60
+ 'novalnetPrepayment' => 'Novalnet Prepayment',
61
+ 'novalnetPaypal' => 'Novalnet PayPal', 'novalnetBanktransfer' => 'Novalnet Instant Bank Transfer',
62
+ 'novalnetIdeal' => 'Novalnet iDEAL', 'novalnetEps' => 'Novalnet Eps', 'novalnetSepa' => 'Novalnet Direct Debit SEPA');
63
+ protected $_novalnetPaymentTypes = array('novalnetCc' => 'CREDITCARD', 'novalnetInvoice' => 'INVOICE',
64
+ 'novalnetPrepayment' => 'PREPAYMENT', 'novalnetPaypal' => 'PAYPAL', 'novalnetBanktransfer' => 'ONLINE_TRANSFER',
65
+ 'novalnetIdeal' => 'IDEAL', 'novalnetEps' => 'EPS', 'novalnetSepa' => 'DIRECT_DEBIT_SEPA');
66
  protected $_redirectPayportUrl = array('novalnetPaypal' => '://payport.novalnet.de/paypal_payport',
67
+ 'novalnetBanktransfer' => '://payport.novalnet.de/online_transfer_payport',
68
+ 'novalnetIdeal' => '://payport.novalnet.de/online_transfer_payport', 'novalnetEps' => '://payport.novalnet.de/eps_payport',
69
  'novalnetCc' => '://payport.novalnet.de/global_pci_payport');
70
+ protected $_redirectPayments = array('novalnetPaypal', 'novalnetBanktransfer',
71
+ 'novalnetIdeal', 'novalnetEps');
72
+ protected $_subscriptionPayments = array('novalnetCc', 'novalnetSepa',
73
+ 'novalnetPrepayment', 'novalnetInvoice');
74
+ protected $_setonholdPayments = array('novalnetCc', 'novalnetSepa', 'novalnetInvoice');
75
+ protected $_callbackAllowedCountry = array('AT', 'DE', 'CH');
76
  protected $_paymentOnholdStaus = array('91', '98', '99');
 
 
77
  protected $_novalnetEncodeParams = array('auth_code', 'product', 'tariff', 'test_mode',
78
  'uniqid', 'amount');
79
  protected $_novalnetHashParams = array('auth_code', 'product', 'tariff', 'amount',
83
  /* ******************************************** */
84
  /* NOVALNET CC PARAMS */
85
  /* ******************************************* */
86
+
87
  const NN_CC = 'novalnetCc';
88
  const NN_CC_CAN_CAPTURE = true;
89
  const NN_CC_CAN_USE_INTERNAL = true;
101
  const NN_SEPA_FORM_BLOCK = 'novalnet_payment/payment_method_form_Sepa';
102
  const NN_SEPA_INFO_BLOCK = 'novalnet_payment/payment_method_info_Sepa';
103
 
104
+
105
  /* ******************************************** */
106
  /* NOVALNET INVOICE PARAMS */
107
  /* ******************************************* */
108
  const NN_INVOICE = 'novalnetInvoice';
109
  const NN_INVOICE_CAN_CAPTURE = true;
110
+ const NN_INVOICE_CAN_USE_MULTISHIPPING = false;
111
  const NN_INVOICE_FORM_BLOCK = 'novalnet_payment/payment_method_form_Invoice';
112
  const NN_INVOICE_INFO_BLOCK = 'novalnet_payment/payment_method_info_Invoice';
113
 
116
  /* ******************************************* */
117
  const NN_PREPAYMENT = 'novalnetPrepayment';
118
  const NN_PREPAYMENT_CAN_CAPTURE = true;
119
+ const NN_PREPAYMENT_CAN_USE_MULTISHIPPING = false;
120
  const NN_PREPAYMENT_FORM_BLOCK = 'novalnet_payment/payment_method_form_Prepayment';
121
  const NN_PREPAYMENT_INFO_BLOCK = 'novalnet_payment/payment_method_info_Prepayment';
122
 
126
  const NN_IDEAL = 'novalnetIdeal';
127
  const NN_IDEAL_CAN_CAPTURE = true;
128
  const NN_IDEAL_CAN_USE_INTERNAL = false;
 
129
  const NN_IDEAL_CAN_USE_MULTISHIPPING = false;
130
  const NN_IDEAL_FORM_BLOCK = 'novalnet_payment/payment_method_form_Ideal';
131
  const NN_IDEAL_INFO_BLOCK = 'novalnet_payment/payment_method_info_Ideal';
132
+ /* ******************************************** */
133
+ /* NOVALNET EPS PARAMS */
134
+ /* ******************************************* */
135
+ const NN_EPS = 'novalnetEps';
136
+ const NN_EPS_CAN_CAPTURE = true;
137
+ const NN_EPS_CAN_USE_INTERNAL = false;
138
+ const NN_EPS_CAN_USE_MULTISHIPPING = false;
139
+ const NN_EPS_FORM_BLOCK = 'novalnet_payment/payment_method_form_Eps';
140
+ const NN_EPS_INFO_BLOCK = 'novalnet_payment/payment_method_info_Eps';
141
 
142
  /* ******************************************** */
143
  /* NOVALNET PAYPAL PARAMS */
145
  const NN_PAYPAL = 'novalnetPaypal';
146
  const NN_PAYPAL_CAN_CAPTURE = true;
147
  const NN_PAYPAL_CAN_USE_INTERNAL = false;
 
148
  const NN_PAYPAL_CAN_USE_MULTISHIPPING = false;
149
  const NN_PAYPAL_FORM_BLOCK = 'novalnet_payment/payment_method_form_Paypal';
150
  const NN_PAYPAL_INFO_BLOCK = 'novalnet_payment/payment_method_info_Paypal';
152
  /* ******************************************** */
153
  /* NOVALNET SOFORT PARAMS */
154
  /* ******************************************* */
155
+ const NN_SOFORT = 'novalnetBanktransfer';
156
  const NN_SOFORT_CAN_CAPTURE = true;
157
  const NN_SOFORT_CAN_USE_INTERNAL = false;
 
158
  const NN_SOFORT_CAN_USE_MULTISHIPPING = false;
159
+ const NN_SOFORT_FORM_BLOCK = 'novalnet_payment/payment_method_form_Banktransfer';
160
+ const NN_SOFORT_INFO_BLOCK = 'novalnet_payment/payment_method_info_Banktransfer';
161
 
162
  /* ******************************************** */
163
  /* NOVALNET ABSTRACT FUNCTIONS */
175
  {
176
  return $this->{'_' . $key};
177
  }
 
178
  }
app/code/community/Novalnet/Payment/Model/Factory.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Factory
27
+ {
28
+ /**
29
+ * Save capture response
30
+ *
31
+ * @param float $amount
32
+ * @param varien_object $loadTransStatus
33
+ * @param int $transStatus
34
+ * @param varien_object $payment
35
+ * @param int $lastTranId
36
+ */
37
+ public function captureResponseSave($amount, $loadTransStatus, $transStatus, $payment, $lastTranId)
38
+ {
39
+ if ($amount != '') {
40
+ $loadTransStatus->setTransactionStatus(Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED)
41
+ ->setAmount($amount)
42
+ ->save();
43
+ } else {
44
+ $loadTransStatus->setTransactionStatus(Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED)
45
+ ->save();
46
+ }
47
+
48
+ $magentoVersion = Mage::helper('novalnet_payment')->getMagentoVersion();
49
+ // make capture transaction open for lower versions to make refund
50
+ if (version_compare($magentoVersion, '1.6', '<')) {
51
+ $payment->setIsTransactionClosed(false)
52
+ ->save();
53
+ }
54
+
55
+ if ($transStatus != Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
56
+
57
+ $transMode = (version_compare($magentoVersion, '1.6', '<')) ? false : true;
58
+ $payment->setTransactionId($lastTranId)
59
+ ->setIsTransactionClosed($transMode);
60
+ $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
61
+ $transaction->setParentTxnId(null)
62
+ ->save();
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Call Transation status refund and void
68
+ *
69
+ * @param Mage_Checkout_Model_Session $helper
70
+ * @param int $getTid
71
+ * @param varien_object $payment
72
+ * @param int $amountAfterRefund
73
+ * @param string $call
74
+ * @param int $refundTid
75
+ * @param int $customerId
76
+ * @param array $response
77
+ * @return mixed
78
+ */
79
+ public function callTransactionStatus($helper, $getTid, $payment, $amountAfterRefund, $call, $refundTid
80
+ = NULL, $customerId = NULL, $response = NULL)
81
+ {
82
+ $paymentObj = $payment->getMethodInstance();
83
+ $getTransactionStatus = $paymentObj->doNovalnetStatusCall($getTid, $payment, Novalnet_Payment_Model_Config::TRANS_STATUS, NULL, NULL);
84
+ $amount = $helper->getFormatedAmount($getTransactionStatus->getAmount(), 'RAW');
85
+ if ($call == 1) {
86
+ $loadTransaction = $helper->loadTransactionStatus($getTid);
87
+ $loadTransaction->setTransactionStatus($getTransactionStatus->getStatus())
88
+ ->setAmount($amount)
89
+ ->save();
90
+ if (in_array($paymentObj->getCode(), array(Novalnet_Payment_Model_Config::NN_INVOICE,
91
+ Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
92
+ $loadTransaction->setAmount($amountAfterRefund)
93
+ ->save();
94
+ }
95
+ } else {
96
+ if ($refundTid) { // Only log the novalnet transaction which contains TID
97
+ $response->setStatus($getTransactionStatus->getStatus());
98
+ $paymentObj->logNovalnetStatusData($response, $refundTid, $customerId, NULL, $amount);
99
+ }
100
+ }
101
+ return $getTransactionStatus;
102
+ }
103
+
104
+ /**
105
+ * Check Magento version refund progress save
106
+ *
107
+ * @param Mage_Checkout_Model_Session $helper
108
+ * @param varien_object $payment
109
+ * @param int $refundTid
110
+ * @param array $data
111
+ */
112
+ public function refundValidateProcess($helper, $payment, $refundTid,$data)
113
+ {
114
+ // make capture transaction open for lower versions to make refund
115
+ if (version_compare($helper->getMagentoVersion(), '1.6', '<')) {
116
+ $order = $payment->getOrder();
117
+ $canRefundMore = $order->canCreditmemo();
118
+
119
+ $payment->setTransactionId($refundTid)
120
+ ->setLastTransId($refundTid)
121
+ ->setAdditionalData(serialize($data))
122
+ ->setIsTransactionClosed(1) // refund initiated by merchant
123
+ ->setShouldCloseParentTransaction(!$canRefundMore)
124
+ ->save();
125
+ } else {
126
+ $payment->setTransactionId($refundTid)
127
+ ->setLastTransId($refundTid)
128
+ ->setAdditionalData(serialize($data))
129
+ ->save();
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Set RequestParams Form
135
+ *
136
+ * @param varien_object $request
137
+ * @param varien_object $infoObject
138
+ * @param int $orderId
139
+ * @param int $amount
140
+ * @param Mage_Checkout_Model_Session $helper
141
+ * @param int $livemode
142
+ */
143
+ public function requestParams($request, $infoObject, $orderId, $amount, $helper, $livemode)
144
+ {
145
+ $billing = $infoObject->getBillingAddress();
146
+ $request->setTestMode($livemode)
147
+ ->setAmount($amount)
148
+ ->setCurrency($infoObject->getBaseCurrencyCode())
149
+ ->setCustomerNo($helper->getCustomerId())
150
+ ->setUseUtf8(1)
151
+ ->setFirstName($billing->getFirstname())
152
+ ->setLastName($billing->getLastname())
153
+ ->setSearchInStreet(1)
154
+ ->setStreet(implode(',', $billing->getStreet()))
155
+ ->setCity($billing->getCity())
156
+ ->setZip($billing->getPostcode())
157
+ ->setCountry($billing->getCountry())
158
+ ->setLanguage(strtoupper($helper->getDefaultLanguage()))
159
+ ->setLang(strtoupper($helper->getDefaultLanguage()))
160
+ ->setTel($billing->getTelephone())
161
+ ->setFax($billing->getFax())
162
+ ->setRemoteIp($helper->getRealIpAddr())
163
+ ->setGender('u')
164
+ ->setEmail($infoObject->getCustomerEmail())
165
+ ->setOrderNo($orderId)
166
+ ->setSystemUrl(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB))
167
+ ->setSystemIp($helper->getServerAddr())
168
+ ->setSystemName('Magento')
169
+ ->setSystemVersion($helper->getMagentoVersion() . '-' . $helper->getNovalnetVersion())
170
+ ->setInput1('order_id')
171
+ ->setInputval1($orderId);
172
+ }
173
+
174
+ /**
175
+ * Set Request profile params
176
+ *
177
+ * @param varien_object $request
178
+ * @param Novalnet_Payment_Helper_Data $helper
179
+ */
180
+ public function requestProfileParams($request, $helper)
181
+ {
182
+ $profileInfo = $helper->getProfileInfodata();
183
+ $periodUnit = $profileInfo[1];
184
+ $periodFrequency = $profileInfo[0];
185
+ $regularAmount = $helper->getFormatedAmount($helper->getCheckoutSession()->getNnRegularAmount());
186
+ $day = $helper->__('Day');
187
+ $month = $helper->__('Month');
188
+ $year = $helper->__('Year');
189
+ $week = $helper->__('Week');
190
+ $two = $helper->__('Two');
191
+
192
+ $periodUnitFormat = array($day => "d", $month => "m", $year => "y");
193
+
194
+ if ($periodUnit == $two || $periodUnit == 'Two') {
195
+ $tariffPeriod2 = "14d";
196
+ } else if ($periodUnit == $week || $periodUnit == 'Week') {
197
+ $tariffPeriod2 = ($periodFrequency * 7) . "d";
198
+ } else {
199
+ $tariffPeriod2 = $periodFrequency . $periodUnitFormat[$periodUnit];
200
+ }
201
+
202
+ $request->setTariffPeriod($tariffPeriod2)
203
+ ->setTariffPeriod2($tariffPeriod2)
204
+ ->setTariffPeriod2Amount($regularAmount);
205
+
206
+ }
207
+
208
+ /**
209
+ * Save Profile Active State
210
+ *
211
+ * @param int $lastTransId
212
+ */
213
+ public function saveProfileState($lastTransId)
214
+ {
215
+ $recurringProfileId = Mage::getModel('sales/recurring_profile')->load($lastTransId, 'reference_id');
216
+ if ($recurringProfileId->getState() != 'canceled') {
217
+ $recurringProfileId->setState('active');
218
+ $recurringProfileId->save();
219
+ }
220
+ }
221
+
222
+ /**
223
+ * Set recurring profile state as canceled
224
+ *
225
+ * @param int $lastTransId
226
+ */
227
+ public function saveProfileCancelState($lastTransId)
228
+ {
229
+ $count = $this->recurringCollection($lastTransId);
230
+ if ($count) {
231
+ $recurringProfileId = Mage::getModel('sales/recurring_profile')->load($lastTransId, 'reference_id');
232
+ $recurringProfileId->setState('canceled');
233
+ $recurringProfileId->save();
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Set reference id for recurring profile
239
+ *
240
+ * @param int $lastTransId
241
+ * @param int $tid
242
+ */
243
+ public function saveProfileTID($lastTransId,$tid)
244
+ {
245
+ $count = $this->recurringCollection($lastTransId);
246
+ if ($count) {
247
+ $recurringProfileId = Mage::getModel('sales/recurring_profile')->load($lastTransId, 'reference_id');
248
+ $recurringProfileId->setReferenceId($tid);
249
+ $recurringProfileId->save();
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Save Profile Cancel State
255
+ *
256
+ * @param int $lastTransId
257
+ * @return int
258
+ */
259
+ private function recurringCollection($lastTransId)
260
+ {
261
+ $recurringCollection = Mage::getModel('sales/recurring_profile')->getCollection()
262
+ ->addFieldToFilter('reference_id', $lastTransId)
263
+ ->addFieldToSelect('reference_id');
264
+ $countRecurring = count($recurringCollection);
265
+ return $countRecurring;
266
+ }
267
+
268
+
269
+
270
+ /**
271
+ * Request Types Capture,Refund and void
272
+ *
273
+ * @param varien_object $request
274
+ * @param string $requestType
275
+ * @param Novalnet_Payment_Helper_Data $helper
276
+ * @param int $getTid
277
+ * @param int $refundAmount
278
+ */
279
+ public function requestTypes($request, $requestType, $helper, $getTid, $refundAmount
280
+ = NULL)
281
+ {
282
+ $setStatus = ($requestType == 'capture') ? Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
283
+ : Novalnet_Payment_Model_Config::PAYMENT_VOID_STATUS;
284
+
285
+ if ($requestType == 'void' || $requestType == 'capture') {
286
+ $request->setTid($helper->makeValidNumber($getTid))
287
+ ->setStatus($setStatus)
288
+ ->setEditStatus(true);
289
+ } else {
290
+ $request->setTid($helper->makeValidNumber($getTid))
291
+ ->setRefundRequest(true)
292
+ ->setRefundParam($refundAmount);
293
+ $this->refundAdditionalParam($request);
294
+ }
295
+ }
296
+
297
+ /**
298
+ * Add additonal params for refund process
299
+ *
300
+ * @param varien_object $request
301
+ */
302
+ private function refundAdditionalParam($request)
303
+ {
304
+ $getParamRequest = Mage::app()->getRequest();
305
+ $helper = Mage::helper('novalnet_payment');
306
+ $refundAccountholder = $getParamRequest->getParam('refund_payment_type_accountholder');
307
+ $refundIban = $getParamRequest->getParam('refund_payment_type_iban');
308
+ $refundBic = $getParamRequest->getParam('refund_payment_type_bic');
309
+ $refundRef = $getParamRequest->getParam('nn_refund_ref');
310
+
311
+ if ($refundIban !='' && $refundBic == '') {
312
+ Mage::throwException($helper->__('Please enter valid account details'));
313
+ } else if ($refundIban =='' && $refundBic != '') {
314
+ Mage::throwException($helper->__('Please enter valid account details'));
315
+ } else if ($refundRef && !$helper->checkIsValid($refundRef)) {
316
+ Mage::throwException($helper->__('Please enter valid account details'));
317
+ }
318
+
319
+ if ($refundRef != NULL) {
320
+ $request->setRefundRef($refundRef);
321
+ }
322
+
323
+ if ($refundIban !='' && $refundBic != '') {
324
+ $request->setAccountHolder($refundAccountholder)
325
+ ->setIban($refundIban)
326
+ ->setBic($refundBic);
327
+ }
328
+ }
329
+
330
+ /**
331
+ * get last successful payment method
332
+ *
333
+ * @param int $customerId
334
+ * @param Mage_Checkout_Model_Session $checkoutSession
335
+ */
336
+ public function getlastSuccesOrderMethod($customerId,$checkoutSession)
337
+ {
338
+ $table_prefix = Mage::getConfig()->getTablePrefix();
339
+ $order_table = $table_prefix.'sales_flat_order';
340
+ $on_condition = "main_table.parent_id = $order_table.entity_id";
341
+ $orderCollection = Mage::getModel('sales/order_payment')->getCollection()
342
+ ->addAttributeToSort('created_at', 'DESC')
343
+ ->addFieldToFilter('customer_id', $customerId)
344
+ ->addFieldToFilter('method',array('like' => '%novalnet%'))
345
+ ->addFieldToSelect('method')
346
+ ->setPageSize(1);
347
+ $orderCollection->getSelect()->join($order_table,$on_condition);
348
+ $count = $orderCollection->count();
349
+ if ($count > 0) {
350
+ foreach($orderCollection as $order):
351
+ $paymentMethod = $order->getMethod();
352
+ endforeach;
353
+ $checkoutSession->getQuote()->getPayment()->setMethod($paymentMethod);
354
+ }
355
+ }
356
+
357
+ /**
358
+ * Verify the final amount for the transaction id
359
+ *
360
+ * @param string $currency
361
+ * @param int $getTid
362
+ * @param varien_object $payment
363
+ * @param Novalnet_Payment_Helper_Data $helper
364
+ * @param int $refundAmount
365
+ * @return int
366
+ */
367
+ public function checkNovalnetCardAmount($currency, $getTid, $payment, $helper, $refundAmount)
368
+ {
369
+ $paymentObj = $payment->getMethodInstance();
370
+ $statusCallSub = $paymentObj->doNovalnetStatusCall($getTid,$payment);
371
+ $respnseCode = $statusCallSub->getStatus();
372
+ $cardAmount = $statusCallSub->getAmount();
373
+
374
+ if($respnseCode == 100 && $refundAmount > $cardAmount) {
375
+ Mage::throwException($helper->__('Refund amount greater than Novalnet card Amount, amount in card') . ' '. $currency . $helper->getFormatedAmount($cardAmount, 'RAW'));
376
+ }
377
+ return $cardAmount;
378
+ }
379
+
380
+ /**
381
+ * Build the refund details for reference
382
+ *
383
+ * @param int $refAmount
384
+ * @param array $data
385
+ * @param int $refundTid
386
+ * @param int $getTid
387
+ * @return array
388
+ */
389
+ public function refundTidData($refAmount,$data,$refundTid,$getTid)
390
+ {
391
+ if (!isset($data['refunded_tid'])) {
392
+ $refundedTid = array('refunded_tid'=> array($refundTid => array('reftid' => $refundTid , 'refamount' => $refAmount , 'reqtid' => $getTid)));
393
+ $data = array_merge($data, $refundedTid);
394
+ } else {
395
+ $data['refunded_tid'][$refundTid]['reftid'] = $refundTid;
396
+ $data['refunded_tid'][$refundTid]['refamount'] = $refAmount;
397
+ $data['refunded_tid'][$refundTid]['reqtid'] = $getTid;
398
+ }
399
+ return $data;
400
+ }
401
+ }
app/code/community/Novalnet/Payment/Model/Ipn.php ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Ipn
27
+ {
28
+ /**
29
+ * Default log filename
30
+ *
31
+ * @var string
32
+ */
33
+ const DEFAULT_LOG_FILE = 'novalnet_recurring_unknown_ipn.log';
34
+
35
+ /**
36
+ * Store order instance
37
+ *
38
+ * @var Mage_Sales_Model_Order
39
+ */
40
+ protected $_order = null;
41
+
42
+ /*
43
+ * Recurring profile instance
44
+ *
45
+ * @var Mage_Sales_Model_Recurring_Profile
46
+ */
47
+ protected $_recurringProfile = null;
48
+
49
+ /**
50
+ * IPN request data
51
+ *
52
+ * @var array
53
+ */
54
+ protected $_request = array();
55
+
56
+ /**
57
+ * Check the debug is enable
58
+ *
59
+ * @var array
60
+ */
61
+ protected $_debug = false;
62
+
63
+ /**
64
+ * Show the debug
65
+ *
66
+ * @var array
67
+ */
68
+ protected $_showdebug = false;
69
+
70
+ /**
71
+ * Collected debug information
72
+ *
73
+ * @var array
74
+ */
75
+ protected $_debugData = array();
76
+
77
+ /**
78
+ * IPN request data getter
79
+ *
80
+ * @param string $key
81
+ * @return array|string
82
+ */
83
+ public function getRequestData($key = null)
84
+ {
85
+ if (null === $key) {
86
+ return $this->_request;
87
+ }
88
+ return isset($this->_request[$key]) ? $this->_request[$key] : null;
89
+ }
90
+
91
+ /**
92
+ * Process recurring profile request
93
+ *
94
+ * @param array $request
95
+ * @param Zend_Http_Client_Adapter_Interface $httpAdapter
96
+ * @param array $requestdata
97
+ * @param array $resultdata
98
+ * @throws Exception
99
+ */
100
+ public function processIpnRequest($request, Zend_Http_Client_Adapter_Interface $httpAdapter
101
+ = null, $requestdata, $resultdata)
102
+ {
103
+ $this->_helper = Mage::helper('novalnet_payment');
104
+ $this->_request = $request;
105
+
106
+ try {
107
+ $this->_getRecurringProfile();
108
+ $statuscode = $this->_processRecurringProfile($httpAdapter, $requestdata, $resultdata);
109
+ } catch (Exception $e) {
110
+ $this->_debugData['exception'] = $e->getMessage();
111
+ $this->_debug();
112
+ throw $e;
113
+ }
114
+ $this->_debug();
115
+ return $statuscode;
116
+ }
117
+
118
+ /**
119
+ * Post back to Novalnet, check whether this request is a valid one
120
+ *
121
+ * @param Zend_Http_Client_Adapter_Interface $httpAdapter
122
+ * @param array $postbackRequest
123
+ */
124
+ protected function _postBack(Zend_Http_Client_Adapter_Interface $httpAdapter, $postbackRequest)
125
+ {
126
+ $sReq = '';
127
+ foreach ($postbackRequest->getData() as $k => $v) {
128
+ $sReq .= '&' . $k . '=' . urlencode($v);
129
+ }
130
+ $sReq = substr($sReq, 1);
131
+ $payportUrl = $this->_helper->getPayportUrl('paygate');
132
+ $this->_debugData['postback'] = $sReq;
133
+ $this->_debugData['postback_to'] = $payportUrl;
134
+ $httpAdapter->write(Zend_Http_Client::POST, $payportUrl, '1.1', array(), $sReq);
135
+ try {
136
+ $response = $httpAdapter->read();
137
+ } catch (Exception $e) {
138
+ $this->_debugData['http_error'] = array('error' => $e->getMessage(),
139
+ 'code' => $e->getCode());
140
+ throw $e;
141
+ }
142
+ $this->_debugData['postback_result'] = $response;
143
+ unset($this->_debugData['postback'], $this->_debugData['postback_result']);
144
+ }
145
+
146
+ /**
147
+ * Load recurring profile
148
+ *
149
+ * @return Mage_Sales_Model_Recurring_Profile
150
+ * @throws Exception
151
+ */
152
+ protected function _getRecurringProfile()
153
+ {
154
+ if (empty($this->_recurringProfile)) {
155
+ $recurringProfileId = "";
156
+ if (isset($this->_request['profile_id'])) {
157
+ $recurringProfileId = $this->_request['profile_id'];
158
+ }
159
+
160
+ $referenceId = $this->_request['signup_tid'];
161
+ if ($recurringProfileId) {
162
+ $this->_recurringProfile = Mage::getModel('sales/recurring_profile')
163
+ ->load($recurringProfileId, 'profile_id');
164
+ } else {
165
+ $this->_recurringProfile = Mage::getModel('sales/recurring_profile')
166
+ ->load($referenceId, 'reference_id');
167
+ }
168
+
169
+ if (!$this->_recurringProfile->getId()) {
170
+ $debugMsg = sprintf('Wrong recurring profile REFERENCE_ID: "%s".', $referenceId);
171
+ if ($this->_showdebug) {
172
+ echo $debugMsg;
173
+ exit;
174
+ }
175
+ throw new Exception($debugMsg);
176
+ }
177
+
178
+ $methodCode = $this->_recurringProfile->getMethodCode();
179
+ if (!$this->isMethodActive($methodCode, $this->_recurringProfile->getStoreId())) {
180
+ $debugMsg = sprintf('Method "%s" is not available.', $methodCode);
181
+ if ($this->_showdebug) {
182
+ echo $debugMsg;
183
+ exit;
184
+ }
185
+ throw new Exception($debugMsg);
186
+ }
187
+ if (!$recurringProfileId) {
188
+ $this->_recurringProfileOrderTid = null;
189
+ $this->_getRecurringProfileOrdersTid();
190
+ }
191
+ }
192
+ return $this->_recurringProfile;
193
+ }
194
+
195
+ /**
196
+ * Load recurring profile
197
+ *
198
+ * @return Mage_Sales_Model_Recurring_Profile
199
+ * @throws Exception
200
+ */
201
+ protected function _getRecurringProfileOrdersTid()
202
+ {
203
+ if (empty($this->_recurringProfileOrderTid)) {
204
+ $recurringProfileOrderTid = $this->_request['tid'];
205
+ $checkNovalnetTids = Mage::getModel("sales/order_payment")->getCollection()
206
+ ->addAttributeToSelect('last_trans_id')
207
+ ->addFieldToFilter('last_trans_id', array('like' => "%" . $recurringProfileOrderTid . "%"))
208
+ ->getData();
209
+ if (!empty($checkNovalnetTids)) {
210
+ $debugMsg = sprintf('Wrong recurring profile order TID: "%s".', $recurringProfileOrderTid);
211
+ if ($this->_showdebug) {
212
+ echo $debugMsg;
213
+ exit;
214
+ }
215
+ throw new Exception($debugMsg);
216
+ }
217
+ }
218
+
219
+ return $this->_recurringProfileOrderTid;
220
+ }
221
+
222
+ /**
223
+ * Check whether method active in configuration and supported for merchant country or not
224
+ *
225
+ * @param string $method
226
+ * @param int $storeId
227
+ * @return boolean
228
+ */
229
+ public function isMethodActive($method, $storeId)
230
+ {
231
+ if (Mage::getStoreConfigFlag("payment/{$method}/active", $storeId)) {
232
+ return true;
233
+ }
234
+ return false;
235
+ }
236
+
237
+ /**
238
+ * Process notification from recurring profile payments
239
+ *
240
+ * @param Zend_Http_Client_Adapter_Interface $httpAdapter
241
+ * @param array $requestdata
242
+ * @param array $resultdata
243
+ * @return int
244
+ */
245
+ protected function _processRecurringProfile(Zend_Http_Client_Adapter_Interface $httpAdapter, $requestdata, $resultdata)
246
+ {
247
+ $this->_recurringProfile = null;
248
+ $this->_getRecurringProfile();
249
+ try {
250
+ // handle payment_status
251
+ $paymentStatus = $this->_request['status'];
252
+ switch ($paymentStatus) {
253
+ // paid
254
+ case Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED:
255
+ $statuscode = $this->_registerRecurringProfilePaymentCapture($httpAdapter, $requestdata, $resultdata);
256
+ break;
257
+
258
+ default:
259
+ $debugMsg = sprintf("Novalnet callback received. Status $paymentStatus is not valid: Only 100 is allowed.");
260
+ if ($this->_showdebug) {
261
+ echo $debugMsg;
262
+ exit;
263
+ }
264
+ throw new Exception($debugMsg);
265
+ }
266
+ } catch (Mage_Core_Exception $e) {
267
+ //TODO: add to payment profile comments
268
+ $comment = $this->_createIpnComment($this->_helper->__('Note: %s', $e->getMessage()), true);
269
+ $comment->save();
270
+ throw $e;
271
+ }
272
+ return $statuscode;
273
+ }
274
+
275
+ /**
276
+ * Register recurring payment notification, create and process order
277
+ *
278
+ * @param Zend_Http_Client_Adapter_Interface $httpAdapter
279
+ * @param array $requestdata
280
+ * @param array $resultdata
281
+ * @return int
282
+ */
283
+ protected function _registerRecurringProfilePaymentCapture(Zend_Http_Client_Adapter_Interface $httpAdapter, $requestdata, $resultdata)
284
+ {
285
+ $tid = $this->getRequestData('tid');
286
+ $product = $this->getRequestData('product');
287
+ $paidAmount = $this->getRequestData('amount');
288
+ $recurringProfile = $this->_recurringProfile;
289
+
290
+ $billlingAmount = $recurringProfile->getBillingAmount();
291
+ $taxAmount = $recurringProfile->getTaxAmount();
292
+ $shipAmount = $recurringProfile->getShippingAmount();
293
+ $referenceId = $recurringProfile->getReferenceId();
294
+ $amount = round(($billlingAmount + $shipAmount + $taxAmount), 2);
295
+ $price = $billlingAmount;
296
+ $originalPrice = $amount;
297
+ $productItemInfo = new Varien_Object;
298
+
299
+ $productItemInfo->setPaymentType(Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_REGULAR);
300
+ $productItemInfo->setTaxAmount($taxAmount);
301
+ $productItemInfo->setShippingAmount($shipAmount);
302
+ $productItemInfo->setPrice($price);
303
+
304
+ $order = $recurringProfile->createOrder($productItemInfo);
305
+ $this->_order = $order;
306
+ $payment = $order->getPayment();
307
+ $order->save();
308
+ $payment->setAdditionalData($this->getRequestData('additional_data'))
309
+ ->save();
310
+ $paymentObj = $payment->getMethodInstance();
311
+
312
+ $paymentMethod = $paymentObj->getCode();
313
+ $getTransactionStatus = $paymentObj->doNovalnetStatusCall($tid,$payment);
314
+ $getStatus = $getTransactionStatus->getStatus();
315
+ $subsId = $getTransactionStatus->getSubsId();
316
+ $resultdata->setStatus($getStatus);
317
+ if (!$referenceId
318
+ && (in_array($paymentMethod, array(Novalnet_Payment_Model_Config::NN_PREPAYMENT, Novalnet_Payment_Model_Config::NN_INVOICE)) && $getStatus != 100)) {
319
+ $payment->setIsTransactionPending(true);
320
+ }
321
+
322
+ $reslutStatus = $resultdata->getStatus();
323
+ $recurringProfile->addOrderRelation($order->getId());
324
+ $this->_helper->getCoresession()->setStatusCode($reslutStatus);
325
+ $closed = $reslutStatus == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
326
+ ? 1 : 0;
327
+ $payment->setTransactionId($tid)
328
+ ->setPreparedMessage($this->_createIpnComment(''))
329
+ ->setAdditionalInformation('subs_id', $subsId)
330
+ ->setIsTransactionClosed($closed);
331
+ $paymentObj->logNovalnetStatusData($resultdata, trim($tid));
332
+ $paymentObj->logNovalnetTransactionData($requestdata, $resultdata, trim($tid), $this->_helper->getCustomerId(), $this->_helper->getMagentoStoreId());
333
+ $payment->registerCaptureNotification($originalPrice, 0);
334
+ if ($reslutStatus == 100 && $paymentMethod != Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
335
+ $order->setTotalPaid($paidAmount);
336
+ $order->setBaseTotalPaid($paidAmount);
337
+ }
338
+
339
+ $order->save();
340
+
341
+ if (!$referenceId && $httpAdapter) {
342
+ $request = Mage::getModel('novalnet_payment/novalnet_request');
343
+ $request->setTid($tid)
344
+ ->setVendor($this->getRequestData('vendor'))
345
+ ->setAuthCode($this->getRequestData('auth_code'))
346
+ ->setTestMode($this->getRequestData('test_mode'))
347
+ ->setProduct($product)
348
+ ->setTariff($this->getRequestData('tariff'))
349
+ ->setKey($this->getRequestData('key'))
350
+ ->setOrderNo($order->getIncrementId())
351
+ ->setStatus(100);
352
+ if (in_array($paymentMethod, array(Novalnet_Payment_Model_Config::NN_PREPAYMENT, Novalnet_Payment_Model_Config::NN_INVOICE))) {
353
+ $request->setInvoiceRef("BNR-" . $product . "-" . $order->getIncrementId());
354
+ }
355
+
356
+ $this->_postBack($httpAdapter, $request); // second call
357
+ // Log Affiliate user details
358
+ $nnAffId = $this->_helper->getCoresession()->getNnAffId();
359
+ if ($nnAffId) {
360
+ $paymentObj->doNovalnetAffUserInfoLog($nnAffId);
361
+ }
362
+ }
363
+ // notify customer
364
+ $subscriptionPayments = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('subscriptionPayments');
365
+
366
+ if (($reslutStatus != 100 && in_array($paymentMethod, $subscriptionPayments))
367
+ || ($reslutStatus == 100 && $paymentMethod == Novalnet_Payment_Model_Config::NN_PREPAYMENT)) {
368
+ if (!$order->getEmailSent() && $order->getId()) {
369
+ $order->sendNewOrderEmail()
370
+ ->setEmailSent(true)
371
+ ->save();
372
+ }
373
+ } else if ($invoice = $payment->getCreatedInvoice()) {
374
+ $message = $this->_helper->__('Notified customer about invoice #%s.', $invoice->getIncrementId());
375
+ $comment = $order->sendNewOrderEmail()->addStatusHistoryComment($message)
376
+ ->setIsCustomerNotified(true)
377
+ ->save();
378
+ }
379
+ return $getStatus;
380
+ }
381
+
382
+ /**
383
+ * Generate an "IPN" comment with additional explanation.
384
+ * Returns the generated comment or order status history object
385
+ *
386
+ * @param string $comment
387
+ * @param bool $addToHistory
388
+ * @return string|Mage_Sales_Model_Order_Status_History
389
+ */
390
+ protected function _createIpnComment($comment = '', $addToHistory = false)
391
+ {
392
+ $paymentStatus = $this->getRequestData('status');
393
+ $message = $this->_helper->__('IPN "%s".', $paymentStatus);
394
+ if ($comment) {
395
+ $message .= ' ' . $comment;
396
+ }
397
+ if ($addToHistory) {
398
+ $message = $this->_order->addStatusHistoryComment($message);
399
+ $message->setIsCustomerNotified(null);
400
+ }
401
+ return $message;
402
+ }
403
+
404
+ /**
405
+ * Log debug data to file
406
+ *
407
+ */
408
+ protected function _debug()
409
+ {
410
+ if ($this->_debug) {
411
+ $file = self::DEFAULT_LOG_FILE;
412
+ Mage::getModel('core/log_adapter', $file)->log($this->_debugData);
413
+ }
414
+ }
415
+ }
app/code/community/Novalnet/Payment/Model/Novalnet/Request.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Novalnet_Request extends Varien_Object
27
+ {
28
+ public function toLatin1()
29
+ {
30
+ $data = $this->toArray();
31
+ foreach ($data as $key => $val) {
32
+ $setKey = "set" . ucfirst($key);
33
+ $this->$setKey(utf8_decode($val));
34
+ }
35
+ }
36
+ }
app/code/community/Novalnet/Payment/Model/Novalnet/Source/Callbacktypes.php CHANGED
@@ -25,14 +25,12 @@
25
  */
26
  class Novalnet_Payment_Model_Novalnet_Source_Callbacktypes
27
  {
28
-
29
  public function toOptionArray()
30
  {
31
- return array(0 => Mage::helper('novalnet_payment')->__('Not active'),
32
- 1 => Mage::helper('novalnet_payment')->__('Callback (Landline & mobile)'),
33
- 2 => Mage::helper('novalnet_payment')->__('SMS (Mobile only)'),
34
- 3 => Mage::helper('novalnet_payment')->__('Email Reply')
35
  );
36
  }
37
-
38
  }
25
  */
26
  class Novalnet_Payment_Model_Novalnet_Source_Callbacktypes
27
  {
 
28
  public function toOptionArray()
29
  {
30
+ return array(0 => Mage::helper('novalnet_payment')->__('None'),
31
+ 1 => Mage::helper('novalnet_payment')->__('PIN by callback'),
32
+ 2 => Mage::helper('novalnet_payment')->__('PIN by SMS'),
33
+ 3 => Mage::helper('novalnet_payment')->__('Reply via E-mail')
34
  );
35
  }
 
36
  }
app/code/community/Novalnet/Payment/Model/Novalnet/Source/{Cctypes.php → Cctype.php} RENAMED
@@ -23,9 +23,8 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Novalnet_Payment_Model_Novalnet_Source_Cctypes extends Mage_Payment_Model_Source_Cctype
27
  {
28
-
29
  public function getAllowedTypes()
30
  {
31
  return array('VI', 'MC', 'AE');
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Novalnet_Payment_Model_Novalnet_Source_Cctype extends Mage_Payment_Model_Source_Cctype
27
  {
 
28
  public function getAllowedTypes()
29
  {
30
  return array('VI', 'MC', 'AE');
app/code/community/Novalnet/Payment/Model/Observer.php CHANGED
@@ -36,20 +36,13 @@ class Novalnet_Payment_Model_Observer
36
  try {
37
  /* @var $order Magento_Sales_Model_Order_Invoice */
38
  $invoice = $observer->getEvent()->getInvoice();
39
- $paymentCode = $invoice->getOrder()->getPayment()->getMethodInstance()->getCode();
40
- $tidPayment = Mage::app()->getRequest()->getParam('tid_payment');
41
-
42
- if ($paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE && $tidPayment
43
- == '') {
44
- $invoice->setState(1);
45
- $invoice->save();
46
- $invoice->sendEmail($invoice);
47
- } else {
48
- $invoice->save();
49
- $invoice->sendEmail($invoice);
50
  }
 
 
51
  } catch (Mage_Core_Exception $e) {
52
- Mage::logException($e->getMessage());
53
  }
54
 
55
  return $this;
@@ -83,15 +76,19 @@ class Novalnet_Payment_Model_Observer
83
  */
84
  public function prepareLayoutBefore(Varien_Event_Observer $observer)
85
  {
 
 
 
 
86
  /* @var $block Mage_Page_Block_Html_Head */
87
  if (!Mage::app()->getStore()->isCurrentlySecure()) {
88
- $baseUrl = Mage::getBaseUrl();
89
  } else {
90
- $baseUrl = Mage::getUrl('', array('_secure' => true));
91
  }
92
  $currentlUrl = Mage::helper('core/url')->getCurrentUrl();
93
  $block = $observer->getEvent()->getBlock();
94
- if ("head" == $block->getNameInLayout() && $currentlUrl != $baseUrl) {
95
  foreach (Mage::helper('novalnet_payment/AssignData')->getFiles() as $file) {
96
  $block->addJs(Mage::helper('novalnet_payment/AssignData')->getJQueryPath($file));
97
  }
@@ -106,10 +103,29 @@ class Novalnet_Payment_Model_Observer
106
  * @param varien_object $observer
107
  * @return Novalnet_Payment_Model_Observer
108
  */
109
- public function customerLogin()
110
  {
 
111
  Mage::getSingleton('core/session')->setGuestloginvalue('');
112
  return;
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
36
  try {
37
  /* @var $order Magento_Sales_Model_Order_Invoice */
38
  $invoice = $observer->getEvent()->getInvoice();
39
+ if(Mage::app()->getStore()->isAdmin()){
40
+ $this->onHoldOrderStatus($invoice);
 
 
 
 
 
 
 
 
 
41
  }
42
+ $invoice->save();
43
+ $invoice->sendEmail($invoice);
44
  } catch (Mage_Core_Exception $e) {
45
+ Mage::log($e->getMessage());
46
  }
47
 
48
  return $this;
76
  */
77
  public function prepareLayoutBefore(Varien_Event_Observer $observer)
78
  {
79
+ $nnAffId = Mage::app()->getRequest()->getParam('nn_aff_id');
80
+ if ($nnAffId) {
81
+ Mage::getSingleton('core/session')->setNnAffId(trim($nnAffId));
82
+ }
83
  /* @var $block Mage_Page_Block_Html_Head */
84
  if (!Mage::app()->getStore()->isCurrentlySecure()) {
85
+ $baseurl = Mage::getBaseUrl();
86
  } else {
87
+ $baseurl = Mage::getUrl('', array('_secure' => true));
88
  }
89
  $currentlUrl = Mage::helper('core/url')->getCurrentUrl();
90
  $block = $observer->getEvent()->getBlock();
91
+ if ("head" == $block->getNameInLayout() && $currentlUrl != $baseurl) {
92
  foreach (Mage::helper('novalnet_payment/AssignData')->getFiles() as $file) {
93
  $block->addJs(Mage::helper('novalnet_payment/AssignData')->getJQueryPath($file));
94
  }
103
  * @param varien_object $observer
104
  * @return Novalnet_Payment_Model_Observer
105
  */
106
+ public function customerLogin($observer)
107
  {
108
+ $customer = $observer->getCustomer();
109
  Mage::getSingleton('core/session')->setGuestloginvalue('');
110
  return;
111
  }
112
 
113
+ /**
114
+ * Set onhold status for Novalnet payments
115
+ *
116
+ * @param varien_object $invoice
117
+ */
118
+ private function onHoldOrderStatus($invoice)
119
+ {
120
+ $order = $invoice->getOrder();
121
+ $storeId = $order->getStoreId();
122
+ $payment = $order->getPayment();
123
+ $paymentObj = $payment->getMethodInstance();
124
+ $paymentCode = $paymentObj->getCode();
125
+ if (preg_match("/novalnet/i", $paymentCode)) {
126
+ $setOrderAfterStatus = $paymentObj->_getConfigData('order_status',true,$storeId);
127
+ $setOrderAfterStatus = $setOrderAfterStatus ? $setOrderAfterStatus : Mage_Sales_Model_Order::STATE_PROCESSING;
128
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $setOrderAfterStatus, Mage::helper('novalnet_payment')->__('Invoice Created Successfully'), true)->save();
129
+ }
130
+ }
131
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/Abstract.php CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the Payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,14 +20,14 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_Method_Abstract
 
27
  {
28
-
29
  protected $_isGateway = false;
30
- protected $_canAuthorize = false;
31
  protected $_canCapture = false;
32
  protected $_canCapturePartial = false;
33
  protected $_canRefund = true;
@@ -38,8 +38,6 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
38
  protected $_canUseForMultishipping = false;
39
  protected $_canSaveCc = false;
40
  protected $_isInitializeNeeded = false;
41
- protected $_mustTransimitInvoicingData = false;
42
- protected $_mustTransimitInvoicingItemTypes = false;
43
  protected $_canCancelInvoice = false;
44
  protected $_methodType = '';
45
  protected $_redirectUrl = '';
@@ -60,37 +58,254 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
60
  $this->_authcode = $this->_getConfigData('auth_code', true);
61
  $this->_productId = $this->_getConfigData('product_id', true);
62
  $this->_tariffId = $this->_getConfigData('tariff_id', true);
63
- $this->_referrerId = $this->_getConfigData('referrer_id', true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
 
66
  /**
67
  * Check whether payment method can be used
68
  *
69
  * @param Mage_Sales_Model_Quote
70
- * @return bool
71
  */
72
  public function isAvailable($quote = null)
73
  {
 
74
  $getNnDisableTime = "getNnDisableTime" . ucfirst($this->_code); //Dynamic Getter based on payment methods
75
  $minOrderCount = $this->_getConfigData('orderscount');
76
  $userGroupId = $this->_getConfigData('user_group_excluded');
 
77
 
78
- if ($this->helper->checkOrdersCount($minOrderCount)) {
 
 
79
  return false;
80
- } else if (!$this->helper->checkCustomerAccess($userGroupId)) {
81
  return false;
82
- } else if ($this->helper->checkIsAdmin() && $this->_getConfigData('active_cc3d') == 1) {
83
  return false;
84
- } else if (!empty($quote) && !$this->helper->isModuleActive($quote->getGrandTotal())) {
 
 
 
85
  return false;
86
  } else if (time() < $this->_getCheckout()->$getNnDisableTime()) {
87
  return false;
88
  }
 
89
  $this->paymentRefillValidate();
90
 
91
  return parent::isAvailable($quote);
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  /**
95
  * Validate payment method information object
96
  *
@@ -99,7 +314,9 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
99
  public function validate()
100
  {
101
  parent::validate();
 
102
  $infoInstance = $this->_getInfoInstance();
 
103
  if (!$this->_isPlaceOrder()) {
104
  // validate the Novalnet basic params and billing informations
105
  $this->validateNovalnetParams();
@@ -110,9 +327,9 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
110
  }
111
 
112
  $callbackPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('fraudCheckPayment');
113
- if (in_array($this->_code, $callbackPayment) || ($this->_code == 'novalnetCc'
114
- && $this->_getConfigData('active_cc3d') != 1)) {
115
- $this->_initiateCallbackProcess($this->_code);
116
  }
117
 
118
  if (!$this->isCallbackTypeCall() && $this->_isPlaceOrder()) {
@@ -127,43 +344,31 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
127
  */
128
  public function paymentRefillValidate()
129
  {
130
- // set method session
131
- $this->_getMethodSession();
132
- $prevPaymentCode = $this->_getCheckout()->getNnPaymentCode();
133
- // check the users (guest or login)
134
- $customerSession = $this->helper->getCustomerSession();
135
- $coreSession = Mage::getSingleton('core/session');
136
  if (!$customerSession->isLoggedIn() && $coreSession->getGuestloginvalue()
137
  == '') {
138
  $coreSession->setGuestloginvalue('1');
139
  } elseif ($coreSession->getGuestloginvalue() == '1' && $customerSession->isLoggedIn()) {
140
  $coreSession->setGuestloginvalue('0');
 
141
  $this->unsetMethodSession($prevPaymentCode);
142
  }
143
 
144
- // unset form previous payment method session
145
- $paymentCode = $this->_getCheckout()->getQuote()->getPayment()->getMethod();
146
- if ($paymentCode && !preg_match("/novalnet/i", $paymentCode) && $prevPaymentCode && $paymentCode != $prevPaymentCode) {
147
  $this->unsetMethodSession($prevPaymentCode);
148
  }
149
- }
150
 
151
- /**
152
- * Assign Form Data in quote instance
153
- *
154
- * @param varien_object $data
155
- * @return Mage_Payment_Model_Abstract Object
156
- */
157
- public function assignData($data)
158
- {
159
- $infoInstance = $this->_getInfoInstance();
160
- // unset form previous payment method session
161
- $prevPaymentCode = $this->_getCheckout()->getNnPaymentCode();
162
- if ($prevPaymentCode && $this->_code != $prevPaymentCode) {
163
- $this->unsetMethodSession($prevPaymentCode);
164
  }
165
- $this->dataHelper->assignNovalnetData($this->_code, $data, $infoInstance);
166
- return $this;
167
  }
168
 
169
  /**
@@ -174,25 +379,25 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
174
  {
175
  $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
176
  if ($this->_code && !in_array($this->_code, $redirectPayment)) {
 
177
 
178
- if ($this->_code == Novalnet_Payment_Model_Config::NN_CC && !$this->helper->checkIsAdmin()
179
  && $this->_getConfigData('active_cc3d') == 1) {
180
  return false;
181
  }
182
 
183
- $storeId = $this->helper->getMagentoStoreId();
184
  $request = $this->buildRequest(Novalnet_Payment_Model_Config::POST_NORMAL, $storeId);
185
- $methodSession = $this->_getMethodSession($this->_code);
186
- $methodSession->setPaymentReqData($request);
187
  }
188
  }
189
 
190
  /**
191
- * Capture
192
  *
193
- * @param Varien_Object $payment
194
  * @param float $amount
195
- * @return Mage_Payment_Model_Abstract
196
  */
197
  public function capture(Varien_Object $payment, $amount)
198
  {
@@ -200,33 +405,20 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
200
  $responseCodeApproved = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
201
 
202
  if ($this->canCapture() && $this->_code && !in_array($this->_code, $redirectPayment)) {
203
- $lastTranId = $this->helper->makeValidNumber($payment->getLastTransId());
204
- $loadTransStatus = $this->helper->loadTransactionStatus($lastTranId);
 
 
 
205
  $transStatus = $loadTransStatus->getTransactionStatus();
206
-
207
  if (!empty($transStatus) && $transStatus != $responseCodeApproved) {
208
-
209
- //Send capture request to Payport
210
- $response = $this->_performPayportRequest($payment, 'capture');
211
  if ($response->getStatus() == $responseCodeApproved) {
212
- $loadTransStatus->setTransactionStatus($responseCodeApproved)
213
- ->save();
214
-
215
- $magentoVersion = $this->_getHelper()->getMagentoVersion();
216
- // make capture transaction open for lower versions to make refund
217
- if (version_compare($magentoVersion, '1.6', '<')) {
218
- $payment->setIsTransactionClosed(false)
219
- ->save();
220
- }
221
- if ($transStatus != $responseCodeApproved) {
222
- $transMode = (version_compare($magentoVersion, '1.6', '<'))
223
- ? false : true;
224
- $payment->setTransactionId($lastTranId)
225
- ->setIsTransactionClosed($transMode);
226
- $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
227
- $transaction->setParentTxnId(null)
228
- ->save();
229
- }
230
  } else {
231
  $this->showException('Error in you capture request');
232
  }
@@ -240,68 +432,64 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
240
  *
241
  * @param string $type
242
  * @param int $storeId
243
- * @return Mage_Novalnet_Model_Novalnet_Request
 
 
244
  */
245
- public function buildRequest($type = Novalnet_Payment_Model_Config::POST_NORMAL,
246
- $storeId = NULL
247
- ) {
248
  $payCode = ucfirst($this->_code);
249
  $helper = $this->helper;
250
  $callbackTelNo = "getNnCallbackTel" . $payCode;
251
  $callbackEmail = "getNnCallbackEmail" . $payCode;
252
- $refernceOne = trim(strip_tags(trim($this->_getConfigData('reference_one'))));
253
- $refernceTwo = trim(strip_tags(trim($this->_getConfigData('reference_two'))));
 
 
 
 
 
 
254
 
255
  if ($type == Novalnet_Payment_Model_Config::POST_NORMAL || $type == Novalnet_Payment_Model_Config::POST_CALLBACK) {
 
 
256
  $request = new Varien_Object();
257
- $amount = $helper->getFormatedAmount($this->_getAmount());
258
- $billing = $this->_getInfoObject()->getBillingAddress();
259
- $email = $billing->getEmail() ? $billing->getEmail() : $this->_getInfoObject()->getCustomerEmail();
260
  $this->assignNnAuthData($request, $storeId);
261
- $request->setTestMode((!$this->_getConfigData('live_mode')) ? 1 : 0)
262
- ->setAmount($amount)
263
- ->setCurrency($this->_getInfoObject()->getBaseCurrencyCode())
264
- ->setCustomerNo($helper->getCustomerId())
265
- ->setUseUtf8(1)
266
- ->setFirstName($billing->getFirstname())
267
- ->setLastName($billing->getLastname())
268
- ->setSearchInStreet(1)
269
- ->setStreet(implode(',', $billing->getStreet()))
270
- ->setCity($billing->getCity())
271
- ->setZip($billing->getPostcode())
272
- ->setCountry($billing->getCountry())
273
- ->setLanguage(strtoupper($helper->getDefaultLanguage()))
274
- ->setLang(strtoupper($helper->getDefaultLanguage()))
275
- ->setTel($billing->getTelephone())
276
- ->setFax($billing->getFax())
277
- ->setRemoteIp($helper->getRealIpAddr())
278
- ->setGender('u')
279
- ->setEmail($email)
280
- ->setOrderNo($this->_getOrderId())
281
- ->setSystemUrl(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB))
282
- ->setSystemIp($helper->getServerAddr())
283
- ->setSystemName('magento')
284
- ->setSystemVersion($helper->getMagentoVersion() . '-' . $helper->getNovalnetVersion());
285
-
286
  if ($this->_referrerId) {
287
  $request->setReferrerId($this->_referrerId);
288
  }
289
- if ($refernceOne) {
290
- $request->setInput1('reference1')
291
- ->setInputval1($refernceOne);
292
- }
293
- if ($refernceTwo) {
294
- $request->setInput2('reference2')
295
- ->setInputval2($refernceTwo);
296
- }
297
  if ($helper->checkIsAdmin()) {
298
  $adminUserId = Mage::getSingleton('admin/session')->getUser()->getUserId();
299
- $request->setInput3('admin_user')
300
- ->setInputval3($adminUserId);
301
  }
 
 
 
 
 
 
 
 
 
 
 
 
302
  $this->_setNovalnetParam($request, $this->_code);
303
  }
304
 
 
 
 
 
305
  //Callback Method
306
  if ($type == Novalnet_Payment_Model_Config::POST_CALLBACK) {
307
  if ($this->getConfigData('callback') == 1) { //PIN By Callback
@@ -322,18 +510,25 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
322
  /**
323
  * Post request to gateway and return response
324
  *
325
- * @param Varien_Object $request
326
- * @return Varien_Object
327
  */
328
  public function postRequest($request)
329
  {
330
  $result = new Varien_Object();
331
  $helper = $this->helper;
332
  $paymentKey = $helper->getPaymentId($this->_code);
 
333
  $payportUrl = $helper->getPayportUrl('paygate');
334
  if ($this->_validateBasicParams() && $helper->checkIsNumeric($paymentKey)
335
  && $paymentKey == $request->getKey() && $request->getAmount() && $helper->checkIsNumeric($request->getAmount())) {
336
- $response = $this->_setNovalnetRequestCall($request->getData(), $payportUrl);
 
 
 
 
 
 
337
  parse_str($response->getBody(), $data);
338
  $result->addData($data);
339
  } else {
@@ -342,28 +537,6 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
342
  return $result;
343
  }
344
 
345
- /**
346
- * Do XML call request to server
347
- *
348
- * @param Varien_Object $requestData
349
- * @param String $requestUrl
350
- * @return Mage_Payment_Model_Abstract Object
351
- */
352
- public function setRawCallRequest($requestData, $requestUrl)
353
- {
354
- $httpClientConfig = array('maxredirects' => 0);
355
- $client = new Varien_Http_Client($requestUrl, $httpClientConfig);
356
- $client->setRawData($requestData)->setMethod(Varien_Http_Client::POST);
357
- $response = $client->request();
358
- if (!$response->isSuccessful()) {
359
- Mage::throwException($this->_getHelper()->__('Gateway request error: %s', $response->getMessage()));
360
- }
361
- $result = new Varien_Object();
362
- parse_str($response->getBody(), $data);
363
- $result->addData($data);
364
- return $result;
365
- }
366
-
367
  /**
368
  * Assign Novalnet Authentication Data
369
  *
@@ -373,10 +546,16 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
373
  public function assignNnAuthData(Varien_Object $request, $storeId = NULL)
374
  {
375
  //Reassign the Basic Params Based on store
 
376
  $this->_vendorId = $this->_getConfigData('merchant_id', true, $storeId);
377
  $this->_authcode = $this->_getConfigData('auth_code', true, $storeId);
 
 
 
 
378
 
379
- $this->_manualCheckValidate($storeId);
 
380
  $request->setVendor($this->_vendorId)
381
  ->setAuthCode($this->_authcode)
382
  ->setProduct($this->_productId)
@@ -385,16 +564,21 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
385
  }
386
 
387
  /**
388
- * Set the Order basic configuration
389
  *
390
- * @param string $payment
 
 
 
391
  */
392
- public function assignVendorConfig($payment = NULL)
 
393
  {
394
- //Reassign the Basic Params Based on store
395
- $getresponseData = NULL;
396
- if ($payment) {
397
- $getresponseData = unserialize($payment->getAdditionalData());
 
398
  }
399
  $this->_vendorId = ($getresponseData['vendor']) ? $getresponseData['vendor']
400
  : $this->_vendorId;
@@ -404,6 +588,13 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
404
  : $this->_productId;
405
  $this->_tariffId = ($getresponseData['tariff']) ? $getresponseData['tariff']
406
  : $this->_tariffId;
 
 
 
 
 
 
 
407
  }
408
 
409
  /**
@@ -421,10 +612,15 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
421
 
422
  if ($payment->getRefundTransactionId() && $amount > 0) {
423
  $helper = $this->helper;
 
424
  $refundAmount = $helper->getFormatedAmount($amount);
425
- $getTid = $helper->makeValidNumber($payment->getRefundTransactionId());
 
 
 
426
  $data = unserialize($payment->getAdditionalData());
427
- if ($this->_code == Novalnet_Payment_Model_Config::NN_SEPA) {
 
428
  $getTid = $helper->makeValidNumber($payment->getLastTransId());
429
  if (isset($data['NnSepaParentTid']) && $data['NnSepaParentTid']) {
430
  $getTid = $data['NnSepaParentTid'];
@@ -434,76 +630,48 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
434
  if ($this->_code == Novalnet_Payment_Model_Config::NN_INVOICE) {
435
  $this->_refundValidation($payment, $refundAmount);
436
  }
437
- //Send refund request to Payport
438
- $response = $this->_performPayportRequest($payment, 'refund', $refundAmount, $getTid);
 
 
 
 
 
 
 
 
439
 
440
  if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
441
- $getTransactionStatus = $this->doNovalnetStatusCall($getTid, $payment, Novalnet_Payment_Model_Config::TRANS_STATUS);
442
- $loadTransaction = $helper->loadTransactionStatus($getTid);
443
- $loadTransaction->setTransactionStatus($getTransactionStatus->getStatus())
444
- ->setAmount($helper->getFormatedAmount($getTransactionStatus->getAmount(), 'RAW'))
445
- ->save();
446
  $data['fullRefund'] = ((string)$this->_getAmount() == (string)$amount) ? true : false;
447
- $txnid = $response->getTid(); // response tid
448
- $refundTid = !empty($txnid) ? $txnid : $payment->getLastTransId() . '-refund';
449
 
450
  if (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_INVOICE,
451
  Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
452
- $amountAfterRefund = ($this->_getAmount() - $payment->getOrder()->getBaseTotalRefunded());
453
- $loadTransaction->setAmount($amountAfterRefund)
454
- ->save();
455
  $data['NnTid'] = $data['NnTid'] . '-refund';
456
  $refundTid = $data['NnTid'];
457
  }
458
 
459
  if ($refundTid) {
460
  $refAmount = Mage::helper('core')->currency($amount, true, false);
461
- if (!isset($data['refunded_tid'])) {
462
- $refundedTid = array('refunded_tid'=> array($refundTid => array('reftid' => $refundTid , 'refamount' => $refAmount , 'reqtid' => $getTid)));
463
- $data = array_merge($data, $refundedTid);
464
- } else {
465
- $data['refunded_tid'][$refundTid]['reftid'] = $refundTid;
466
- $data['refunded_tid'][$refundTid]['refamount'] = $refAmount;
467
- $data['refunded_tid'][$refundTid]['reqtid'] = $getTid;
468
- }
469
  }
470
-
471
  // For SEPA payment after submitting to bank
472
- if ($getTransactionStatus->getStatus() && $this->_code == Novalnet_Payment_Model_Config::NN_SEPA) {
473
  $data['NnSepaParentTid'] = $getTid;
474
- if ($getTransactionStatus->getStatus() == Novalnet_Payment_Model_Config::PAYMENT_VOID_STATUS
475
- && $getTransactionStatus->getChildTidInfo()) {
476
- parse_str($getTransactionStatus->getChildTidInfo(), $resInfo);
477
  $data['NnSepaParentTid'] = $resInfo['tid1'];
478
  }
479
  }
480
 
481
- $magentoVersion = $this->_getHelper()->getMagentoVersion();
482
- // make capture transaction open for lower versions to make refund
483
- if (version_compare($magentoVersion, '1.6', '<')) {
484
- $order = $payment->getOrder();
485
- $canRefundMore = $order->canCreditmemo();
486
-
487
- $payment->setTransactionId($refundTid)
488
- ->setLastTransId($refundTid)
489
- ->setAdditionalData(serialize($data))
490
- ->setIsTransactionClosed(1) // refund initiated by merchant
491
- ->setShouldCloseParentTransaction(!$canRefundMore)
492
- ->save();
493
- } else {
494
- $payment->setTransactionId($refundTid)
495
- ->setLastTransId($refundTid)
496
- ->setAdditionalData(serialize($data))
497
- ->save();
498
- }
499
-
500
- if ($txnid) { // Only log the novalnet transaction which contains TID
501
- if ($this->_code == Novalnet_Payment_Model_Config::NN_SEPA) {
502
- $amount = ($this->_getAmount() - $payment->getOrder()->getBaseTotalRefunded());
503
- }
504
- $getTransactionStatus = $this->doNovalnetStatusCall($txnid, $payment, Novalnet_Payment_Model_Config::TRANS_STATUS);
505
- $response->setStatus($getTransactionStatus->getStatus());
506
- $helper->doTransactionStatusSave($response, $getTransactionStatus, $payment, $amount, $loadTransaction->getCustomerId);
507
  }
508
  } else {
509
  $this->showException($response->getStatusDesc(), false);
@@ -524,114 +692,167 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
524
  private function _refundValidation($payment, $refundAmount)
525
  {
526
  $orderId = $payment->getOrder()->getIncrementId();
527
- $callbackTrans = $this->helper->loadCallbackValue($orderId);
 
528
  $callbackValue = $callbackTrans && $callbackTrans->getCallbackAmount() != NULL
529
  ? $callbackTrans->getCallbackAmount() : '';
530
  $currency = Mage::app()->getLocale()->currency($this->_getInfoObject()->getBaseCurrencyCode())->getSymbol();
531
  if ($callbackValue < (string) $refundAmount) {
532
- $this->showException('Maximum amount available to refund is ' . $currency . $this->helper->getFormatedAmount($callbackValue, 'RAW'));
533
  }
534
- $refundedAmount = $this->helper->getFormatedAmount($payment->getAmountRefunded());
 
535
  $totalrefundAmount = $refundedAmount + $refundAmount;
536
  $availAmount = $callbackValue - $refundedAmount;
537
  if ($payment->getAmountRefunded() && $callbackValue < (string) $totalrefundAmount) {
538
- $this->showException('Maximum amount available to refund is ' . $currency . $this->helper->getFormatedAmount($availAmount, 'RAW'));
539
  }
540
  return true;
541
  }
542
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
  /**
544
  * Perform Novalnet request for Void, Capture, Refund
545
  *
546
- * @param varien_Object $payment
547
  * @param string $requestType
548
  * @param float $refundAmount
549
  * @param int $refundTid
 
550
  * @return mixed
551
  */
552
- private function _performPayportRequest($payment, $requestType,
553
- $refundAmount = NULL, $refundTid = NULL
554
- ) {
 
555
  $request = new Varien_Object();
556
- $helper = $this->helper;
557
- $storeId = $helper->getMagentoStoreId();
558
- $customerId = $payment->getOrder()->getCustomerId();
 
559
  $getTid = ($requestType == 'refund') ? $refundTid : $payment->getLastTransId();
560
- $this->assignVendorConfig($payment);
561
- $getresponseData = unserialize($payment->getAdditionalData());
562
- $key = ($getresponseData['key']) ? $getresponseData['key'] : $helper->getPaymentId($this->_code);
563
- $request->setVendor($this->_vendorId)
564
- ->setAuthCode($this->_authcode)
565
- ->setProduct($this->_productId)
566
- ->setTariff($this->_tariffId)
567
- ->setKey($key)
568
- ->setTid($helper->makeValidNumber($getTid));
569
- if ($requestType == 'void' || $requestType == 'capture') {
570
- $request->setEditStatus(true);
571
- $setStatus = ($requestType == 'capture') ? Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
572
- : Novalnet_Payment_Model_Config::PAYMENT_VOID_STATUS;
573
- $request->setStatus($setStatus);
574
- } else {
575
- $request->setRefundRequest(true)
576
- ->setRefundParam($refundAmount);
577
- }
578
  if (!in_array(NULL, $request->toArray())) {
579
  $buildNovalnetParam = http_build_query($request->getData());
580
  $payportUrl = $helper->getPayportUrl('paygate');
581
- $response = $this->setRawCallRequest($buildNovalnetParam, $payportUrl);
582
  $this->logNovalnetTransactionData($request, $response, $payment->getLastTransId(), $customerId, $storeId);
583
  } else {
584
  $this->showException('Error in processing the transactions request');
585
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  return $response;
587
  }
588
 
589
  /**
590
- * Void payment
591
  *
592
- * @param varien_object $payment
593
- * @return Mage_Payment_Model_Abstract
 
594
  */
595
- public function void(Varien_Object $payment)
596
  {
597
- if (!$this->canVoid($payment)) {
598
- $this->showException('Void action is not available.');
 
 
 
 
 
 
 
 
 
599
  }
600
 
601
- //Send void request to Payport
602
- $response = $this->_performPayportRequest($payment, 'void');
603
-
604
- if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
605
-
606
- $txnid = $response->getTid();
607
- $voidTid = !empty($txnid) ? $txnid : $payment->getLastTransId() . '-void';
608
- $invoicePayment = (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_INVOICE,
609
- Novalnet_Payment_Model_Config::NN_PREPAYMENT)));
610
- $data = unserialize($payment->getAdditionalData());
611
- $data['voidTid'] = $voidTid;
612
- if ($invoicePayment) {
613
- $bankVoidTid = !empty($txnid) ? $txnid : $payment->getLastTransId();
614
- $data['NnNoteTID'] = $this->dataHelper->getBankDetailsTID($bankVoidTid, $data);
615
- }
616
-
617
- $payment->setTransactionId($voidTid)
618
- ->setLastTransId($voidTid)
619
- ->setAdditionalData(serialize($data))
620
- ->save();
621
- $getTid = $this->helper->makeValidNumber($payment->getLastTransId());
622
- $getTransactionStatus = $this->doNovalnetStatusCall($getTid, $payment, Novalnet_Payment_Model_Config::TRANS_STATUS);
623
- $transAmount = $getTransactionStatus->getAmount();
624
- if ($invoicePayment) {
625
- $transAmount = $this->helper->getFormatedAmount($getTransactionStatus->getAmount(), 'RAW');
626
  }
627
- $loadTransaction = $this->helper->loadTransactionStatus($getTid);
628
- $loadTransaction->setTransactionStatus($getTransactionStatus->getStatus())
629
- ->setAmount($transAmount)
630
- ->save();
631
- } else {
632
- $this->showException('Error in you void request');
633
  }
634
- return $this;
 
 
635
  }
636
 
637
  /**
@@ -643,7 +864,7 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
643
  private function _getMethodSession($paymentCode = NULL)
644
  {
645
  $paymentCode = (!empty($paymentCode)) ? $paymentCode : $this->getCode();
646
- $checkoutSession = $this->_getCheckout();
647
  if (!$checkoutSession->hasData($paymentCode)) {
648
  $checkoutSession->setData($paymentCode, new Varien_Object());
649
  }
@@ -659,16 +880,12 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
659
  public function unsetMethodSession($paymentCode = NULL)
660
  {
661
  $paymentCode = (!empty($paymentCode)) ? $paymentCode : $this->getCode();
662
- $checkoutSession = $this->_getCheckout();
663
- $checkoutSession->unsetData($paymentCode);
664
- if ($checkoutSession->getNnPaymentCode()) {
665
- $checkoutSession->unsNnPaymentCode();
666
- }
667
  return $this;
668
  }
669
 
670
  /**
671
- * Get the novalnet configuration data
672
  *
673
  * @param string $field
674
  * @param boolean $globalMode
@@ -677,11 +894,12 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
677
  */
678
  public function _getConfigData($field, $globalMode = false, $storeId = NULL)
679
  {
680
- $storeId = is_null($storeId) ? $this->helper->getMagentoStoreId() : $storeId;
681
- $path = $this->helper->getNovalnetGlobalPath() . $field;
 
682
  if ($field == 'live_mode') {
683
- $getTestmodePayments = Mage::getStoreConfig($path, $storeId);
684
- if (!preg_match('/' . $this->_code . '/i', $getTestmodePayments)) {
685
  return false;
686
  }
687
  return true;
@@ -692,6 +910,37 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
692
  return null;
693
  }
694
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
  /**
696
  * Send order_no to server after the Completion of payment
697
  *
@@ -704,28 +953,50 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
704
  $request = $result = array();
705
  $helper = $this->helper;
706
  $paymentKey = $helper->getPaymentId($this->_code);
707
- $payportUrl = $helper->getPayportUrl('paygate');
708
- if ($this->_validateBasicParams() && $this->helper->checkIsNumeric($paymentKey)) {
709
- $request = array(
710
- 'vendor' => $this->_vendorId,
711
- 'auth_code' => $this->_authcode,
712
- 'product' => $this->_productId,
713
- 'tariff' => $this->_tariffId,
714
- 'key' => $paymentKey,
715
- 'tid' => $response->getTid(),
716
- 'status' => Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED,
717
- 'order_no' => $this->_getOrderId()
718
- );
719
  if ($request['key'] == 27) {
720
  $request['invoice_ref'] = 'BNR-' . $request['product'] . '-' . $request['order_no'];
721
  }
 
722
  $result = new Varien_Object();
723
- $response = $this->_setNovalnetRequestCall($request, $payportUrl);
724
  $result = $response->getRawBody();
 
 
 
 
 
725
  }
726
  return $result;
727
  }
728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
  /**
730
  * Check the transaction status using API
731
  *
@@ -734,16 +1005,31 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
734
  * @param string $type
735
  * @return mixed
736
  */
737
- private function _setNovalnetRequestCall($requestData, $requestUrl, $type = "")
738
  {
739
  if ($requestUrl == "") {
740
  $this->showException('Server Request URL is Empty');
741
  return;
742
  }
743
  $httpClientConfig = array('maxredirects' => 0);
744
- if (((int) $this->_getConfigData('gateway_timeout')) > 0) {
745
- $httpClientConfig['timeout'] = (int) $this->_getConfigData('gateway_timeout');
 
 
 
 
 
 
 
 
 
746
  }
 
 
 
 
 
 
747
  $client = new Varien_Http_Client($requestUrl, $httpClientConfig);
748
 
749
  if ($type == 'XML') {
@@ -753,6 +1039,7 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
753
  $client->setParameterPost($requestData)->setMethod(Varien_Http_Client::POST);
754
  }
755
  $response = $client->request();
 
756
  if (!$response->isSuccessful()) {
757
  $this->showException($this->helper->__('Gateway request error: %s', $response->getMessage()), false);
758
  }
@@ -764,9 +1051,9 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
764
  }
765
 
766
  /**
767
- * Set the novalnet parameter based on payment code
768
  *
769
- * @param varien_object $request
770
  * @param string $paymentCode
771
  * @return mixed
772
  */
@@ -775,7 +1062,6 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
775
  $helper = $this->helper;
776
  $dataHelper = $this->dataHelper;
777
  if ($paymentCode) {
778
- $methodSession = $this->_getCheckout()->getData($paymentCode);
779
  switch ($paymentCode) {
780
  case Novalnet_Payment_Model_Config::NN_INVOICE:
781
  $paymentDuration = trim($this->_getConfigData('payment_duration'));
@@ -793,55 +1079,50 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
793
  case Novalnet_Payment_Model_Config::NN_SOFORT:
794
  case Novalnet_Payment_Model_Config::NN_PAYPAL:
795
  case Novalnet_Payment_Model_Config::NN_IDEAL:
796
- $this->_password = $this->_getConfigData('password', true);
 
797
  $request->setUniqid(uniqid())
798
  ->setCountryCode($request->getCountry())
799
- ->setSession(session_id());
800
-
801
- if ($paymentCode == Novalnet_Payment_Model_Config::NN_PAYPAL) {
802
- $request->setApiSignature($helper->getEncodedParam($this->_getConfigData('api_sign', true), $this->_password))
803
- ->setApiUser($helper->getEncodedParam($this->_getConfigData('api_user', true), $this->_password))
804
- ->setApiPw($helper->getEncodedParam($this->_getConfigData('api_password', true), $this->_password));
805
- }
806
-
807
  $this->dataHelper->assignNovalnetReturnData($request, $this->_code);
808
- $this->dataHelper->importNovalnetEncodeData($request, $this->_password);
809
  break;
810
  case Novalnet_Payment_Model_Config::NN_CC:
 
811
  $request->setCcHolder()
812
  ->setCcNo()
813
  ->setCcExpMonth()
814
  ->setCcExpYear()
815
- ->setCcType()
816
- ->setCcCvc2($methodSession->getNnCcCvc())
817
- ->setPanHash($methodSession->getCcPanHash())
818
- ->setUniqueId($methodSession->getCcUniqueId());
819
  if ($this->_code == Novalnet_Payment_Model_Config::NN_CC && !$helper->checkIsAdmin()
820
  && $this->_getConfigData('active_cc3d') == 1) {
821
- $this->_password = $this->_getConfigData('password', true);
822
  $amount = $helper->getFormatedAmount($this->_getAmount());
 
823
  $request->setCountryCode($request->getCountry())
824
  ->setSession(session_id())
825
- ->setencodedAmount($helper->getEncodedParam($amount, $this->_password));
826
  $dataHelper->assignNovalnetReturnData($request, $this->_code);
827
  $request->unsUserVariable_0(); // Unset uservariable as CC3D doesnot requires it
828
  }
829
  break;
830
  case Novalnet_Payment_Model_Config::NN_SEPA:
831
- $request->setBankAccountHolder($methodSession->getSepaHolder())
 
832
  ->setBankAccount()
833
  ->setBankCode()
834
  ->setBic()
835
  ->setIban()
836
- ->setSepaHash($methodSession->getSepaHash())
837
- ->setSepaUniqueId($methodSession->getSepaUniqueId())
838
- ->setIbanBicConfirmed($methodSession->getIbanConfirmed());
839
 
840
  $paymentDuration = trim($this->_getConfigData('sepa_due_date'));
841
  $dueDate = (!$paymentDuration) ? date('Y-m-d', strtotime('+7 days'))
842
  : date('Y-m-d', strtotime('+' . $paymentDuration . ' days'));
843
  $request->setSepaDueDate($dueDate);
844
-
845
  break;
846
  }
847
  }
@@ -849,50 +1130,54 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
849
  }
850
 
851
  /**
852
- * Validate the novalnet response
853
  *
854
  * @param varien_object $payment
855
- * @param varien_object $result
856
  * @return boolean
857
  */
858
  public function validateNovalnetResponse($payment, $result = NULL)
859
  {
860
  $order = $payment->getOrder();
861
- $request = $this->_getMethodSession()->getPaymentReqData();
862
- $orderId = isset($result) && $result->getOrderNo() ? $result->getOrderNo()
863
- : $order->getIncrementId();
864
 
865
  switch ($result->getStatus()) {
866
  case Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED:
 
867
  $txnId = trim($result->getTid());
868
- $data = $this->_setPaymentAddtionaldata($result);
869
- /** @@ Update the transaction status and transaction overview * */
 
 
 
870
  $payment->setStatus(self::STATUS_APPROVED)
 
871
  ->setAdditionalData(serialize($data))
872
  ->save();
873
  $order->setPayment($payment);
874
  $order->save();
875
 
876
- $getTransactionStatus = $this->doNovalnetStatusCall($txnId, $payment);
 
877
  $result->setStatus($getTransactionStatus->getStatus());
878
- $this->helper->doTransactionStatusSave($result, $getTransactionStatus, $payment);
879
- // check magento version
880
- $magentoVersion = $this->_getHelper()->getMagentoVersion();
881
- $captureMode = (version_compare($magentoVersion, '1.6', '<')) ? false
882
  : true;
883
- $responseCodeApproved = ($getTransactionStatus->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED);
884
 
885
  // Capture the payment only if status is 100
886
- if ($order->canInvoice() && $responseCodeApproved && $this->_code
887
- != Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
888
  $payment->setTransactionId($txnId) // Add capture text to make the new transaction
889
  ->setIsTransactionClosed($captureMode) // Close the transaction
890
  ->capture(null)
891
  ->save();
892
- $orderStatus = $this->_getConfigData('order_status')
893
- ? $this->_getConfigData('order_status') : Mage_Sales_Model_Order::STATE_PROCESSING; // If after status is empty set default status
894
- $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $orderStatus, $this->helper->__('Payment was successful.'), true);
895
  }
 
896
  $payment->setTransactionId($txnId)
897
  ->setLastTransId($txnId)
898
  ->setParentTransactionId(null)
@@ -905,8 +1190,8 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
905
  $this->logNovalnetTransactionData($request, $result, $txnId, $this->helper->getCustomerId(), $this->helper->getMagentoStoreId());
906
  }
907
  $statusText = ($result->getStatusText()) ? $result->getStatusText()
908
- : $this->helper->__('successful');
909
- Mage::getSingleton('core/session')->addSuccess($statusText);
910
  $error = false;
911
  break;
912
  default:
@@ -917,78 +1202,108 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
917
  }
918
  if ($error !== false) {
919
  $this->saveCancelledOrder($result, $payment);
920
- Mage::getSingleton('core/session')->addError($error);
921
  }
922
  break;
923
  }
924
  return $error;
925
  }
926
 
927
- /**
928
- * payment method cancellation process
929
- *
930
- * @param varien_object $result
931
- * @param varien_object $payment
932
- */
933
- public function saveCancelledOrder($result, $payment)
934
- {
935
- $order = $payment->getOrder();
936
-
937
- $statusMessage = $result->getStatusMessage() ? $result->getStatusMessage() : ($result->getStatusDesc() ? $result->getStatusDesc()
938
- : ($result->getStatusText() ? $result->getStatusText() : $this->helper->__('Payment was not successfull')));
939
-
940
- $paystatus = "<b><font color='red'>" . $this->helper->__('Payment Failed') . "</font> - " . $statusMessage . "</b>";
941
- $data = unserialize($payment->getAdditionalData());
942
- //set Novalnet Mode
943
- $authorizeKey = $this->_getConfigData('password', true);
944
- $serverResponse = ($result->getTestMode() && is_numeric($result->getTestMode()))
945
- ? $result->getTestMode()
946
- : $this->helper->getDecodedParam($result->getTestMode(), $authorizeKey);
947
- $shopMode = $this->_getConfigData('live_mode', true);
948
- $testMode = (((isset($serverResponse) && $serverResponse == 1) || (isset($shopMode)
949
- && $shopMode == 0)) ? 1 : 0 );
950
- $data['NnTestOrder'] = $testMode;
951
- $data['NnComments'] = $paystatus;
952
- $payment->setLastTransId($result->getTid())
953
- ->setAdditionalData(serialize($data))
954
- ->save();
955
- $order->registerCancellation($statusMessage)
956
- ->save();
957
- }
958
-
959
  /**
960
  * Set Payment method additional informations
961
  *
962
  * @param varien_object $result
963
- * @return array
 
964
  */
965
- private function _setPaymentAddtionaldata($result)
966
  {
967
  $txnId = trim($result->getTid());
968
- $request = $this->_getMethodSession()->getPaymentReqData();
969
- //set Novalnet Mode
970
  $responseTestMode = $result->getTestMode();
971
  $shopMode = $this->_getConfigData('live_mode');
972
  $testMode = (((isset($responseTestMode) && $responseTestMode == 1) || (isset($shopMode)
973
  && $shopMode == 0)) ? 1 : 0 );
 
 
 
 
 
 
974
  $data = array('NnTestOrder' => $testMode,
975
  'NnTid' => $txnId,
976
- 'orderNo' => $request->getOrderNo(),
977
  'vendor' => ($request->getVendor()) ? $request->getVendor() : $this->_vendorId,
978
  'auth_code' => ($request->getAuthCode()) ? $request->getAuthCode() : $this->_authcode,
979
  'product' => ($request->getProduct()) ? $request->getProduct() : $this->_productId,
980
  'tariff' => ($request->getTariff()) ? $request->getTariff() : $this->_tariffId,
981
  'key' => ($request->getKey()) ? $request->getKey() : $this->helper->getPaymentId($this->_code),
982
  );
 
983
  if (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_INVOICE,
984
  Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
985
- $data['NnNote'] = $this->dataHelper->getNote($result);
986
- $data['NnNoteAmount'] = $this->dataHelper->getBankDetailsAmount($result->getAmount());
987
- $data['NnNoteTID'] = $this->dataHelper->getBankDetailsTID($txnId, $data);
 
 
 
988
  }
989
  return $data;
990
  }
991
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
992
  /**
993
  * Validate the transaction status
994
  *
@@ -996,17 +1311,25 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
996
  * @param varien_object $payment
997
  * @param string $reqType
998
  * @param varien_object $extraOption
 
 
999
  * @return mixed
1000
  */
1001
- public function doNovalnetStatusCall($tid, $payment = NULL, $reqType = Novalnet_Payment_Model_Config::TRANS_STATUS,
1002
- $extraOption = NULL, $requestData = NULL
1003
- ) {
1004
  $requestType = ($reqType == Novalnet_Payment_Model_Config::TRANS_STATUS)
1005
  ? Novalnet_Payment_Model_Config::TRANS_STATUS : $reqType;
 
1006
  if ($payment != NULL) {
1007
  $this->assignVendorConfig($payment);
1008
- } else {
1009
- $this->_manualCheckValidate();
 
 
 
 
 
1010
  }
1011
 
1012
  $request = '<?xml version="1.0" encoding="UTF-8"?>';
@@ -1020,8 +1343,7 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1020
 
1021
  if ($this->_vendorId && $this->_authcode && $this->_productId) {
1022
  $infoRequestUrl = $this->helper->getPayportUrl('infoport');
1023
- $result = $this->_setNovalnetRequestCall($request, $infoRequestUrl, 'XML');
1024
-
1025
  if ($requestType == 'NOVALTEL_STATUS') {
1026
  $requestData->setData($request);
1027
  }
@@ -1029,6 +1351,28 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1029
  }
1030
  }
1031
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1032
  /**
1033
  * Get checkout session
1034
  *
@@ -1037,35 +1381,31 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1037
  protected function _getCheckout()
1038
  {
1039
  if ($this->helper->checkIsAdmin()) {
1040
- return $this->helper->_getAdminCheckoutSession();
1041
  } else {
1042
- return $this->helper->_getCheckoutSession();
1043
  }
1044
  }
1045
 
1046
  /**
1047
- * validate novalnet params to proceed checkout
1048
  *
1049
- * @return bool
1050
  */
1051
  public function validateNovalnetParams()
1052
  {
1053
- $infoObjBilling = $this->_getInfoObject()->getBillingAddress();
 
1054
  $quoteBilling = $this->_getCheckout()->getQuote()->getBillingAddress();
1055
- $cusEmail = ($quoteBilling->getEmail()) ? $quoteBilling->getEmail() : $this->_getInfoObject()->getCustomerEmail();
1056
  $cusFirstname = ($quoteBilling->getFirstname()) ? $quoteBilling->getFirstname()
1057
  : $infoObjBilling->getFirstname();
1058
  $cusLastname = ($quoteBilling->getLastname()) ? $quoteBilling->getLastname()
1059
  : $infoObjBilling->getLastname();
1060
- $manualCheckAmt = (int) $this->_getConfigData('manual_checking_amount');
1061
  $helper = $this->helper;
1062
  if (!$this->_validateBasicParams()) {
1063
  $this->showException($helper->__('Basic parameter not valid') . '!', false);
1064
  return false;
1065
- } elseif ($manualCheckAmt && (!$helper->checkIsNumeric($manualCheckAmt) || !$helper->checkIsNumeric($this->_getConfigData('second_product_id'))
1066
- || !$helper->checkIsNumeric($this->_getConfigData('second_tariff_id')))) {
1067
- $this->showException($helper->__('Manual limit amount / Product-ID2 / Tariff-ID2 is not valid') . '!', false);
1068
- return false;
1069
  } elseif (!$helper->validateEmail($cusEmail) || !$cusFirstname || !$cusLastname) {
1070
  $this->showException($helper->__('Customer name/email fields are not valid') . '!', false);
1071
  return false;
@@ -1074,33 +1414,42 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1074
  }
1075
 
1076
  /**
1077
- * validate manual check-limit and reassign product id and tariff id
1078
  *
1079
- * @param integer $storeId
1080
- * @param float $amount
1081
  */
1082
- private function _manualCheckValidate($storeId = NULL, $amount = NULL)
1083
  {
1084
- $amount = $this->helper->getFormatedAmount(($amount) ? $amount : $this->_getAmount());
1085
- $storeId = is_null($storeId) ? $this->helper->getMagentoStoreId() : $storeId;
1086
- $manualCheckAmt = (int) $this->_getConfigData('manual_checking_amount', false, $storeId);
1087
- $this->_productId = (strlen(trim($this->_getConfigData('second_product_id', false, $storeId)))
1088
- && $manualCheckAmt && $manualCheckAmt <= $amount) ? trim($this->_getConfigData('second_product_id', false, $storeId))
1089
- : trim($this->_getConfigData('product_id', true, $storeId));
1090
- $this->_tariffId = (strlen(trim($this->_getConfigData('second_tariff_id', false, $storeId)))
1091
- && $manualCheckAmt && $manualCheckAmt <= $amount) ? trim($this->_getConfigData('second_tariff_id', false, $storeId))
1092
- : trim($this->_getConfigData('tariff_id', true, $storeId));
 
 
1093
  }
1094
 
1095
  /**
1096
- * validate novalnet basic params
1097
  *
1098
- * @return bool
1099
  */
1100
  private function _validateBasicParams()
1101
  {
 
1102
  $helper = $this->helper;
 
1103
  if ($helper->checkIsNumeric($this->_vendorId) && $this->_authcode && $helper->checkIsNumeric($this->_productId)
 
 
 
 
 
1104
  && $helper->checkIsNumeric($this->_tariffId)) {
1105
  return true;
1106
  }
@@ -1118,20 +1467,25 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1118
  $total = $this->helper->getFormatedAmount($this->_getAmount());
1119
  $callBackMinimum = (int) $this->_getConfigData('callback_minimum_amount');
1120
  $countryCode = strtoupper($this->_getInfoObject()->getBillingAddress()->getCountryId());
 
 
 
 
 
 
1121
 
1122
- return $this->helper->_getCheckoutSession()->$callbackTid() || ($this->_getConfigData('callback')
1123
- && ($callBackMinimum ? $total >= $callBackMinimum : true) && ($this->helper->isCallbackTypeAllowed($countryCode)));
1124
  }
1125
 
1126
  /**
1127
  * Initiate callback process after selecting payment method
1128
  *
1129
- * $param string $paymentCode
1130
- * @return bool
1131
  */
1132
- private function _initiateCallbackProcess($paymentCode)
1133
  {
1134
- $infoInstance = $this->getInfoInstance();
1135
  $isCallbackTypeCall = $this->isCallbackTypeCall();
1136
  $isPlaceOrder = $this->_isPlaceOrder();
1137
 
@@ -1142,68 +1496,74 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1142
  $callbackNewPin = "getNnNewCallbackPin" . $payCode;
1143
  $setcallbackPin = "setNnCallbackPin" . $payCode;
1144
 
1145
- if (!$isPlaceOrder && $isCallbackTypeCall && $this->_getIncrementId() && $this->_getMethodSession()->$callbackOrderNo()
1146
- && ($this->_getIncrementId() != $this->_getMethodSession()->$callbackOrderNo())) {
1147
  $this->unsetMethodSession();
1148
  }
1149
- //validate callback session
1150
- $this->_validateCallbackSession();
1151
  $methodSession = $this->_getMethodSession();
 
 
 
1152
  if ($isCallbackTypeCall && $infoInstance->getCallbackPinValidationFlag()
1153
  && $methodSession->$callbackTid()) {
1154
  $nnCallbackPin = $infoInstance->$callbackPin();
1155
  if (!$infoInstance->$callbackNewPin() && (!$this->helper->checkIsValid($nnCallbackPin)
1156
  || empty($nnCallbackPin))) {
1157
- $this->showException('PIN you have entered is incorrect or empty!');
1158
  }
1159
  }
1160
- if (!$isPlaceOrder && $isCallbackTypeCall && $this->_getConfigData('callback')
1161
  != 3) {
1162
  if ($methodSession->$callbackTid()) {
1163
  if ($infoInstance->$callbackNewPin()) {
1164
- $this->_regenerateCallbackPin();
1165
  } else {
1166
  $methodSession->$setcallbackPin($infoInstance->$callbackPin());
1167
  }
1168
  } else {
1169
- $this->_generateCallback();
1170
  }
1171
- } elseif (!$isPlaceOrder && $isCallbackTypeCall && $this->_getConfigData('callback')
1172
  == 3) {
1173
 
1174
  if (!$methodSession->$callbackTid()) {
1175
- $this->_generateCallback();
1176
  }
1177
  }
1178
  if ($isPlaceOrder) {
1179
- $this->_validateCallbackProcess();
1180
  }
1181
  }
1182
 
1183
  /**
1184
- * validate order amount is getting changed after callback initiation
1185
  *
 
 
1186
  * throw Mage Exception
1187
  */
1188
- private function _validateCallbackSession()
1189
  {
1190
- $payCode = ucfirst($this->_code);
1191
  $callbackTid = "hasNnCallbackTid" . $payCode;
1192
  $getNnDisableTime = "getNnDisableTime" . $payCode;
1193
- $methodSession = $this->_getMethodSession();
1194
  $checkoutSession = $this->_getCheckout();
 
 
 
 
 
 
 
 
1195
 
1196
  if ($methodSession->$callbackTid()) {
1197
  if ($checkoutSession->$getNnDisableTime() && time() > $checkoutSession->$getNnDisableTime()) {
1198
  $this->unsetMethodSession();
1199
- } elseif ($methodSession->getOrderAmount() != $this->helper->getFormatedAmount($this->_getAmount())) {
1200
  $this->unsetMethodSession();
1201
- if (!$this->_isPlaceOrder() && $this->_getConfigData('callback')
1202
- != 3) {
1203
- $this->showException('You have changed the order amount after getting PIN number, please try again with a new call');
1204
- } else if (!$this->_isPlaceOrder() && $this->_getConfigData('callback')
1205
- == 3) {
1206
- $this->showException('You have changed the order amount after getting e-mail, please try again with a new call');
1207
  }
1208
  }
1209
  }
@@ -1216,7 +1576,7 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1216
  */
1217
  private function _getIncrementId()
1218
  {
1219
- $storeId = $this->_getHelper()->getMagentoStoreId();
1220
  $orders = Mage::getModel('sales/order')->getCollection()
1221
  ->addAttributeToFilter('store_id', $storeId)
1222
  ->setOrder('entity_id', 'DESC');
@@ -1232,16 +1592,28 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1232
  /**
1233
  * Make callback request and validate response
1234
  *
 
1235
  */
1236
- private function _generateCallback()
1237
  {
1238
- $payCode = ucfirst($this->_code);
1239
  $callbackTid = "setNnCallbackTid" . $payCode;
1240
  $callbackOrderNo = "setNnCallbackOrderNo" . $payCode;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1241
 
1242
- $request = $this->buildRequest(Novalnet_Payment_Model_Config::POST_CALLBACK);
1243
- $response = $this->postRequest($request);
1244
- $this->logNovalnetTransactionData($request, $response, $response->getTid());
1245
  if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
1246
  $this->_getMethodSession()
1247
  ->$callbackTid(trim($response->getTid()))
@@ -1249,13 +1621,13 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1249
  ->setNnCallbackTidTimeStamp(time())
1250
  ->setOrderAmount($request->getAmount())
1251
  ->setNnCallbackSuccessState(true)
1252
- ->$callbackOrderNo(trim($response->getOrderNo()))
1253
- ->setPaymentResData($response)
1254
- ->setPaymentReqData($request);
1255
  if ($this->_getConfigData('callback') == 3) {
1256
  $text = $this->helper->__('Please reply to the e-mail');
 
 
1257
  } else {
1258
- $text = $this->helper->__('You will shortly receive a PIN by phone / SMS. Please enter the PIN in the appropriate text box');
1259
  }
1260
  } else {
1261
  $text = $this->helper->htmlEscape($response->getStatusDesc());
@@ -1266,27 +1638,31 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1266
  /**
1267
  * Regenerate new pin for callback process
1268
  *
 
 
1269
  */
1270
- private function _regenerateCallbackPin()
1271
  {
1272
  $callbackTid = "getNnCallbackTid" . ucfirst($this->_code);
1273
- $methodSession = $this->_getMethodSession();
1274
  $response = $this->doNovalnetStatusCall($methodSession->$callbackTid(), NULL, Novalnet_Payment_Model_Config::TRANSMIT_PIN_AGAIN);
 
1275
  if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
1276
- $text = $this->helper->__('You will shortly receive a PIN by phone / SMS. Please enter the PIN in the appropriate text box');
1277
  } else {
1278
- $text = $this->helper->htmlEscape($response->getStatusMessage()); //status_message
1279
  }
 
1280
  $this->showException($text, false);
1281
  }
1282
 
1283
  /**
1284
- * validate callback response
1285
  *
 
 
1286
  */
1287
- private function _validateCallbackProcess()
1288
  {
1289
- $payCode = ucfirst($this->_code);
1290
  $callbackTid = "getNnCallbackTid" . $payCode;
1291
  $callbackPin = "getNnCallbackPin" . $payCode;
1292
  $setNnDisableTime = "setNnDisableTime" . $payCode;
@@ -1320,36 +1696,99 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1320
  }
1321
 
1322
  /**
1323
- * Log novalnet transaction data
1324
  *
1325
  * @param varien_object $request
1326
  * @param varien_object $response
1327
  * @param int $txnId
1328
  * @param int $customerId
1329
  * @param int $storeId
 
 
1330
  */
1331
- public function logNovalnetTransactionData($request, $response, $txnId,
1332
- $customerId = NULL, $storeId = NULL
1333
- ) {
 
1334
  $this->dataHelper->doRemoveSensitiveData($request, $this->_code);
1335
- $shopUrl = ($response->getMemburl()) ? $response->getMemburl() : $this->helper->getCurrentSiteUrl();
1336
- $customerId = ($customerId) ? $customerId : $this->helper->getCustomerId();
1337
- $storeId = ($storeId) ? $storeId : $this->helper->getMagentoStoreId();
1338
- $modNnTransOverview = $this->helper->getModelTransactionOverview();
1339
- $modNnTransOverview->setTransactionId($txnId)
1340
- ->setOrderId($this->_getOrderId())
 
 
 
 
 
1341
  ->setRequestData(serialize($request->getData()))
1342
- ->setResponseData(serialize($response->getData()))
1343
  ->setCustomerId($customerId)
1344
  ->setStatus($response->getStatus())
1345
  ->setStoreId($storeId)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1346
  ->setShopUrl($shopUrl)
1347
- ->setCreatedDate($this->helper->getCurrentDateTime())
1348
  ->save();
1349
  }
1350
 
1351
  /**
1352
- * Get current info-instance
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1353
  *
1354
  * @return Mage_Payment_Model_Method_Abstract
1355
  */
@@ -1379,7 +1818,7 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1379
  /**
1380
  * Whether current operation is order placement
1381
  *
1382
- * @return bool
1383
  */
1384
  private function _isPlaceOrder()
1385
  {
@@ -1392,9 +1831,9 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1392
  }
1393
 
1394
  /**
1395
- * Grand total getter
1396
  *
1397
- * @return float
1398
  */
1399
  private function _getAmount()
1400
  {
@@ -1421,10 +1860,25 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1421
  }
1422
  }
1423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1424
  /**
1425
  * Retrieve model helper
1426
  *
1427
- * @return Novalnet_Paymenthelper_Data
1428
  */
1429
  protected function _getHelper()
1430
  {
@@ -1434,7 +1888,7 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1434
  /**
1435
  * Retrieve Assign data helper
1436
  *
1437
- * @return Novalnet_Paymenthelper_AssignData
1438
  */
1439
  protected function _getDataHelper()
1440
  {
@@ -1448,13 +1902,12 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1448
  * @param $lang
1449
  * @return Mage::throwException
1450
  */
1451
- public function showException($string, $lang = true)
1452
  {
1453
  if ($lang) {
1454
- $string = $this->helper->__($string);
1455
  }
1456
-
1457
- return Mage::throwException($string);
1458
  }
1459
 
1460
  /**
@@ -1472,20 +1925,48 @@ class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_
1472
  }
1473
  }
1474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1475
  /**
1476
  * Get redirect URL
1477
  *
1478
- * @return Mage_Paymenthelper_Data
1479
  */
1480
  public function getOrderPlaceRedirectUrl()
1481
  {
1482
  $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
 
1483
  if ((in_array($this->_code, $redirectPayment)) || ($this->_code == Novalnet_Payment_Model_Config::NN_CC
1484
- && !$this->helper->checkIsAdmin() && $this->_getConfigData('active_cc3d')
1485
  == 1)) {
1486
- $actionUrl = $this->_getHelper()->getUrl(Novalnet_Payment_Model_Config::GATEWAY_REDIRECT_URL);
1487
  } else {
1488
- $actionUrl = $this->_getHelper()->getUrl(Novalnet_Payment_Model_Config::GATEWAY_DIRECT_URL);
1489
  }
1490
  return $actionUrl;
1491
  }
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_Abstract extends Mage_Payment_Model_Method_Abstract
27
+ implements Mage_Payment_Model_Recurring_Profile_MethodInterface
28
  {
 
29
  protected $_isGateway = false;
30
+ protected $_canAuthorize = true;
31
  protected $_canCapture = false;
32
  protected $_canCapturePartial = false;
33
  protected $_canRefund = true;
38
  protected $_canUseForMultishipping = false;
39
  protected $_canSaveCc = false;
40
  protected $_isInitializeNeeded = false;
 
 
41
  protected $_canCancelInvoice = false;
42
  protected $_methodType = '';
43
  protected $_redirectUrl = '';
58
  $this->_authcode = $this->_getConfigData('auth_code', true);
59
  $this->_productId = $this->_getConfigData('product_id', true);
60
  $this->_tariffId = $this->_getConfigData('tariff_id', true);
61
+ $this->_subscribTariffId = $this->_getConfigData('subscrib_tariff_id', true);
62
+ $this->_referrerId = trim($this->_getConfigData('referrer_id', true));
63
+ //Manual Check Limits
64
+ $this->_manualCheckLimit = (int) $this->_getConfigData('manual_checking_amount',true);
65
+ }
66
+
67
+ /**
68
+ * Validate recurring profile data
69
+ *
70
+ * @param Mage_Payment_Model_Recurring_Profile $profile
71
+ * @return boolean
72
+ */
73
+ public function validateRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile)
74
+ {
75
+ return true;
76
+ }
77
+
78
+ /**
79
+ * Submit recurring profile to the gateway
80
+ *
81
+ * @param Mage_Payment_Model_Recurring_Profile $profile
82
+ * @param Mage_Payment_Model_Info $paymentInfo
83
+ */
84
+ public function submitRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile, Mage_Payment_Model_Info $paymentInfo)
85
+ {
86
+ if ($profile->getTrialPeriodUnit() && $profile->getTrialPeriodFrequency()) {
87
+ $this->showException($this->helper->__('Trial Billing Cycles are not support novalnet payment'), false);
88
+ }
89
+ $this->helper->getModelRecurring()->getProfileProgress($profile);
90
+ }
91
+
92
+ /**
93
+ * Fetch recurring profile details
94
+ *
95
+ * @param string $referenceId
96
+ * @param Varien_Object $result
97
+ * @return boolean
98
+ */
99
+ public function getRecurringProfileDetails($referenceId, Varien_Object $result)
100
+ {
101
+ return true;
102
+ }
103
+
104
+ /**
105
+ * Whether can get recurring profile details
106
+ *
107
+ * @return boolean
108
+ */
109
+ public function canGetRecurringProfileDetails()
110
+ {
111
+ return true;
112
+ }
113
+
114
+ /**
115
+ * Update recurring profile data
116
+ *
117
+ * @param Mage_Payment_Model_Recurring_Profile $profile
118
+ * @return boolean
119
+ */
120
+ public function updateRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile)
121
+ {
122
+ return true;
123
+ }
124
+
125
+ /**
126
+ * Manage status
127
+ *
128
+ * @param Mage_Payment_Model_Recurring_Profile $profile
129
+ */
130
+ public function updateRecurringProfileStatus(Mage_Payment_Model_Recurring_Profile $profile)
131
+ {
132
+ $helper = $this->helper;
133
+ $recuring = $helper->getModelRecurring();
134
+ $orderNo = $recuring->getRecurringOrderNo($profile);
135
+ $order = $recuring->getOrderByIncrementId($orderNo);
136
+ $payment = $order->getPayment();
137
+ $paymentObj = $payment->getMethodInstance();
138
+ $subsId = $payment->getAdditionalInformation('subs_id');
139
+ $customerId = $order->getCustomerId();
140
+ $orderItems = $order->getAllItems();
141
+ $nominalItem = $helper->checkNominalItem($orderItems);
142
+ $getRequest = Mage::app()->getRequest()->getQuery();
143
+ $storeId = $helper->getMagentoStoreId();
144
+
145
+ if ($profile->getNewState() == 'canceled') {
146
+ $httpClientConfig = array('maxredirects' => 0);
147
+ if (((int) $this->_getConfigData('gateway_timeout',true)) > 0) {
148
+ $httpClientConfig['timeout'] = (int) $this->_getConfigData('gateway_timeout',true);
149
+ }
150
+ $recurringCancelUrl = $helper->getPayportUrl('paygate');
151
+ $client = new Varien_Http_Client($recurringCancelUrl, $httpClientConfig);
152
+ $request = new Varien_Object();
153
+ $paymentObj->assignOrderBasicParams($request, $payment, $storeId, $nominalItem);
154
+ $request->setNnLang(strtoupper($helper->getDefaultLanguage()))
155
+ ->setCancelSub(1)
156
+ ->setCancelReason($getRequest['reason'])
157
+ ->setTid($profile->getReferenceId());
158
+ $buildNovalnetParam = http_build_query($request->getData());
159
+ $response = $this->dataHelper->setRawCallRequest($buildNovalnetParam, $recurringCancelUrl);
160
+ $data = unserialize($payment->getAdditionalData());
161
+ $data['subsCancelReason'] = $getRequest['reason'];
162
+ $payment->setAdditionalData(serialize($data))->save();
163
+ $this->logNovalnetTransactionData($request, $response, $profile->getReferenceId(), $customerId, $storeId, $orderNo);
164
+ if ($response->getStatus() != 100) {
165
+ $this->showException($response->getStatusDesc(), false);
166
+ }
167
+ } else if ($profile->getNewState() == 'suspended' || $profile->getNewState() == 'active') {
168
+ $this->infoRequestxml($profile->getNewState(), $profile, $subsId, $storeId, $customerId, $orderNo);
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Recurring profile Suspend or Activate
174
+ *
175
+ * @param string $action
176
+ * @param Mage_Payment_Model_Recurring_Profile $profile
177
+ * @param int $subsId
178
+ * @param int $storeId
179
+ * @param int $customerId
180
+ * @param int $orderNo
181
+ */
182
+ private function infoRequestxml($action, $profile, $subsId, $storeId, $customerId, $orderNo)
183
+ {
184
+ $helper = $this->helper;
185
+ if ($action == 'suspended') {
186
+ $pausePeriod = 1;
187
+ $pausePeriodUnit = 'd';
188
+ $suspend = 1;
189
+ $subsIdRequest = $subsId;
190
+ } else {
191
+ $periodInfo = $this->getPeriodValues($profile);
192
+ $pausePeriod = $periodInfo['periodFrequency'];
193
+ $pausePeriodUnit = $periodInfo['periodUnit'];
194
+ $suspend = 0;
195
+ $subsIdRequest = $subsId;
196
+ $subsId = NULL;
197
+ }
198
+ $request = '<?xml version="1.0" encoding="UTF-8"?>';
199
+ $request .= '<nnxml><info_request>';
200
+ $request .= '<vendor_id>' . $this->_vendorId . '</vendor_id>';
201
+ $request .= '<vendor_authcode>' . $this->_authcode . '</vendor_authcode>';
202
+ $request .= '<request_type>' . Novalnet_Payment_Model_Config::SUBS_PAUSE . '</request_type>';
203
+ $request .= '<product_id>' . $this->_productId . '</product_id>';
204
+ $request .= '<tid>' . $profile->getReferenceId() . '</tid>';
205
+ $request .= '<subs_id>' . $subsIdRequest . '</subs_id>';
206
+ $request .= '<pause_period>' . $pausePeriod . '</pause_period>';
207
+ $request .= '<pause_time_unit>' . $pausePeriodUnit . '</pause_time_unit>';
208
+ $request .= '<suspend>' . $suspend . '</suspend>';
209
+ $request .= '</info_request></nnxml>';
210
+
211
+ $infoRequestUrl = $helper->getPayportUrl('infoport');
212
+ $result = $this->setNovalnetRequestCall($request, $infoRequestUrl, 'XML');
213
+ $xml = simplexml_load_string($request);
214
+ $json = json_encode($xml);
215
+ $array = json_decode($json, TRUE);
216
+ $request = new Varien_Object($array);
217
+ $this->logNovalnetTransactionData($request, $result, $profile->getReferenceId(), $customerId, $storeId, $orderNo, $subsId);
218
+ if ($result->getStatus() != 100) {
219
+ $statusDesc = $result->getStatusDesc();
220
+ if ($action == 'suspended') {
221
+ $statusDesc = $result->getSubscriptionPause();
222
+ $statusDesc = $statusDesc['status_message'];
223
+ }
224
+ $this->showException($statusDesc, false);
225
+ }
226
+ }
227
+
228
+ /**
229
+ * Get subscription period frequency and unit
230
+ *
231
+ * @param Mage_Payment_Model_Recurring_Profile $profile
232
+ * @return array
233
+ */
234
+ public function getPeriodValues($profile) {
235
+ $periodFrequency = $profile->getperiodFrequency();
236
+ $periodUnit = $this->helper->__(ucfirst($profile->getperiodUnit()));
237
+
238
+ $day = $this->helper->__('Day');
239
+ $month = $this->helper->__('Month');
240
+ $year = $this->helper->__('Year');
241
+
242
+ $periodUnitFormat = array($day => "d", $month => "m", $year => "y");
243
+
244
+ if ($periodUnit == 'Semi_month') {
245
+ $tariffPeriod2 = array('periodFrequency' => '14', 'periodUnit' => 'd');
246
+ } else if ($periodUnit == 'Week') {
247
+ $tariffPeriod2 = array('periodFrequency' => ($periodFrequency * 7), 'periodUnit' => 'd');
248
+ } else {
249
+ $tariffPeriod2 = array('periodFrequency' => $periodFrequency, 'periodUnit' => $periodUnitFormat[$periodUnit]);
250
+ }
251
+
252
+ return $tariffPeriod2;
253
  }
254
 
255
  /**
256
  * Check whether payment method can be used
257
  *
258
  * @param Mage_Sales_Model_Quote
259
+ * @return boolean
260
  */
261
  public function isAvailable($quote = null)
262
  {
263
+ $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
264
  $getNnDisableTime = "getNnDisableTime" . ucfirst($this->_code); //Dynamic Getter based on payment methods
265
  $minOrderCount = $this->_getConfigData('orderscount');
266
  $userGroupId = $this->_getConfigData('user_group_excluded');
267
+ $helper = $this->helper;
268
 
269
+ if ($helper->checkOrdersCount($minOrderCount)) {
270
+ return false;
271
+ } else if (!$helper->checkCustomerAccess($userGroupId)) {
272
  return false;
273
+ } else if ($helper->checkIsAdmin() && $this->_getConfigData('active_cc3d') == 1) {
274
  return false;
275
+ } else if (!empty($quote) && $quote->hasNominalItems() && $helper->checkIsAdmin()) {
276
  return false;
277
+ } else if (!empty($quote) && !$quote->hasNominalItems() && !$helper->isModuleActive($quote->getGrandTotal())) {
278
+ return false;
279
+ } else if (!empty($quote) && $quote->hasNominalItems() && (in_array($this->_code, $redirectPayment)
280
+ || $this->_getConfigData('active_cc3d') == 1)) {
281
  return false;
282
  } else if (time() < $this->_getCheckout()->$getNnDisableTime()) {
283
  return false;
284
  }
285
+
286
  $this->paymentRefillValidate();
287
 
288
  return parent::isAvailable($quote);
289
  }
290
 
291
+ /**
292
+ * Assign Form Data in quote instance
293
+ *
294
+ * @param array $data
295
+ * @return Mage_Payment_Model_Abstract Object
296
+ */
297
+ public function assignData($data)
298
+ {
299
+ $infoInstance = $this->_getInfoInstance();
300
+ // unset form method session
301
+
302
+ if ($this->_code != $this->_getCheckout()->getNnPaymentCode()) {
303
+ $this->unsetFormMethodSession();
304
+ }
305
+ $this->dataHelper->assignNovalnetData($this->_code, $data, $infoInstance);
306
+ return $this;
307
+ }
308
+
309
  /**
310
  * Validate payment method information object
311
  *
314
  public function validate()
315
  {
316
  parent::validate();
317
+
318
  $infoInstance = $this->_getInfoInstance();
319
+
320
  if (!$this->_isPlaceOrder()) {
321
  // validate the Novalnet basic params and billing informations
322
  $this->validateNovalnetParams();
327
  }
328
 
329
  $callbackPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('fraudCheckPayment');
330
+ if ((in_array($this->_code, $callbackPayment) || ($this->_code == 'novalnetCc'
331
+ && $this->_getConfigData('active_cc3d') != 1))) {
332
+ $this->_initiateCallbackProcess($this->_code, $infoInstance);
333
  }
334
 
335
  if (!$this->isCallbackTypeCall() && $this->_isPlaceOrder()) {
344
  */
345
  public function paymentRefillValidate()
346
  {
347
+ $helper = $this->helper;
348
+ $checkoutSession = $this->_getCheckout();
349
+ $prevPaymentCode = $checkoutSession->getNnPaymentCode();
350
+ // Check the users (guest or login)
351
+ $customerSession = $helper->getCustomerSession();
352
+ $coreSession = $helper->getCoresession();
353
  if (!$customerSession->isLoggedIn() && $coreSession->getGuestloginvalue()
354
  == '') {
355
  $coreSession->setGuestloginvalue('1');
356
  } elseif ($coreSession->getGuestloginvalue() == '1' && $customerSession->isLoggedIn()) {
357
  $coreSession->setGuestloginvalue('0');
358
+ $this->unsetFormMethodSession();
359
  $this->unsetMethodSession($prevPaymentCode);
360
  }
361
 
362
+ $paymentCode = $checkoutSession->getQuote()->getPayment()->getMethod();
363
+ if ($paymentCode && $paymentCode != $prevPaymentCode) {
364
+ $this->unsetFormMethodSession();
365
  $this->unsetMethodSession($prevPaymentCode);
366
  }
 
367
 
368
+ $paymentSucess = $this->_getConfigData('payment_last_success', true);
369
+ if(!$helper->checkIsAdmin() && $customerSession->isLoggedIn() && $paymentCode =='' && $paymentSucess){
370
+ $helper->getModelFactory()->getlastSuccesOrderMethod($customerSession->getId(),$checkoutSession);
 
 
 
 
 
 
 
 
 
 
371
  }
 
 
372
  }
373
 
374
  /**
379
  {
380
  $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
381
  if ($this->_code && !in_array($this->_code, $redirectPayment)) {
382
+ $helper = $this->helper;
383
 
384
+ if ($this->_code == Novalnet_Payment_Model_Config::NN_CC && !$helper->checkIsAdmin()
385
  && $this->_getConfigData('active_cc3d') == 1) {
386
  return false;
387
  }
388
 
389
+ $storeId = $helper->getMagentoStoreId();
390
  $request = $this->buildRequest(Novalnet_Payment_Model_Config::POST_NORMAL, $storeId);
391
+ $this->_getCheckout()->setPaymentReqData($request);
 
392
  }
393
  }
394
 
395
  /**
396
+ * Payment capture process
397
  *
398
+ * @param varien_object $payment
399
  * @param float $amount
400
+ * @return Mage_Payment_Model_Abstract
401
  */
402
  public function capture(Varien_Object $payment, $amount)
403
  {
405
  $responseCodeApproved = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
406
 
407
  if ($this->canCapture() && $this->_code && !in_array($this->_code, $redirectPayment)) {
408
+ $orderId = $payment->getOrder()->getId();
409
+ $helper = $this->helper;
410
+ $amount = $helper->getAmountCollection($orderId, 1, NULL);
411
+ $lastTranId = $helper->makeValidNumber($payment->getLastTransId());
412
+ $loadTransStatus = $helper->loadTransactionStatus($lastTranId);
413
  $transStatus = $loadTransStatus->getTransactionStatus();
 
414
  if (!empty($transStatus) && $transStatus != $responseCodeApproved) {
415
+ $response = $this->payportRequest($payment, 'capture');
 
 
416
  if ($response->getStatus() == $responseCodeApproved) {
417
+ $data = unserialize($payment->getAdditionalData());
418
+ $data['captureTid'] = $payment->getLastTransId();
419
+ $data['CaptureCreateAt'] = Mage::getModel('core/date')->date('Y-m-d H:i:s');
420
+ $payment->setAdditionalData(serialize($data))->save();
421
+ $helper->getModelFactory()->captureResponseSave($amount, $loadTransStatus, $transStatus, $payment, $lastTranId);
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  } else {
423
  $this->showException('Error in you capture request');
424
  }
432
  *
433
  * @param string $type
434
  * @param int $storeId
435
+ * @param float $amountValue
436
+ * @param varien_object $nominalItem
437
+ * @return mixed
438
  */
439
+ public function buildRequest($type = Novalnet_Payment_Model_Config::POST_NORMAL, $storeId
440
+ = NULL, $amountValue = NULL, $nominalItem = NULL)
441
+ {
442
  $payCode = ucfirst($this->_code);
443
  $helper = $this->helper;
444
  $callbackTelNo = "getNnCallbackTel" . $payCode;
445
  $callbackEmail = "getNnCallbackEmail" . $payCode;
446
+ $referenceOne = trim(strip_tags(trim($this->_getConfigData('reference_one'))));
447
+ $referenceTwo = trim(strip_tags(trim($this->_getConfigData('reference_two'))));
448
+
449
+ $amount = $amountValue ? $amountValue : $helper->getFormatedAmount($this->_getAmount());
450
+
451
+ if ($nominalItem) {
452
+ $amount = $helper->getFormatedAmount($this->_getCheckout()->getNnRowAmount());
453
+ }
454
 
455
  if ($type == Novalnet_Payment_Model_Config::POST_NORMAL || $type == Novalnet_Payment_Model_Config::POST_CALLBACK) {
456
+ $infoObject = $this->_getInfoObject();
457
+ $orderId = $this->_getOrderId();
458
  $request = new Varien_Object();
 
 
 
459
  $this->assignNnAuthData($request, $storeId);
460
+ $livemode = (!$this->_getConfigData('live_mode')) ? 1 : 0;
461
+ $modelFactory = $helper->getModelFactory();
462
+ $modelFactory->requestParams($request, $infoObject, $orderId, $amount, $helper, $livemode);
463
+ if ($this->_manualCheckLimit) {
464
+ $this->_manualCheckValidate($request);
465
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
466
  if ($this->_referrerId) {
467
  $request->setReferrerId($this->_referrerId);
468
  }
 
 
 
 
 
 
 
 
469
  if ($helper->checkIsAdmin()) {
470
  $adminUserId = Mage::getSingleton('admin/session')->getUser()->getUserId();
471
+ $request->setInput2('admin_user')
472
+ ->setInputval2($adminUserId);
473
  }
474
+ if ($referenceOne) {
475
+ $request->setInput3('reference1')
476
+ ->setInputval3($referenceOne);
477
+ }
478
+ if ($referenceTwo) {
479
+ $request->setInput4('reference2')
480
+ ->setInputval4($referenceTwo);
481
+ }
482
+
483
+ // set payment type
484
+ $request->setPaymentType($helper->getPaymentType($this->_code));
485
+ // set Novalnet params
486
  $this->_setNovalnetParam($request, $this->_code);
487
  }
488
 
489
+ if ($nominalItem) {
490
+ $modelFactory->requestProfileParams($request, $helper);
491
+ }
492
+
493
  //Callback Method
494
  if ($type == Novalnet_Payment_Model_Config::POST_CALLBACK) {
495
  if ($this->getConfigData('callback') == 1) { //PIN By Callback
510
  /**
511
  * Post request to gateway and return response
512
  *
513
+ * @param varien_object $request
514
+ * @return mixed
515
  */
516
  public function postRequest($request)
517
  {
518
  $result = new Varien_Object();
519
  $helper = $this->helper;
520
  $paymentKey = $helper->getPaymentId($this->_code);
521
+ $quote = $this->_getCheckout()->getQuote();
522
  $payportUrl = $helper->getPayportUrl('paygate');
523
  if ($this->_validateBasicParams() && $helper->checkIsNumeric($paymentKey)
524
  && $paymentKey == $request->getKey() && $request->getAmount() && $helper->checkIsNumeric($request->getAmount())) {
525
+ $response = $this->setNovalnetRequestCall($request->getData(), $payportUrl);
526
+ parse_str($response->getBody(), $data);
527
+ $result->addData($data);
528
+ } else if ($this->_validateBasicParams() && $helper->checkIsNumeric($paymentKey)
529
+ && $paymentKey == $request->getKey() && $quote->hasNominalItems()
530
+ && $helper->checkIsNumeric($request->getAmount())) {
531
+ $response = $this->setNovalnetRequestCall($request->getData(), $payportUrl);
532
  parse_str($response->getBody(), $data);
533
  $result->addData($data);
534
  } else {
537
  return $result;
538
  }
539
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
540
  /**
541
  * Assign Novalnet Authentication Data
542
  *
546
  public function assignNnAuthData(Varien_Object $request, $storeId = NULL)
547
  {
548
  //Reassign the Basic Params Based on store
549
+ $quote = $this->_getCheckout()->getQuote();
550
  $this->_vendorId = $this->_getConfigData('merchant_id', true, $storeId);
551
  $this->_authcode = $this->_getConfigData('auth_code', true, $storeId);
552
+ $nominalItem = $quote->hasNominalItems();
553
+ if ($nominalItem) {
554
+ $this->_tariffId = $this->_subscribTariffId;
555
+ }
556
 
557
+ // Assign affiliate account information if available.
558
+ $this->loadAffAccDetail();
559
  $request->setVendor($this->_vendorId)
560
  ->setAuthCode($this->_authcode)
561
  ->setProduct($this->_productId)
564
  }
565
 
566
  /**
567
+ * Get the Order basic configuration for refund, void, and capture
568
  *
569
+ * @param varien_object $request
570
+ * @param varien_object $payment
571
+ * @param int $storeId
572
+ * @param varien_object $nominalItem
573
  */
574
+ public function assignOrderBasicParams(Varien_Object $request, $payment, $storeId
575
+ = NULL, $nominalItem = NULL)
576
  {
577
+ $this->assignVendorConfig($payment);
578
+ $getresponseData = unserialize($payment->getAdditionalData());
579
+ // subscription tariff
580
+ if ($nominalItem == 1) {
581
+ $this->_tariffId = $this->_subscribTariffId;
582
  }
583
  $this->_vendorId = ($getresponseData['vendor']) ? $getresponseData['vendor']
584
  : $this->_vendorId;
588
  : $this->_productId;
589
  $this->_tariffId = ($getresponseData['tariff']) ? $getresponseData['tariff']
590
  : $this->_tariffId;
591
+ $key = ($getresponseData['key']) ? $getresponseData['key'] : $this->helper->getPaymentId($this->_code);
592
+ // build basic merchant information
593
+ $request->setVendor($this->_vendorId)
594
+ ->setAuthCode($this->_authcode)
595
+ ->setProduct($this->_productId)
596
+ ->setTariff($this->_tariffId)
597
+ ->setKey($key);
598
  }
599
 
600
  /**
612
 
613
  if ($payment->getRefundTransactionId() && $amount > 0) {
614
  $helper = $this->helper;
615
+ $order = $payment->getOrder();
616
  $refundAmount = $helper->getFormatedAmount($amount);
617
+
618
+ $customerId = $order->getCustomerId();
619
+ $orderItems = $this->getPaymentAllItems($order);
620
+ $nominalItem = $helper->checkNominalItem($orderItems);
621
  $data = unserialize($payment->getAdditionalData());
622
+ $getTid = $helper->makeValidNumber($payment->getRefundTransactionId());
623
+ if (($this->_code == Novalnet_Payment_Model_Config::NN_SEPA) || ($nominalItem && (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_PREPAYMENT,Novalnet_Payment_Model_Config::NN_INVOICE))))) {
624
  $getTid = $helper->makeValidNumber($payment->getLastTransId());
625
  if (isset($data['NnSepaParentTid']) && $data['NnSepaParentTid']) {
626
  $getTid = $data['NnSepaParentTid'];
630
  if ($this->_code == Novalnet_Payment_Model_Config::NN_INVOICE) {
631
  $this->_refundValidation($payment, $refundAmount);
632
  }
633
+
634
+ $cardAmount = NULL;
635
+ $paymentObj = $order->getPayment()->getMethodInstance();
636
+ $modelFactory = $helper->getModelFactory();
637
+ if ($nominalItem) {
638
+ $currency = Mage::app()->getLocale()->currency($this->_getInfoObject()->getBaseCurrencyCode())->getSymbol();
639
+ $cardAmount = $modelFactory->checkNovalnetCardAmount($currency, $getTid,$payment, $helper, $refundAmount);
640
+ }
641
+
642
+ $response = $this->payportRequest($payment, 'refund', $refundAmount, $getTid,$cardAmount);
643
 
644
  if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
645
+ $amountAfterRefund = ($order->getTotalPaid() - $order->getBaseTotalRefunded());
646
+ $statusCode = $modelFactory->callTransactionStatus($helper, $getTid, $payment, $amountAfterRefund,1);
647
+ $txnId = $response->getTid();
648
+
649
+ $refundTid = !empty($txnId) ? $txnId : $payment->getLastTransId() . '-refund';
650
  $data['fullRefund'] = ((string)$this->_getAmount() == (string)$amount) ? true : false;
 
 
651
 
652
  if (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_INVOICE,
653
  Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
 
 
 
654
  $data['NnTid'] = $data['NnTid'] . '-refund';
655
  $refundTid = $data['NnTid'];
656
  }
657
 
658
  if ($refundTid) {
659
  $refAmount = Mage::helper('core')->currency($amount, true, false);
660
+ $data = $modelFactory->refundTidData($refAmount,$data,$refundTid,$getTid);
 
 
 
 
 
 
 
661
  }
 
662
  // For SEPA payment after submitting to bank
663
+ if ($statusCode->getStatus() && $this->_code == Novalnet_Payment_Model_Config::NN_SEPA) {
664
  $data['NnSepaParentTid'] = $getTid;
665
+ if ($statusCode->getStatus() == Novalnet_Payment_Model_Config::PAYMENT_VOID_STATUS
666
+ && $statusCode->getChildTidInfo()) {
667
+ parse_str($statusCode->getChildTidInfo(), $resInfo);
668
  $data['NnSepaParentTid'] = $resInfo['tid1'];
669
  }
670
  }
671
 
672
+ $modelFactory->refundValidateProcess($helper, $payment, $refundTid,$data);
673
+ if ($txnId) {
674
+ $modelFactory->callTransactionStatus($helper, $refundTid, $payment, $amountAfterRefund, 2, $refundTid, $customerId, $response);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675
  }
676
  } else {
677
  $this->showException($response->getStatusDesc(), false);
692
  private function _refundValidation($payment, $refundAmount)
693
  {
694
  $orderId = $payment->getOrder()->getIncrementId();
695
+ $helper = $this->helper;
696
+ $callbackTrans = $helper->loadCallbackValue($orderId);
697
  $callbackValue = $callbackTrans && $callbackTrans->getCallbackAmount() != NULL
698
  ? $callbackTrans->getCallbackAmount() : '';
699
  $currency = Mage::app()->getLocale()->currency($this->_getInfoObject()->getBaseCurrencyCode())->getSymbol();
700
  if ($callbackValue < (string) $refundAmount) {
701
+ $this->showException('Maximum amount available to refund is ' . $currency . $helper->getFormatedAmount($callbackValue, 'RAW'));
702
  }
703
+
704
+ $refundedAmount = $helper->getFormatedAmount($payment->getAmountRefunded());
705
  $totalrefundAmount = $refundedAmount + $refundAmount;
706
  $availAmount = $callbackValue - $refundedAmount;
707
  if ($payment->getAmountRefunded() && $callbackValue < (string) $totalrefundAmount) {
708
+ $this->showException('Maximum amount available to refund is ' . $currency . $helper->getFormatedAmount($availAmount, 'RAW'));
709
  }
710
  return true;
711
  }
712
 
713
+ /**
714
+ * Void payment
715
+ *
716
+ * @param varien_object $payment
717
+ * @return Mage_Payment_Model_Abstract
718
+ */
719
+ public function void(Varien_Object $payment)
720
+ {
721
+ if (!$this->canVoid($payment)) {
722
+ $this->showException('Void action is not available.');
723
+ }
724
+
725
+ $helper = $this->helper;
726
+ $getTid = $helper->makeValidNumber($payment->getLastTransId());
727
+ $response = $this->payportRequest($payment, 'void');
728
+
729
+ if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
730
+ $txnId = $response->getTid();
731
+ $voidTid = !empty($txnId) ? $txnId : $payment->getLastTransId() . '-void';
732
+ $data = unserialize($payment->getAdditionalData());
733
+ $data['voidTid'] = $voidTid;
734
+ $data['voidCreateAt'] = Mage::getModel('core/date')->date('Y-m-d H:i:s');
735
+
736
+ if (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_INVOICE,
737
+ Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
738
+ $bankVoidTid = !empty($txnId) ? $txnId : $payment->getLastTransId();
739
+ $data['NnNoteTID'] = $this->dataHelper->getReferenceDetails($bankVoidTid, $data);
740
+ $payment->setAdditionalData(serialize($data));
741
+ }
742
+ $payment->setTransactionId($voidTid)
743
+ ->setLastTransId($voidTid)
744
+ ->setAdditionalData(serialize($data))
745
+ ->save();
746
+ $helper->getModelFactory()->callTransactionStatus($helper, $getTid, $payment, NULL,1);
747
+ } else {
748
+ $this->showException('Error in you void request');
749
+ }
750
+ return $this;
751
+ }
752
+
753
  /**
754
  * Perform Novalnet request for Void, Capture, Refund
755
  *
756
+ * @param varien_object $payment
757
  * @param string $requestType
758
  * @param float $refundAmount
759
  * @param int $refundTid
760
+ * @param float $cardAmount
761
  * @return mixed
762
  */
763
+ private function payportRequest($payment, $requestType, $refundAmount = NULL, $refundTid
764
+ = NULL, $cardAmount = NULL
765
+ )
766
+ {
767
  $request = new Varien_Object();
768
+ $order = $payment->getOrder();
769
+ $storeId = $order->getStoreId();
770
+ $customerId = $order->getCustomerId();
771
+ $orderItems = $this->getPaymentAllItems($order);
772
  $getTid = ($requestType == 'refund') ? $refundTid : $payment->getLastTransId();
773
+ $helper = $this->helper;
774
+ $nominalItem = $helper->checkNominalItem($orderItems);
775
+ $responseCodeApproved = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
776
+ $this->assignOrderBasicParams($request, $payment, $storeId, $nominalItem);
777
+ $modelFactory = $helper->getModelFactory();
778
+ $grandTotal = $order->getGrandTotal();
779
+ $totalRefunded = $order->getTotalRefunded();
780
+ $lastTransId = $payment->getLastTransId();
781
+
782
+ $modelFactory->requestTypes($request, $requestType, $helper, $getTid, $refundAmount);
783
+
 
 
 
 
 
 
 
784
  if (!in_array(NULL, $request->toArray())) {
785
  $buildNovalnetParam = http_build_query($request->getData());
786
  $payportUrl = $helper->getPayportUrl('paygate');
787
+ $response = $this->dataHelper->setRawCallRequest($buildNovalnetParam, $payportUrl);
788
  $this->logNovalnetTransactionData($request, $response, $payment->getLastTransId(), $customerId, $storeId);
789
  } else {
790
  $this->showException('Error in processing the transactions request');
791
  }
792
+ $tId = $response->getTid();
793
+
794
+ if ($response->getStatus() == $responseCodeApproved && $requestType == 'capture'
795
+ && $nominalItem) {
796
+ $modelFactory->saveProfileState($lastTransId);
797
+ } else if ($response->getStatus() == $responseCodeApproved && $requestType == 'void'
798
+ && $nominalItem) {
799
+ $modelFactory->saveProfileCancelState($lastTransId);
800
+ } else if ($response->getStatus() == $responseCodeApproved && $requestType == 'refund'
801
+ && $nominalItem && $this->_code == Novalnet_Payment_Model_Config::NN_CC && $totalRefunded == $order->getTotalPaid()){
802
+ $modelFactory->saveProfileCancelState($getTid);
803
+ } else if ($response->getStatus() == $responseCodeApproved && $requestType == 'refund'
804
+ && $nominalItem && $this->_code != Novalnet_Payment_Model_Config::NN_CC && ($grandTotal == $totalRefunded || $refundAmount == $cardAmount)) {
805
+ $lastTransId = preg_match("/refund/i", $lastTransId) ? str_replace("-refund",'',$lastTransId) : $lastTransId;
806
+ $modelFactory->saveProfileCancelState($lastTransId);
807
+ $tId ? $modelFactory->saveProfileTID($lastTransId,$tId) : '';
808
+ } else if ($response->getStatus() == $responseCodeApproved && $requestType == 'refund'
809
+ && $nominalItem && $tId != '' && $this->_code != Novalnet_Payment_Model_Config::NN_CC) {
810
+ $lastTransId = preg_match("/refund/i", $lastTransId) ? str_replace("-refund",'',$lastTransId) : $lastTransId;
811
+ $modelFactory->saveProfileTID($lastTransId,$tId);
812
+ }
813
  return $response;
814
  }
815
 
816
  /**
 
817
  *
818
+ * Get affiliate account/user detail
819
+ *
820
+ * @return mixed
821
  */
822
+ public function loadAffAccDetail()
823
  {
824
+ $helper = $this->helper;
825
+ $nnAffId = $helper->getCoresession()->getNnAffId();
826
+
827
+ if (empty($nnAffId)) {
828
+ $customerId = $helper->getCustomerId();
829
+ $orderCollection = Mage::getModel('novalnet_payment/affiliateuser')->getCollection()
830
+ ->addFieldToFilter('customer_no', $customerId)
831
+ ->addFieldToSelect('aff_id');
832
+ $nnAffId = $orderCollection->getLastItem()->getAffId()
833
+ ? $orderCollection->getLastItem()->getAffId() : NULL;
834
+ $helper->getCoresession()->setNnAffId($nnAffId);
835
  }
836
 
837
+ if ($nnAffId != NULL) {
838
+ $orderCollection = Mage::getModel('novalnet_payment/affiliate')->getCollection()
839
+ ->addFieldToFilter('aff_id', $nnAffId)
840
+ ->addFieldToSelect('aff_id')
841
+ ->addFieldToSelect('aff_authcode')
842
+ ->addFieldToSelect('aff_accesskey');
843
+ $vendorId = $orderCollection->getLastItem()->getAffId();
844
+ $vendorAuthcode = $orderCollection->getLastItem()->getAffAuthcode();
845
+ $affAccesskey = $orderCollection->getLastItem()->getAffAccesskey();
846
+
847
+ // reassign vendor & authcode
848
+ if ($vendorId && $vendorAuthcode) {
849
+ $this->_vendorId = $vendorId;
850
+ $this->_authcode = $vendorAuthcode;
 
 
 
 
 
 
 
 
 
 
 
851
  }
 
 
 
 
 
 
852
  }
853
+
854
+ $accessKey = (isset($affAccesskey) && $affAccesskey != NULL) ? $affAccesskey : $this->_getConfigData('password', true);
855
+ return $accessKey;
856
  }
857
 
858
  /**
864
  private function _getMethodSession($paymentCode = NULL)
865
  {
866
  $paymentCode = (!empty($paymentCode)) ? $paymentCode : $this->getCode();
867
+ $checkoutSession = $this->helper->getCheckoutSession();
868
  if (!$checkoutSession->hasData($paymentCode)) {
869
  $checkoutSession->setData($paymentCode, new Varien_Object());
870
  }
880
  public function unsetMethodSession($paymentCode = NULL)
881
  {
882
  $paymentCode = (!empty($paymentCode)) ? $paymentCode : $this->getCode();
883
+ $this->helper->getCheckoutSession()->unsetData($paymentCode);
 
 
 
 
884
  return $this;
885
  }
886
 
887
  /**
888
+ * Get the Novalnet configuration data
889
  *
890
  * @param string $field
891
  * @param boolean $globalMode
894
  */
895
  public function _getConfigData($field, $globalMode = false, $storeId = NULL)
896
  {
897
+ $helper = $this->helper;
898
+ $storeId = is_null($storeId) ? $helper->getMagentoStoreId() : $storeId;
899
+ $path = $helper->getNovalnetGlobalPath() . $field;
900
  if ($field == 'live_mode') {
901
+ $getTestModePaymentMethod = Mage::getStoreConfig($path, $storeId);
902
+ if (!preg_match('/' . $this->_code . '/i', $getTestModePaymentMethod)) {
903
  return false;
904
  }
905
  return true;
910
  return null;
911
  }
912
 
913
+ /**
914
+ * Save canceled payment method
915
+ *
916
+ * @param varien_object $result
917
+ * @param varien_object $payment
918
+ */
919
+ public function saveCancelledOrder($result, $payment)
920
+ {
921
+ $order = $payment->getOrder();
922
+
923
+ $statusMessage = $result->getStatusMessage() ? $result->getStatusMessage() : ($result->getStatusDesc() ? $result->getStatusDesc()
924
+ : ($result->getStatusText() ? $result->getStatusText() : $this->helper->__('Payment was not successfull')));
925
+ $paystatus = "<b><font color='red'>" . $this->helper->__('Payment Failed') . "</font> - " . $statusMessage . "</b>";
926
+ $data = unserialize($payment->getAdditionalData());
927
+ // Set Novalnet Mode
928
+ $authorizeKey = $data['authorize_key'];
929
+ $serverResponse = ($result->getTestMode() && is_numeric($result->getTestMode()))
930
+ ? $result->getTestMode()
931
+ : $this->helper->getDecodedParam($result->getTestMode(), $authorizeKey);
932
+ $shopMode = $this->_getConfigData('live_mode', true);
933
+ $testMode = (((isset($serverResponse) && $serverResponse == 1) || (isset($shopMode)
934
+ && $shopMode == 0)) ? 1 : 0 );
935
+ $data['NnTestOrder'] = $testMode;
936
+ $data['NnComments'] = $paystatus;
937
+ $payment->setLastTransId($result->getTid())
938
+ ->setAdditionalData(serialize($data))
939
+ ->save();
940
+ $order->registerCancellation($statusMessage)
941
+ ->save();
942
+ }
943
+
944
  /**
945
  * Send order_no to server after the Completion of payment
946
  *
953
  $request = $result = array();
954
  $helper = $this->helper;
955
  $paymentKey = $helper->getPaymentId($this->_code);
956
+
957
+ if ($this->_validateBasicParams() && $helper->checkIsNumeric($paymentKey)) {
958
+ $request['vendor'] = $this->_vendorId;
959
+ $request['auth_code'] = $this->_authcode;
960
+ $request['product'] = $this->_productId;
961
+ $request['tariff'] = $this->_tariffId;
962
+ $request['key'] = $paymentKey;
963
+ $request['tid'] = $response->getTid();
964
+ $request['status'] = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
965
+ $request['order_no'] = $this->_getOrderId();
966
+ $payportUrl = $helper->getPayportUrl('paygate');
967
+
968
  if ($request['key'] == 27) {
969
  $request['invoice_ref'] = 'BNR-' . $request['product'] . '-' . $request['order_no'];
970
  }
971
+
972
  $result = new Varien_Object();
973
+ $response = $this->setNovalnetRequestCall($request, $payportUrl);
974
  $result = $response->getRawBody();
975
+
976
+ $nnAffId = $helper->getCoresession()->getNnAffId();
977
+ if ($nnAffId) {
978
+ $this->doNovalnetAffUserInfoLog($nnAffId);
979
+ }
980
  }
981
  return $result;
982
  }
983
 
984
+ /**
985
+ * Log Affiliate user details
986
+ *
987
+ * @param int $affId
988
+ */
989
+ public function doNovalnetAffUserInfoLog($affId)
990
+ {
991
+ $customerNo = $this->helper->getCustomerId();
992
+ $affiliateUserInfo = $this->helper->getModelAffiliateuser();
993
+ $affiliateUserInfo->setAffId($affId)
994
+ ->setCustomerNo($customerNo)
995
+ ->setAffOrderNo($this->_getOrderId())
996
+ ->save();
997
+ $this->helper->getCoresession()->unsNnAffId();
998
+ }
999
+
1000
  /**
1001
  * Check the transaction status using API
1002
  *
1005
  * @param string $type
1006
  * @return mixed
1007
  */
1008
+ public function setNovalnetRequestCall($requestData, $requestUrl, $type = "")
1009
  {
1010
  if ($requestUrl == "") {
1011
  $this->showException('Server Request URL is Empty');
1012
  return;
1013
  }
1014
  $httpClientConfig = array('maxredirects' => 0);
1015
+
1016
+ if ($this->_getConfigData('use_proxy',true)) {
1017
+ $proxyHost = $this->_getConfigData('proxy_host',true);
1018
+ $proxyPort = $this->_getConfigData('proxy_port',true);
1019
+ if ($proxyHost && $proxyPort) {
1020
+ $httpClientConfig['proxy'] = $proxyHost. ':' . $proxyPort;//http://proxy.shr.secureserver.net:3128',;
1021
+ $httpClientConfig['httpproxytunnel'] = true;
1022
+ $httpClientConfig['proxytype'] = CURLPROXY_HTTP;
1023
+ $httpClientConfig['SSL_VERIFYHOST'] = false;
1024
+ $httpClientConfig['SSL_VERIFYPEER'] = false;
1025
+ }
1026
  }
1027
+
1028
+ $gatewayTimeout = (int) $this->_getConfigData('gateway_timeout',true);
1029
+ if ($gatewayTimeout > 0) {
1030
+ $httpClientConfig['timeout'] = $gatewayTimeout;
1031
+ }
1032
+
1033
  $client = new Varien_Http_Client($requestUrl, $httpClientConfig);
1034
 
1035
  if ($type == 'XML') {
1039
  $client->setParameterPost($requestData)->setMethod(Varien_Http_Client::POST);
1040
  }
1041
  $response = $client->request();
1042
+
1043
  if (!$response->isSuccessful()) {
1044
  $this->showException($this->helper->__('Gateway request error: %s', $response->getMessage()), false);
1045
  }
1051
  }
1052
 
1053
  /**
1054
+ * Set the Novalnet parameter based on payment code
1055
  *
1056
+ * @param Varien object $request
1057
  * @param string $paymentCode
1058
  * @return mixed
1059
  */
1062
  $helper = $this->helper;
1063
  $dataHelper = $this->dataHelper;
1064
  if ($paymentCode) {
 
1065
  switch ($paymentCode) {
1066
  case Novalnet_Payment_Model_Config::NN_INVOICE:
1067
  $paymentDuration = trim($this->_getConfigData('payment_duration'));
1079
  case Novalnet_Payment_Model_Config::NN_SOFORT:
1080
  case Novalnet_Payment_Model_Config::NN_PAYPAL:
1081
  case Novalnet_Payment_Model_Config::NN_IDEAL:
1082
+ case Novalnet_Payment_Model_Config::NN_EPS:
1083
+ $authorizeKey = $this->loadAffAccDetail();
1084
  $request->setUniqid(uniqid())
1085
  ->setCountryCode($request->getCountry())
1086
+ ->setSession(session_id())
1087
+ ->setImplementation('PHP');
 
 
 
 
 
 
1088
  $this->dataHelper->assignNovalnetReturnData($request, $this->_code);
1089
+ $this->dataHelper->importNovalnetEncodeData($request, $authorizeKey);
1090
  break;
1091
  case Novalnet_Payment_Model_Config::NN_CC:
1092
+ $checkoutSession = $this->_getCheckout();
1093
  $request->setCcHolder()
1094
  ->setCcNo()
1095
  ->setCcExpMonth()
1096
  ->setCcExpYear()
1097
+ ->setCcCvc2($checkoutSession->getNnCcCvc())
1098
+ ->setPanHash($checkoutSession->getCcPanHash())
1099
+ ->setUniqueId($checkoutSession->getCcUniqueId());
 
1100
  if ($this->_code == Novalnet_Payment_Model_Config::NN_CC && !$helper->checkIsAdmin()
1101
  && $this->_getConfigData('active_cc3d') == 1) {
 
1102
  $amount = $helper->getFormatedAmount($this->_getAmount());
1103
+ $authorizeKey = $this->loadAffAccDetail();
1104
  $request->setCountryCode($request->getCountry())
1105
  ->setSession(session_id())
1106
+ ->setencodedAmount($helper->getEncodedParam($amount, $authorizeKey));
1107
  $dataHelper->assignNovalnetReturnData($request, $this->_code);
1108
  $request->unsUserVariable_0(); // Unset uservariable as CC3D doesnot requires it
1109
  }
1110
  break;
1111
  case Novalnet_Payment_Model_Config::NN_SEPA:
1112
+ $paymentInfo = $dataHelper->novalnetCardDetails('payment');
1113
+ $request->setBankAccountHolder($paymentInfo['account_holder'])
1114
  ->setBankAccount()
1115
  ->setBankCode()
1116
  ->setBic()
1117
  ->setIban()
1118
+ ->setSepaHash($dataHelper->novalnetCardDetails('result_sepa_hash'))
1119
+ ->setSepaUniqueId($dataHelper->novalnetCardDetails('result_mandate_unique'))
1120
+ ->setIbanBicConfirmed($dataHelper->novalnetCardDetails('nnsepa_iban_confirmed'));
1121
 
1122
  $paymentDuration = trim($this->_getConfigData('sepa_due_date'));
1123
  $dueDate = (!$paymentDuration) ? date('Y-m-d', strtotime('+7 days'))
1124
  : date('Y-m-d', strtotime('+' . $paymentDuration . ' days'));
1125
  $request->setSepaDueDate($dueDate);
 
1126
  break;
1127
  }
1128
  }
1130
  }
1131
 
1132
  /**
1133
+ * Validate the Novalnet response
1134
  *
1135
  * @param varien_object $payment
1136
+ * @param varien_object $request
1137
  * @return boolean
1138
  */
1139
  public function validateNovalnetResponse($payment, $result = NULL)
1140
  {
1141
  $order = $payment->getOrder();
1142
+ $request = $this->_getCheckout()->getPaymentReqData();
 
 
1143
 
1144
  switch ($result->getStatus()) {
1145
  case Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED:
1146
+ // Set Novalnet Mode
1147
  $txnId = trim($result->getTid());
1148
+ $data = $this->setPaymentAddtionaldata($result, $request);
1149
+ if ($this->_code == Novalnet_Payment_Model_Config::NN_SEPA) {
1150
+ // Log sepa refill information for login users
1151
+ $this->sepaPaymentRefill();
1152
+ }
1153
  $payment->setStatus(self::STATUS_APPROVED)
1154
+ ->setIsTransactionClosed(false) // Set transaction opend to make payment void
1155
  ->setAdditionalData(serialize($data))
1156
  ->save();
1157
  $order->setPayment($payment);
1158
  $order->save();
1159
 
1160
+ /* Update the transaction status and transaction overview */
1161
+ $getTransactionStatus = $this->doNovalnetStatusCall($txnId,$payment);
1162
  $result->setStatus($getTransactionStatus->getStatus());
1163
+ $this->logNovalnetStatusData($result, $txnId);
1164
+
1165
+ $helper = $this->helper;
1166
+ $captureMode = (version_compare($helper->getMagentoVersion(), '1.6', '<')) ? false
1167
  : true;
 
1168
 
1169
  // Capture the payment only if status is 100
1170
+ if ($order->canInvoice() && $getTransactionStatus->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
1171
+ && $this->_code != Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
1172
  $payment->setTransactionId($txnId) // Add capture text to make the new transaction
1173
  ->setIsTransactionClosed($captureMode) // Close the transaction
1174
  ->capture(null)
1175
  ->save();
1176
+ $setOrderStatus = $this->_getConfigData('order_status') ? $this->_getConfigData('order_status')
1177
+ : Mage_Sales_Model_Order::STATE_PROCESSING; // If after status is empty set default status
1178
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $setOrderStatus, $this->helper->__('Payment was successful.'), true);
1179
  }
1180
+
1181
  $payment->setTransactionId($txnId)
1182
  ->setLastTransId($txnId)
1183
  ->setParentTransactionId(null)
1190
  $this->logNovalnetTransactionData($request, $result, $txnId, $this->helper->getCustomerId(), $this->helper->getMagentoStoreId());
1191
  }
1192
  $statusText = ($result->getStatusText()) ? $result->getStatusText()
1193
+ : $helper->__('successful');
1194
+ $helper->getCoresession()->addSuccess($statusText);
1195
  $error = false;
1196
  break;
1197
  default:
1202
  }
1203
  if ($error !== false) {
1204
  $this->saveCancelledOrder($result, $payment);
1205
+ $this->helper->getCoresession()->addError($error);
1206
  }
1207
  break;
1208
  }
1209
  return $error;
1210
  }
1211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1212
  /**
1213
  * Set Payment method additional informations
1214
  *
1215
  * @param varien_object $result
1216
+ * @param varien_object $request
1217
+ * @param array
1218
  */
1219
+ public function setPaymentAddtionaldata($result, $request = NULL)
1220
  {
1221
  $txnId = trim($result->getTid());
1222
+ // set Novalnet Mode
 
1223
  $responseTestMode = $result->getTestMode();
1224
  $shopMode = $this->_getConfigData('live_mode');
1225
  $testMode = (((isset($responseTestMode) && $responseTestMode == 1) || (isset($shopMode)
1226
  && $shopMode == 0)) ? 1 : 0 );
1227
+ $quote = $this->_getCheckout()->getQuote();
1228
+ $nominalItem = $quote->hasNominalItems();
1229
+ if ($nominalItem) {
1230
+ $this->_tariffId = $this->_subscribTariffId;
1231
+ }
1232
+
1233
  $data = array('NnTestOrder' => $testMode,
1234
  'NnTid' => $txnId,
1235
+ 'orderNo' => trim($result->getOrderNo()),
1236
  'vendor' => ($request->getVendor()) ? $request->getVendor() : $this->_vendorId,
1237
  'auth_code' => ($request->getAuthCode()) ? $request->getAuthCode() : $this->_authcode,
1238
  'product' => ($request->getProduct()) ? $request->getProduct() : $this->_productId,
1239
  'tariff' => ($request->getTariff()) ? $request->getTariff() : $this->_tariffId,
1240
  'key' => ($request->getKey()) ? $request->getKey() : $this->helper->getPaymentId($this->_code),
1241
  );
1242
+
1243
  if (in_array($this->_code, array(Novalnet_Payment_Model_Config::NN_INVOICE,
1244
  Novalnet_Payment_Model_Config::NN_PREPAYMENT))) {
1245
+ $dataHelper = $this->dataHelper;
1246
+ $data['NnNoteDesc'] = $dataHelper->getNoteDescription();
1247
+ $data['NnDueDate'] = $dataHelper->getDueDate($result);
1248
+ $data['NnNote'] = $dataHelper->getNote($result);
1249
+ $data['NnNoteAmount'] = $dataHelper->getBankDetailsAmount($result->getAmount());
1250
+ $data['NnNoteTID'] = $dataHelper->getReferenceDetails($txnId,$data);
1251
  }
1252
  return $data;
1253
  }
1254
 
1255
+ /**
1256
+ * Log sepa payment refill information
1257
+ *
1258
+ */
1259
+ public function sepaPaymentRefill()
1260
+ {
1261
+ $helper = $this->helper;
1262
+ $customerLogin = $helper->getCustomerSession()->isLoggedIn();
1263
+
1264
+ if ($customerLogin && !$helper->checkIsAdmin()) {
1265
+ $checkout = $this->_getCheckout();
1266
+ $customerId = $helper->getCustomerId();
1267
+ $modNovalSepaReFillCollection = $helper->getModelSepaRefill()->getCollection();
1268
+ $modNovalSepaReFillCollection->addFieldToFilter('customer_id', $customerId);
1269
+ $countRefill = count($modNovalSepaReFillCollection);
1270
+ $modNovalSepaRefill = $countRefill ? $helper->getModelSepaRefill()->load($customerId, 'customer_id')
1271
+ : $helper->getModelSepaRefill();
1272
+ $modNovalSepaRefill->setCustomerId($customerId)
1273
+ ->setPanHash($checkout->getSepaHash())
1274
+ ->setSepaDatetime($helper->getCurrentDateTime())
1275
+ ->save();
1276
+ }
1277
+ }
1278
+
1279
+ /**
1280
+ * Unset Form method session
1281
+ *
1282
+ */
1283
+ public function unsetFormMethodSession()
1284
+ {
1285
+ $this->_getCheckout()->unsNnCcCvc()
1286
+ ->unsCcPanHash()
1287
+ ->unsCcUniqueId();
1288
+ $this->_getCheckout()->unsSepaHash()
1289
+ ->unsSepaUniqueId();
1290
+ $this->_getCheckout()->unsRefilldatavalues()
1291
+ ->unsNnPaymentCode();
1292
+ }
1293
+
1294
+ /**
1295
+ * Unset payment method session
1296
+ *
1297
+ */
1298
+ public function unsetPaymentReqResData()
1299
+ {
1300
+ $this->_getCheckout()->unsNominalRequest()
1301
+ ->unsNominalResponse()
1302
+ ->unsPaymentReqData()
1303
+ ->unsPaymentResData()
1304
+ ->unsNnCallbackReqData();
1305
+ }
1306
+
1307
  /**
1308
  * Validate the transaction status
1309
  *
1311
  * @param varien_object $payment
1312
  * @param string $reqType
1313
  * @param varien_object $extraOption
1314
+ * @param varien_object $requestData
1315
+ * @param array $params
1316
  * @return mixed
1317
  */
1318
+ public function doNovalnetStatusCall($tid, $payment = NULL, $reqType = Novalnet_Payment_Model_Config::TRANS_STATUS, $extraOption
1319
+ = NULL, $requestData = NULL, $params = NULL)
1320
+ {
1321
  $requestType = ($reqType == Novalnet_Payment_Model_Config::TRANS_STATUS)
1322
  ? Novalnet_Payment_Model_Config::TRANS_STATUS : $reqType;
1323
+
1324
  if ($payment != NULL) {
1325
  $this->assignVendorConfig($payment);
1326
+ }
1327
+ // Callback request data re-assign
1328
+ $callbackReqData = $this->_getCheckout()->getNnCallbackReqData();
1329
+ if ($callbackReqData) {
1330
+ $this->_vendorId = $callbackReqData->getVendor();
1331
+ $this->_authcode = $callbackReqData->getAuthCode();
1332
+ $this->_productId = $callbackReqData->getProduct();
1333
  }
1334
 
1335
  $request = '<?xml version="1.0" encoding="UTF-8"?>';
1343
 
1344
  if ($this->_vendorId && $this->_authcode && $this->_productId) {
1345
  $infoRequestUrl = $this->helper->getPayportUrl('infoport');
1346
+ $result = $this->setNovalnetRequestCall($request, $infoRequestUrl, 'XML');
 
1347
  if ($requestType == 'NOVALTEL_STATUS') {
1348
  $requestData->setData($request);
1349
  }
1351
  }
1352
  }
1353
 
1354
+ /**
1355
+ * Set the Order basic configuration
1356
+ *
1357
+ * @param string $payment
1358
+ */
1359
+ public function assignVendorConfig($payment = NULL)
1360
+ {
1361
+ // Reassign the Basic Params Based on store
1362
+ $getresponseData = NULL;
1363
+ if ($payment) {
1364
+ $getresponseData = unserialize($payment->getAdditionalData());
1365
+ }
1366
+ $this->_vendorId = ($getresponseData['vendor']) ? $getresponseData['vendor']
1367
+ : $this->_vendorId;
1368
+ $this->_authcode = ($getresponseData['auth_code']) ? $getresponseData['auth_code']
1369
+ : $this->_authcode;
1370
+ $this->_productId = ($getresponseData['product']) ? $getresponseData['product']
1371
+ : $this->_productId;
1372
+ $this->_tariffId = ($getresponseData['tariff']) ? $getresponseData['tariff']
1373
+ : $this->_tariffId;
1374
+ }
1375
+
1376
  /**
1377
  * Get checkout session
1378
  *
1381
  protected function _getCheckout()
1382
  {
1383
  if ($this->helper->checkIsAdmin()) {
1384
+ return $this->helper->getAdminCheckoutSession();
1385
  } else {
1386
+ return $this->helper->getCheckoutSession();
1387
  }
1388
  }
1389
 
1390
  /**
1391
+ * validate Novalnet params to proceed checkout
1392
  *
1393
+ * @return boolean
1394
  */
1395
  public function validateNovalnetParams()
1396
  {
1397
+ $infoObject = $this->_getInfoObject();
1398
+ $infoObjBilling = $infoObject->getBillingAddress();
1399
  $quoteBilling = $this->_getCheckout()->getQuote()->getBillingAddress();
1400
+ $cusEmail = ($quoteBilling->getEmail()) ? $quoteBilling->getEmail() : $infoObject->getCustomerEmail();
1401
  $cusFirstname = ($quoteBilling->getFirstname()) ? $quoteBilling->getFirstname()
1402
  : $infoObjBilling->getFirstname();
1403
  $cusLastname = ($quoteBilling->getLastname()) ? $quoteBilling->getLastname()
1404
  : $infoObjBilling->getLastname();
 
1405
  $helper = $this->helper;
1406
  if (!$this->_validateBasicParams()) {
1407
  $this->showException($helper->__('Basic parameter not valid') . '!', false);
1408
  return false;
 
 
 
 
1409
  } elseif (!$helper->validateEmail($cusEmail) || !$cusFirstname || !$cusLastname) {
1410
  $this->showException($helper->__('Customer name/email fields are not valid') . '!', false);
1411
  return false;
1414
  }
1415
 
1416
  /**
1417
+ * Validate manual checklimit and reassign product id and tariff id
1418
  *
1419
+ * @param varien_object $request
1420
+ * @return mixed
1421
  */
1422
+ private function _manualCheckValidate($request)
1423
  {
1424
+ $checkoutSession = $this->_getCheckout();
1425
+ $quote = $checkoutSession->getQuote();
1426
+ $setonholdPayments = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('setonholdPayments');
1427
+ $getAmount = $quote->hasNominalItems() ? $checkoutSession->getNnRowAmount()
1428
+ : $this->_getAmount();
1429
+ $amount = $this->helper->getFormatedAmount($getAmount);
1430
+ if (in_array($this->_code,$setonholdPayments) && $this->_manualCheckLimit <= $amount) {
1431
+ $request->setOnHold(1);
1432
+ }
1433
+
1434
+ return $request;
1435
  }
1436
 
1437
  /**
1438
+ * Validate Novalnet basic params
1439
  *
1440
+ * @return boolean
1441
  */
1442
  private function _validateBasicParams()
1443
  {
1444
+ $quote = $this->_getCheckout()->getQuote();
1445
  $helper = $this->helper;
1446
+
1447
  if ($helper->checkIsNumeric($this->_vendorId) && $this->_authcode && $helper->checkIsNumeric($this->_productId)
1448
+ && $helper->checkIsNumeric($this->_tariffId) && $quote->hasNominalItems()
1449
+ && $this->_subscribTariffId) {
1450
+ return true;
1451
+ } else if (!$quote->hasNominalItems() && $helper->checkIsNumeric($this->_vendorId)
1452
+ && $this->_authcode && $helper->checkIsNumeric($this->_productId)
1453
  && $helper->checkIsNumeric($this->_tariffId)) {
1454
  return true;
1455
  }
1467
  $total = $this->helper->getFormatedAmount($this->_getAmount());
1468
  $callBackMinimum = (int) $this->_getConfigData('callback_minimum_amount');
1469
  $countryCode = strtoupper($this->_getInfoObject()->getBillingAddress()->getCountryId());
1470
+ $checkOut = $this->_getCheckout();
1471
+ $quote = $checkOut->getQuote();
1472
+ $helper = $this->helper;
1473
+ if ($quote->hasNominalItems()) {
1474
+ $total = $helper->getFormatedAmount($checkOut->getNnRowAmount());
1475
+ }
1476
 
1477
+ return ($helper->getCheckoutSession()->$callbackTid() || ($this->_getConfigData('callback')
1478
+ && ($callBackMinimum ? $total >= $callBackMinimum : true) && ($helper->isCallbackTypeAllowed($countryCode))));
1479
  }
1480
 
1481
  /**
1482
  * Initiate callback process after selecting payment method
1483
  *
1484
+ * @param string $paymentCode
1485
+ * @param mixed $$infoInstance
1486
  */
1487
+ private function _initiateCallbackProcess($paymentCode, $infoInstance)
1488
  {
 
1489
  $isCallbackTypeCall = $this->isCallbackTypeCall();
1490
  $isPlaceOrder = $this->_isPlaceOrder();
1491
 
1496
  $callbackNewPin = "getNnNewCallbackPin" . $payCode;
1497
  $setcallbackPin = "setNnCallbackPin" . $payCode;
1498
 
1499
+ if (!$isPlaceOrder && $isCallbackTypeCall && $this->_getIncrementId() != $this->_getMethodSession()->$callbackOrderNo()) {
 
1500
  $this->unsetMethodSession();
1501
  }
1502
+
 
1503
  $methodSession = $this->_getMethodSession();
1504
+ // Validate callback session
1505
+ $this->_validateCallbackSession($payCode);
1506
+
1507
  if ($isCallbackTypeCall && $infoInstance->getCallbackPinValidationFlag()
1508
  && $methodSession->$callbackTid()) {
1509
  $nnCallbackPin = $infoInstance->$callbackPin();
1510
  if (!$infoInstance->$callbackNewPin() && (!$this->helper->checkIsValid($nnCallbackPin)
1511
  || empty($nnCallbackPin))) {
1512
+ $this->showException('The PIN you entered is incorrect');
1513
  }
1514
  }
1515
+ if ($isCallbackTypeCall && !$isPlaceOrder && $this->_getConfigData('callback')
1516
  != 3) {
1517
  if ($methodSession->$callbackTid()) {
1518
  if ($infoInstance->$callbackNewPin()) {
1519
+ $this->_regenerateCallbackPin($methodSession);
1520
  } else {
1521
  $methodSession->$setcallbackPin($infoInstance->$callbackPin());
1522
  }
1523
  } else {
1524
+ $this->_generateCallback($payCode);
1525
  }
1526
+ } elseif ($isCallbackTypeCall && !$isPlaceOrder && $this->_getConfigData('callback')
1527
  == 3) {
1528
 
1529
  if (!$methodSession->$callbackTid()) {
1530
+ $this->_generateCallback($payCode);
1531
  }
1532
  }
1533
  if ($isPlaceOrder) {
1534
+ $this->validateCallbackProcess($payCode);
1535
  }
1536
  }
1537
 
1538
  /**
1539
+ * Validate order amount is getting changed after callback initiation
1540
  *
1541
+ * @param string $payCode
1542
+ * @param mixed $methodSession
1543
  * throw Mage Exception
1544
  */
1545
+ private function _validateCallbackSession($payCode)
1546
  {
 
1547
  $callbackTid = "hasNnCallbackTid" . $payCode;
1548
  $getNnDisableTime = "getNnDisableTime" . $payCode;
1549
+ $quote = $this->_getCheckout()->getQuote();
1550
  $checkoutSession = $this->_getCheckout();
1551
+ $methodSession = $this->_getMethodSession();
1552
+ $helper = $this->helper;
1553
+
1554
+ if ($quote->hasNominalItems()) {
1555
+ $amount = $helper->getFormatedAmount(Mage::getSingleton('checkout/session')->getNnRowAmount());
1556
+ } else {
1557
+ $amount = $helper->getFormatedAmount($this->_getAmount());
1558
+ }
1559
 
1560
  if ($methodSession->$callbackTid()) {
1561
  if ($checkoutSession->$getNnDisableTime() && time() > $checkoutSession->$getNnDisableTime()) {
1562
  $this->unsetMethodSession();
1563
+ } elseif ($methodSession->getOrderAmount() != $amount) {
1564
  $this->unsetMethodSession();
1565
+ if (!$this->_isPlaceOrder()) {
1566
+ $this->showException('The order amount has been changed, please proceed with the new order');
 
 
 
 
1567
  }
1568
  }
1569
  }
1576
  */
1577
  private function _getIncrementId()
1578
  {
1579
+ $storeId = $this->helper->getMagentoStoreId();
1580
  $orders = Mage::getModel('sales/order')->getCollection()
1581
  ->addAttributeToFilter('store_id', $storeId)
1582
  ->setOrder('entity_id', 'DESC');
1592
  /**
1593
  * Make callback request and validate response
1594
  *
1595
+ * @param string $payCode
1596
  */
1597
+ private function _generateCallback($payCode)
1598
  {
 
1599
  $callbackTid = "setNnCallbackTid" . $payCode;
1600
  $callbackOrderNo = "setNnCallbackOrderNo" . $payCode;
1601
+ $quote = $this->_getCheckout()->getQuote();
1602
+ $nominalItem = $quote->hasNominalItems();
1603
+ if ($nominalItem) {
1604
+ $request = $this->buildRequest(Novalnet_Payment_Model_Config::POST_CALLBACK, NULL, NULL, $nominalItem);
1605
+ $response = $this->postRequest($request);
1606
+ $this->_getCheckout()->setNominalRequest($request)
1607
+ ->setNominalResponse($response);
1608
+ } else {
1609
+ $request = $this->buildRequest(Novalnet_Payment_Model_Config::POST_CALLBACK);
1610
+ $response = $this->postRequest($request);
1611
+ $this->_getCheckout()->setPaymentReqData($request)
1612
+ ->setPaymentResData($response);
1613
+ $this->logNovalnetTransactionData($request, $response, $response->getTid());
1614
+ }
1615
 
1616
+ $this->_getCheckout()->setNnCallbackReqData($request);
 
 
1617
  if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
1618
  $this->_getMethodSession()
1619
  ->$callbackTid(trim($response->getTid()))
1621
  ->setNnCallbackTidTimeStamp(time())
1622
  ->setOrderAmount($request->getAmount())
1623
  ->setNnCallbackSuccessState(true)
1624
+ ->$callbackOrderNo(trim($response->getOrderNo()));
 
 
1625
  if ($this->_getConfigData('callback') == 3) {
1626
  $text = $this->helper->__('Please reply to the e-mail');
1627
+ } else if($this->_getConfigData('callback') == 2) {
1628
+ $text = $this->helper->__('You will shortly receive an SMS containing your transaction PIN to complete the payment');
1629
  } else {
1630
+ $text = $this->helper->__('You will shortly receive a transaction PIN through phone call to complete the payment');
1631
  }
1632
  } else {
1633
  $text = $this->helper->htmlEscape($response->getStatusDesc());
1638
  /**
1639
  * Regenerate new pin for callback process
1640
  *
1641
+ * @param mixed $methodSession
1642
+ * throw Mage Exception
1643
  */
1644
+ private function _regenerateCallbackPin($methodSession)
1645
  {
1646
  $callbackTid = "getNnCallbackTid" . ucfirst($this->_code);
 
1647
  $response = $this->doNovalnetStatusCall($methodSession->$callbackTid(), NULL, Novalnet_Payment_Model_Config::TRANSMIT_PIN_AGAIN);
1648
+
1649
  if ($response->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
1650
+ $text = $this->helper->__('You will shortly receive an SMS containing your transaction PIN to complete the payment');
1651
  } else {
1652
+ $text = $this->helper->htmlEscape($response->getStatusMessage()); // Status_message
1653
  }
1654
+
1655
  $this->showException($text, false);
1656
  }
1657
 
1658
  /**
1659
+ * Validate callback response
1660
  *
1661
+ * @param string $payCode
1662
+ * @param mixed $methodSession
1663
  */
1664
+ public function validateCallbackProcess($payCode)
1665
  {
 
1666
  $callbackTid = "getNnCallbackTid" . $payCode;
1667
  $callbackPin = "getNnCallbackPin" . $payCode;
1668
  $setNnDisableTime = "setNnDisableTime" . $payCode;
1696
  }
1697
 
1698
  /**
1699
+ * Log Novalnet transaction data
1700
  *
1701
  * @param varien_object $request
1702
  * @param varien_object $response
1703
  * @param int $txnId
1704
  * @param int $customerId
1705
  * @param int $storeId
1706
+ * @param int $orderNo
1707
+ * @param int $subsId
1708
  */
1709
+ public function logNovalnetTransactionData($request = NULL, $response = NULL, $txnId, $customerId
1710
+ = NULL, $storeId = NULL, $orderNo = NULL, $subsId = NULL
1711
+ )
1712
+ {
1713
  $this->dataHelper->doRemoveSensitiveData($request, $this->_code);
1714
+ $helper = $this->helper;
1715
+ $shopUrl = ($response->getMemburl()) ? $response->getMemburl() : $helper->getCurrentSiteUrl();
1716
+ if ($orderNo == NULL) {
1717
+ $orderNo = $this->_getOrderId();
1718
+ }
1719
+
1720
+ $customerId = ($customerId) ? $customerId : $helper->getCustomerId();
1721
+ $storeId = ($storeId) ? $storeId : $helper->getMagentoStoreId();
1722
+ $modNovalTransactionOverview = $helper->getModelTransactionOverview();
1723
+ $modNovalTransactionOverview->setTransactionId($txnId)
1724
+ ->setOrderId($orderNo)
1725
  ->setRequestData(serialize($request->getData()))
1726
+ ->setResponseData(base64_encode(serialize($response->getData())))
1727
  ->setCustomerId($customerId)
1728
  ->setStatus($response->getStatus())
1729
  ->setStoreId($storeId)
1730
+ ->setShopUrl($shopUrl);
1731
+ if ($subsId) {
1732
+ $modNovalTransactionOverview->setAdditionalData($helper->getCurrentDateTime());
1733
+ }
1734
+ $modNovalTransactionOverview->setCreatedDate($helper->getCurrentDateTime())
1735
+ ->save();
1736
+ }
1737
+
1738
+ /**
1739
+ * Log Novalnet transaction status data
1740
+ *
1741
+ * @param varien_object $response
1742
+ * @param int $txnId
1743
+ * @param int $customerId
1744
+ * @param int $storeId
1745
+ * @param float $amount
1746
+ */
1747
+ public function logNovalnetStatusData($response, $txnId, $customerId = NULL, $storeId
1748
+ = NULL, $amount = NULL
1749
+ )
1750
+ {
1751
+ $helper = $this->helper;
1752
+ $shopUrl = ($response->getMemburl()) ? $response->getMemburl() : $helper->getCurrentSiteUrl();
1753
+ $customerId = ($customerId) ? $customerId : $helper->getCustomerId();
1754
+ $storeId = ($storeId) ? $storeId : $helper->getMagentoStoreId();
1755
+ $amount = ($amount) ? $amount : $response->getAmount();
1756
+ $modNovalTransactionStatus = $helper->getModelTransactionStatus();
1757
+ $modNovalTransactionStatus->setTransactionNo($txnId)
1758
+ ->setOrderId($this->_getOrderId()) // Order number
1759
+ ->setTransactionStatus($response->getStatus()) // Transaction status code
1760
+ ->setNcNo($response->getNcNo())
1761
+ ->setCustomerId($customerId) // Customer number
1762
+ ->setPaymentName($this->_code) // Payment name
1763
+ ->setAmount($amount) // Amount
1764
+ ->setRemoteIp($helper->getRealIpAddr()) // Remote ip
1765
+ ->setStoreId($storeId) // Store id
1766
  ->setShopUrl($shopUrl)
1767
+ ->setCreatedDate($helper->getCurrentDateTime()) // Created date
1768
  ->save();
1769
  }
1770
 
1771
  /**
1772
+ * Log Novalnet payment response data
1773
+ *
1774
+ * @param varien_object $response
1775
+ * @param int $orderId
1776
+ */
1777
+ public function doTransactionOrderLog($response, $orderId)
1778
+ {
1779
+ $helper = $this->helper;
1780
+ $modNovalTransactionOverview = $helper->getModelTransactionOverview()->loadByAttribute('order_id', $orderId);
1781
+ $modNovalTransactionOverview->setTransactionId($response->gettid())
1782
+ ->setResponseData(base64_encode(serialize($response->getData())))
1783
+ ->setCustomerId($helper->getCustomerId())
1784
+ ->setStatus($response->getstatus()) // Transaction status code
1785
+ ->setStoreId($helper->getMagentoStoreId())
1786
+ ->setShopUrl($helper->getCurrentSiteUrl())
1787
+ ->save();
1788
+ }
1789
+
1790
+ /**
1791
+ * Get current infoinstance
1792
  *
1793
  * @return Mage_Payment_Model_Method_Abstract
1794
  */
1818
  /**
1819
  * Whether current operation is order placement
1820
  *
1821
+ * @return boolean
1822
  */
1823
  private function _isPlaceOrder()
1824
  {
1831
  }
1832
 
1833
  /**
1834
+ * Get grand total amount
1835
  *
1836
+ * @return double
1837
  */
1838
  private function _getAmount()
1839
  {
1860
  }
1861
  }
1862
 
1863
+ /**
1864
+ * Get payment data for current order
1865
+ *
1866
+ * @return Mage_Payment_Model_Method_Abstract
1867
+ */
1868
+ private function _getNnPaymentData()
1869
+ {
1870
+ $info = $this->_getInfoInstance();
1871
+ if ($this->_isPlaceOrder()) {
1872
+ return $info->getOrder()->getPayment();
1873
+ } else {
1874
+ return $info;
1875
+ }
1876
+ }
1877
+
1878
  /**
1879
  * Retrieve model helper
1880
  *
1881
+ * @return Novalnet_Payment_Helper_Data
1882
  */
1883
  protected function _getHelper()
1884
  {
1888
  /**
1889
  * Retrieve Assign data helper
1890
  *
1891
+ * @return Novalnet_Payment_Helper_AssignData
1892
  */
1893
  protected function _getDataHelper()
1894
  {
1902
  * @param $lang
1903
  * @return Mage::throwException
1904
  */
1905
+ public function showException($text, $lang = true)
1906
  {
1907
  if ($lang) {
1908
+ $text = $this->helper->__($text);
1909
  }
1910
+ return Mage::throwException($text);
 
1911
  }
1912
 
1913
  /**
1925
  }
1926
  }
1927
 
1928
+ /**
1929
+ * Get Billing Address
1930
+ *
1931
+ * @return string
1932
+ */
1933
+ private function _getBillingAddress()
1934
+ {
1935
+ $info = $this->getInfoInstance();
1936
+ if ($this->_isPlaceOrder()) {
1937
+ return $info->getOrder()->getBillingAddress();
1938
+ } else {
1939
+ return $info->getQuote()->getBillingAddress();
1940
+ }
1941
+ }
1942
+
1943
+ /**
1944
+ * Get all order items
1945
+ *
1946
+ * @param varien_object $order
1947
+ * @return mixed
1948
+ */
1949
+ private function getPaymentAllItems($order)
1950
+ {
1951
+ $orderItems = $order->getAllItems();
1952
+ return $orderItems;
1953
+ }
1954
+
1955
  /**
1956
  * Get redirect URL
1957
  *
1958
+ * @return string
1959
  */
1960
  public function getOrderPlaceRedirectUrl()
1961
  {
1962
  $redirectPayment = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('redirectPayments');
1963
+ $helper = $this->helper;
1964
  if ((in_array($this->_code, $redirectPayment)) || ($this->_code == Novalnet_Payment_Model_Config::NN_CC
1965
+ && !$helper->checkIsAdmin() && $this->_getConfigData('active_cc3d')
1966
  == 1)) {
1967
+ $actionUrl = $helper->getUrl(Novalnet_Payment_Model_Config::GATEWAY_REDIRECT_URL);
1968
  } else {
1969
+ $actionUrl = $helper->getUrl(Novalnet_Payment_Model_Config::GATEWAY_DIRECT_URL);
1970
  }
1971
  return $actionUrl;
1972
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/{NovalnetSofortueberweisung.php → NovalnetBanktransfer.php} RENAMED
@@ -23,15 +23,12 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Novalnet_Payment_Model_Payment_Method_NovalnetSofortueberweisung extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_SOFORT;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_CAPTURE;
31
- protected $_canRefund = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_REFUND;
32
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_USE_INTERNAL;
33
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_USE_MULTISHIPPING;
34
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_SOFORT_FORM_BLOCK;
35
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_SOFORT_INFO_BLOCK;
36
-
37
  }
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Novalnet_Payment_Model_Payment_Method_NovalnetBanktransfer extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_SOFORT;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_CAPTURE;
 
30
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_USE_INTERNAL;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_SOFORT_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_SOFORT_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_SOFORT_INFO_BLOCK;
 
34
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetCc.php CHANGED
@@ -25,12 +25,10 @@
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetCc extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_CC;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_CC_CAN_CAPTURE;
31
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_CC_CAN_USE_INTERNAL;
32
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_CC_CAN_USE_MULTISHIPPING;
33
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_CC_FORM_BLOCK;
34
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_CC_INFO_BLOCK;
35
-
36
  }
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetCc extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_CC;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_CC_CAN_CAPTURE;
30
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_CC_CAN_USE_INTERNAL;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_CC_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_CC_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_CC_INFO_BLOCK;
 
34
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetEps.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Payment_Method_NovalnetEps extends Novalnet_Payment_Model_Payment_Method_Abstract
27
+ {
28
+ protected $_code = Novalnet_Payment_Model_Config::NN_EPS;
29
+ protected $_canCapture = Novalnet_Payment_Model_Config::NN_EPS_CAN_CAPTURE;
30
+ protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_EPS_CAN_USE_INTERNAL;
31
+ protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_EPS_CAN_USE_MULTISHIPPING;
32
+ protected $_formBlockType = Novalnet_Payment_Model_Config::NN_EPS_FORM_BLOCK;
33
+ protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_EPS_INFO_BLOCK;
34
+ }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetIdeal.php CHANGED
@@ -25,13 +25,10 @@
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetIdeal extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_IDEAL;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_CAPTURE;
31
- protected $_canRefund = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_REFUND;
32
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_USE_INTERNAL;
33
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_USE_MULTISHIPPING;
34
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_IDEAL_FORM_BLOCK;
35
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_IDEAL_INFO_BLOCK;
36
-
37
  }
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetIdeal extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_IDEAL;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_CAPTURE;
 
30
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_USE_INTERNAL;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_IDEAL_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_IDEAL_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_IDEAL_INFO_BLOCK;
 
34
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetInvoice.php CHANGED
@@ -25,11 +25,9 @@
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetInvoice extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_INVOICE;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_INVOICE_CAN_CAPTURE;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_INVOICE_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_INVOICE_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_INVOICE_INFO_BLOCK;
34
-
35
  }
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetInvoice extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_INVOICE;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_INVOICE_CAN_CAPTURE;
30
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_INVOICE_CAN_USE_MULTISHIPPING;
31
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_INVOICE_FORM_BLOCK;
32
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_INVOICE_INFO_BLOCK;
 
33
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetPaypal.php CHANGED
@@ -25,13 +25,10 @@
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetPaypal extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_PAYPAL;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_CAPTURE;
31
- protected $_canRefund = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_REFUND;
32
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_USE_INTERNAL;
33
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_USE_MULTISHIPPING;
34
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_PAYPAL_FORM_BLOCK;
35
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_PAYPAL_INFO_BLOCK;
36
-
37
  }
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetPaypal extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_PAYPAL;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_CAPTURE;
 
30
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_USE_INTERNAL;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_PAYPAL_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_PAYPAL_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_PAYPAL_INFO_BLOCK;
 
34
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetPrepayment.php CHANGED
@@ -25,11 +25,9 @@
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetPrepayment extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_PREPAYMENT;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_PREPAYMENT_CAN_CAPTURE;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_PREPAYMENT_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_PREPAYMENT_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_PREPAYMENT_INFO_BLOCK;
34
-
35
  }
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetPrepayment extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_PREPAYMENT;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_PREPAYMENT_CAN_CAPTURE;
30
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_PREPAYMENT_CAN_USE_MULTISHIPPING;
31
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_PREPAYMENT_FORM_BLOCK;
32
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_PREPAYMENT_INFO_BLOCK;
 
33
  }
app/code/community/Novalnet/Payment/Model/Payment/Method/NovalnetSepa.php CHANGED
@@ -25,12 +25,10 @@
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetSepa extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
28
-
29
  protected $_code = Novalnet_Payment_Model_Config::NN_SEPA;
30
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_SEPA_CAN_CAPTURE;
31
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_SEPA_CAN_USE_INTERNAL;
32
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_SEPA_CAN_USE_MULTISHIPPING;
33
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_SEPA_FORM_BLOCK;
34
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_SEPA_INFO_BLOCK;
35
-
36
  }
25
  */
26
  class Novalnet_Payment_Model_Payment_Method_NovalnetSepa extends Novalnet_Payment_Model_Payment_Method_Abstract
27
  {
 
28
  protected $_code = Novalnet_Payment_Model_Config::NN_SEPA;
29
  protected $_canCapture = Novalnet_Payment_Model_Config::NN_SEPA_CAN_CAPTURE;
30
  protected $_canUseInternal = Novalnet_Payment_Model_Config::NN_SEPA_CAN_USE_INTERNAL;
31
  protected $_canUseForMultishipping = Novalnet_Payment_Model_Config::NN_SEPA_CAN_USE_MULTISHIPPING;
32
  protected $_formBlockType = Novalnet_Payment_Model_Config::NN_SEPA_FORM_BLOCK;
33
  protected $_infoBlockType = Novalnet_Payment_Model_Config::NN_SEPA_INFO_BLOCK;
 
34
  }
app/code/community/Novalnet/Payment/Model/Quote/Address/Total/Nominal.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Quote_Address_Total_Nominal extends Mage_Sales_Model_Quote_Address_Total_Nominal
27
+ {
28
+ /**
29
+ * Invoke collector for nominal items
30
+ *
31
+ * @param Mage_Sales_Model_Quote_Address $address
32
+ * @param Mage_Sales_Model_Quote_Address_Total_Nominal
33
+ */
34
+ public function collect(Mage_Sales_Model_Quote_Address $address)
35
+ {
36
+ $collector = Mage::getSingleton('sales/quote_address_total_nominal_collector', array(
37
+ 'store' => $address->getQuote()->getStore())
38
+ );
39
+
40
+ // invoke nominal totals
41
+ foreach ($collector->getCollectors() as $model) {
42
+ $model->collect($address);
43
+ }
44
+
45
+ // aggregate collected amounts into one to have sort of grand total per item
46
+ $total = 0;
47
+ foreach ($address->getAllNominalItems() as $item) {
48
+ $rowTotal = 0;
49
+ $baseRowTotal = 0;
50
+ $totalDetails = array();
51
+ foreach ($collector->getCollectors() as $model) {
52
+ $itemRowTotal = $model->getItemRowTotal($item);
53
+ if ($model->getIsItemRowTotalCompoundable($item)) {
54
+ $rowTotal += $itemRowTotal;
55
+ $baseRowTotal += $model->getItemBaseRowTotal($item);
56
+ $isCompounded = true;
57
+ } else {
58
+ $isCompounded = false;
59
+ }
60
+
61
+ if ((float) $itemRowTotal > 0) {
62
+ $label = $model->getLabel();
63
+ $helper = Mage::helper('novalnet_payment');
64
+ $regularPayment = $helper->__('Regular Payment');
65
+ $shipping = $helper->__('Shipping');
66
+ $tax = $helper->__('Tax');
67
+ if ($label == $regularPayment || $label == $shipping || $label
68
+ == $tax) {
69
+ $total = $total + $itemRowTotal;
70
+ }
71
+ $totalDetails[] = new Varien_Object(array(
72
+ 'label' => $label,
73
+ 'amount' => $itemRowTotal,
74
+ 'is_compounded' => $isCompounded,
75
+ ));
76
+ }
77
+ }
78
+ $session = Mage::getSingleton('checkout/session');
79
+ $session->setNnRegularAmount($total);
80
+ $session->setNnRowAmount($rowTotal);
81
+
82
+ $item->setNominalRowTotal($rowTotal);
83
+ $item->setBaseNominalRowTotal($baseRowTotal);
84
+ $item->setNominalTotalDetails($totalDetails);
85
+ }
86
+
87
+ return $this;
88
+ }
89
+
90
+ /**
91
+ * Fetch collected nominal items
92
+ *
93
+ * @param Mage_Sales_Model_Quote_Address $address
94
+ * @return Mage_Sales_Model_Quote_Address_Total_Nominal
95
+ */
96
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
97
+ {
98
+ $items = $address->getAllNominalItems();
99
+ if ($items) {
100
+ $address->addTotal(array(
101
+ 'code' => $this->getCode(),
102
+ 'title' => Mage::helper('sales')->__('Nominal Items'),
103
+ 'items' => $items,
104
+ 'area' => 'footer',
105
+ ));
106
+ }
107
+ return $this;
108
+ }
109
+ }
app/code/community/Novalnet/Payment/Model/Recurring.php ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Recurring extends Mage_Core_Model_Abstract
27
+ {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Recurring
33
+ */
34
+ public function _construct()
35
+ {
36
+ parent::_construct();
37
+ $this->_init('novalnet_payment/recurring');
38
+ }
39
+
40
+ /**
41
+ * Perform profile process
42
+ *
43
+ * @param Mage_Payment_Model_Recurring_Profile $profile
44
+ */
45
+ public function getProfileProgress($profile)
46
+ {
47
+ $checkout = Mage::getSingleton('checkout/session');
48
+ $quote = $checkout->getQuote();
49
+ $paymentObj = $quote->getPayment()->getMethodInstance();
50
+ $paymentCode = $quote->getPayment()->getMethod();
51
+ $helper = $paymentObj->helper;
52
+ if ($checkout->getNominalRequest() && $checkout->getNominalResponse()) {
53
+ $paymentObj->validateCallbackProcess(ucfirst($paymentCode));
54
+ $request = $checkout->getNominalRequest();
55
+ $result = $checkout->getNominalResponse();
56
+ } else {
57
+ $request = $this->_buildRecurringRequest($profile, $paymentObj);
58
+ $result = $paymentObj->postRequest($request);
59
+ }
60
+ $txnId = trim($result->getTid());
61
+ //set profile reference id
62
+ $profile->setReferenceId($txnId);
63
+ if ($result->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
64
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
65
+ $statusText = ($result->getStatusText()) ? $result->getStatusText() : $helper->__('successful');
66
+ $helper->getCoresession()->addSuccess($statusText);
67
+ if ($paymentCode == Novalnet_Payment_Model_Config::NN_SEPA) {
68
+ // log sepa refill information for login users
69
+ $paymentObj->sepaPaymentRefill();
70
+ }
71
+
72
+ $ipnRequest = Mage::getModel('novalnet_payment/ipn')->processIpnRequest($this->_buildPostBackRequestForRecurring($request,$profile, $result, $paymentObj), new Varien_Http_Adapter_Curl(), $request, $result);
73
+ // unset form payment method session
74
+ $paymentObj->unsetFormMethodSession();
75
+ // unset payment request and response values
76
+ $paymentObj->unsetPaymentReqResData();
77
+ // unset current payment method session
78
+ $paymentObj->unsetMethodSession();
79
+ // update the inventory
80
+ $this->updateInventory($quote);
81
+ } else {
82
+ $error = $result->getStatusMessage() ? $result->getStatusMessage() : ($result->getStatusDesc() ? $result->getStatusDesc()
83
+ : ($result->getStatusText() ? $result->getStatusText() : $this->helper->__('Error in capturing the payment')));
84
+ if ($error !== false) {
85
+ Mage::throwException($error);
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ * To build recurring post back request
92
+ *
93
+ * @param varien_object $config
94
+ * @param Mage_Payment_Model_Recurring_Profile $profile
95
+ * @param varien_object $result
96
+ * @param varien_object $paymentObj
97
+ * @result varien_object
98
+ */
99
+ protected function _buildPostBackRequestForRecurring($config, $profile, $result, $paymentObj)
100
+ {
101
+ $request = Mage::getModel('novalnet_payment/novalnet_request');
102
+ $shopMode = (!$paymentObj->_getConfigData('live_mode')) ? 1 : 0;
103
+ $serverResponse = $result->getTestMode();
104
+ $testMode = (((isset($serverResponse) && $serverResponse == 1) || (isset($shopMode)
105
+ && $shopMode == 0)) ? 1 : 0 );
106
+ $data = $paymentObj->setPaymentAddtionaldata($result, $config);
107
+
108
+ $request->setVendor($config->getVendor())
109
+ ->setAuthCode($config->getAuthCode())
110
+ ->setProduct($config->getProduct())
111
+ ->setTariff($config->getTariff())
112
+ ->setKey($config->getKey())
113
+ ->setProfileId($profile->getId())
114
+ ->setSignupTid($result->getTid())
115
+ ->setTid($result->getTid())
116
+ ->setStatus($result->getStatus())
117
+ ->setAmount($result->getAmount())
118
+ ->setTestMode($testMode)
119
+ ->setAdditionalData(serialize($data));
120
+ return $request;
121
+ }
122
+
123
+ /**
124
+ * Prepare request to gateway
125
+ *
126
+ * @param Mage_Payment_Model_Recurring_Profile $profile
127
+ * @param varien_object $paymentObj
128
+ * @return mixed
129
+ */
130
+ protected function _buildRecurringRequest(Mage_Payment_Model_Recurring_Profile $profile, $paymentObj)
131
+ {
132
+ $request = Mage::getModel('novalnet_payment/novalnet_request');
133
+ $amount = round(($profile->getBillingAmount() + $profile->getShippingAmount()
134
+ + $profile->getTaxAmount()), 2) * 100;
135
+ $initAmount = $profile->getInitAmount();
136
+ $trialAmount = $profile->getTrialBillingAmount();
137
+ if ($initAmount != '' || $trialAmount) {
138
+ $amountValue = $this->recurringAmount($profile);
139
+ } else {
140
+ $amountValue = $amount;
141
+ }
142
+ $peroidUnit = $profile->getPeriodUnit();
143
+ $periodUnitFormat = array("day" => "d", "month" => "m", "year" => "y");
144
+
145
+ if ($peroidUnit == "semi_month") {
146
+ $tariffPeriod2 = "14d";
147
+ } elseif ($peroidUnit == "week") {
148
+ $tariffPeriod2 = ($profile->getPeriodFrequency() * 7) . "d";
149
+ } else {
150
+ $tariffPeriod2 = $profile->getPeriodFrequency() . $periodUnitFormat[$peroidUnit];
151
+ }
152
+ $storeId = $paymentObj->helper->getMagentoStoreId();
153
+ $request = $paymentObj->buildRequest(Novalnet_Payment_Model_Config::POST_NORMAL, $storeId, $amountValue);
154
+
155
+ $request->setTariffPeriod($tariffPeriod2)
156
+ ->setTariffPeriod2($tariffPeriod2)
157
+ ->setTariffPeriod2Amount($amount);
158
+
159
+ return $request;
160
+ }
161
+
162
+ /**
163
+ * Get Recurring amount
164
+ *
165
+ * @param int @profile
166
+ * @return int
167
+ */
168
+ public function recurringAmount($profile)
169
+ {
170
+ $trialAmount = $profile->getTrialBillingAmount();
171
+ $initAmount = $profile->getInitAmount();
172
+ $billingAmount = $profile->getBillingAmount();
173
+ if ($trialAmount != '' && $initAmount != '' && $billingAmount != '') {
174
+ $amount = round(($trialAmount + $initAmount + $profile->getShippingAmount()
175
+ + $profile->getTaxAmount()), 2) * 100;
176
+ } else if ($trialAmount != '' && $billingAmount != '') {
177
+ $amount = round(($trialAmount + $profile->getShippingAmount() + $profile->getTaxAmount()), 2)
178
+ * 100;
179
+ } else if ($initAmount != '' && $billingAmount != '') {
180
+ $amount = round(($initAmount + $billingAmount + $profile->getShippingAmount()
181
+ + $profile->getTaxAmount()), 2) * 100;
182
+ } else {
183
+ $amount = round(($billingAmount + $profile->getShippingAmount() + $profile->getTaxAmount()), 2)
184
+ * 100;
185
+ }
186
+ return $amount;
187
+ }
188
+
189
+
190
+ /**
191
+ * Get Recurring Increment Id
192
+ *
193
+ * @param int @profile
194
+ * @return int
195
+ */
196
+ public function getRecurringOrderNo($profile)
197
+ {
198
+ $recurringProfileCollection = Mage::getResourceModel('sales/order_grid_collection')
199
+ ->addRecurringProfilesFilter($profile->getId());
200
+ foreach ($recurringProfileCollection as $recurringProfileCollectionValue) {
201
+ $orderNo = $recurringProfileCollectionValue->getIncrementId();
202
+ }
203
+ return $orderNo;
204
+ }
205
+
206
+ /**
207
+ * Get Sales Order
208
+ *
209
+ * @param int @incrementId
210
+ * @return varien_object
211
+ */
212
+ public function getOrderByIncrementId($incrementId)
213
+ {
214
+ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
215
+ return $order;
216
+ }
217
+
218
+ /**
219
+ * Get recurring capture total amount
220
+ *
221
+ * @param int $lastTranId
222
+ * @param varien_object $order
223
+ * @return int
224
+ */
225
+ public function getRecurringCaptureTotal($lastTranId,$order)
226
+ {
227
+ $profileInfo = Mage::getModel('sales/recurring_profile')->load($lastTranId, 'reference_id');
228
+ $billingAmount = $profileInfo->getBillingAmount();
229
+ $initialAmount = $profileInfo->getInitAmount();
230
+ $trialAmount = $profileInfo->getTrialBillingAmount();
231
+ $shippingAmount = $profileInfo->getShippingAmount();
232
+ $taxAmount = $profileInfo->getTaxAmount();
233
+
234
+ if ($initialAmount != '' && $trialAmount != '' && $billingAmount != '') {
235
+ $amountvalue = round(($trialAmount + $initialAmount + $shippingAmount + $taxAmount), 2);
236
+ } else if ($trialAmount != '' && $billingAmount != '') {
237
+ $amountvalue = round(($trialAmount + $shippingAmount + $taxAmount), 2);
238
+ } else if ($initialAmount != '' && $billingAmount != '') {
239
+ $amountvalue = round(($initialAmount + $billingAmount + $shippingAmount + $taxAmount), 2);
240
+ } else {
241
+ $amountvalue = $order->getGrandTotal();
242
+ }
243
+ $loadTransaction = Mage::helper('novalnet_payment')->loadTransactionStatus($lastTranId)
244
+ ->setAmount($amountvalue)
245
+ ->save();
246
+
247
+ return $amountvalue;
248
+ }
249
+
250
+ /**
251
+ * update the product inventory (stock)
252
+ *
253
+ * @param varien_object $quote
254
+ */
255
+ private function updateInventory($quote)
256
+ {
257
+ foreach ($quote->getAllVisibleItems() as $quoteItem) {
258
+ $itemsQtyOrdered = $quoteItem->getQty();
259
+ $productId = $quoteItem->getProductId();
260
+ break;
261
+ }
262
+
263
+ if ($productId) {
264
+ $stockObj = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
265
+ $productQtyBefore = (int)$stockObj->getQty();
266
+ }
267
+
268
+ if (isset($productQtyBefore) && $productQtyBefore > 0) {
269
+ $productQtyAfter = (int)($productQtyBefore - $itemsQtyOrdered);
270
+ $stockData['qty'] = $productQtyAfter;
271
+ $stockObj->setQty($productQtyAfter);
272
+ $stockObj->save();
273
+ }
274
+
275
+ Mage::getSingleton('checkout/session')->unsNnRegularAmount()
276
+ ->unsNnRowAmount();
277
+ }
278
+ }
app/code/community/Novalnet/Payment/Model/Recurring/Profile.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Recurring_Profile extends Mage_Sales_Model_Recurring_Profile
27
+ {
28
+ /**
29
+ * Initialize new order based on profile data
30
+ *
31
+ * Takes arbitrary number of Varien_Object instances to be treated as items for new order
32
+ *
33
+ * @return Mage_Sales_Model_Order
34
+ */
35
+ public function createOrder()
36
+ {
37
+ $items = array();
38
+ $itemInfoObjects = func_get_args();
39
+
40
+ $billingAmount = 0;
41
+ $shippingAmount = 0;
42
+ $taxAmount = 0;
43
+ $isVirtual = 1;
44
+ $weight = 0;
45
+ foreach ($itemInfoObjects as $itemInfo) {
46
+ $item = $this->_getItem($itemInfo);
47
+ $billingAmount += $item->getPrice();
48
+ $shippingAmount += $item->getShippingAmount();
49
+ $taxAmount += $item->getTaxAmount();
50
+ $weight += $item->getWeight();
51
+ if (!$item->getIsVirtual()) {
52
+ $isVirtual = 0;
53
+ }
54
+ $items[] = $item;
55
+ }
56
+ $qtyOrdered = $this->getInfoValue('order_info', 'items_qty');
57
+ if ($qtyOrdered > 1) {
58
+ $billingAmount = ($billingAmount * $qtyOrdered);
59
+ }
60
+ $grandTotal = $billingAmount + $shippingAmount + $taxAmount;
61
+
62
+ $order = Mage::getModel('sales/order');
63
+
64
+ $billingAddress = Mage::getModel('sales/order_address')
65
+ ->setData($this->getBillingAddressInfo())
66
+ ->setId(null);
67
+
68
+ $shippingInfo = $this->getShippingAddressInfo();
69
+ $shippingAddress = Mage::getModel('sales/order_address')
70
+ ->setData($shippingInfo)
71
+ ->setId(null);
72
+
73
+ $payment = Mage::getModel('sales/order_payment')
74
+ ->setMethod($this->getMethodCode());
75
+
76
+ $transferDataKays = array(
77
+ 'store_id', 'store_name', 'customer_id', 'customer_email',
78
+ 'customer_firstname', 'customer_lastname', 'customer_middlename', 'customer_prefix',
79
+ 'customer_suffix', 'customer_taxvat', 'customer_gender', 'customer_is_guest',
80
+ 'customer_note_notify', 'customer_group_id', 'customer_note', 'shipping_method',
81
+ 'shipping_description', 'base_currency_code', 'global_currency_code',
82
+ 'order_currency_code',
83
+ 'store_currency_code', 'base_to_global_rate', 'base_to_order_rate', 'store_to_base_rate',
84
+ 'store_to_order_rate'
85
+ );
86
+
87
+ $orderInfo = $this->getOrderInfo();
88
+ foreach ($transferDataKays as $key) {
89
+ if (isset($orderInfo[$key])) {
90
+ $order->setData($key, $orderInfo[$key]);
91
+ } elseif (isset($shippingInfo[$key])) {
92
+ $order->setData($key, $shippingInfo[$key]);
93
+ }
94
+ }
95
+
96
+ $order->setStoreId($this->getStoreId())
97
+ ->setState(Mage_Sales_Model_Order::STATE_NEW)
98
+ ->setBaseToOrderRate($this->getInfoValue('order_info', 'base_to_quote_rate'))
99
+ ->setStoreToOrderRate($this->getInfoValue('order_info', 'store_to_quote_rate'))
100
+ ->setOrderCurrencyCode($this->getInfoValue('order_info', 'quote_currency_code'))
101
+ ->setBaseSubtotal($billingAmount)
102
+ ->setSubtotal($billingAmount)
103
+ ->setBaseShippingAmount($shippingAmount)
104
+ ->setShippingAmount($shippingAmount)
105
+ ->setBaseTaxAmount($taxAmount)
106
+ ->setTaxAmount($taxAmount)
107
+ ->setBaseGrandTotal($grandTotal)
108
+ ->setGrandTotal($grandTotal)
109
+ ->setIsVirtual($isVirtual)
110
+ ->setWeight($weight)
111
+ ->setTotalQtyOrdered($this->getInfoValue('order_info', 'items_qty'))
112
+ ->setBillingAddress($billingAddress)
113
+ ->setShippingAddress($shippingAddress)
114
+ ->setPayment($payment);
115
+
116
+ foreach ($items as $item) {
117
+ $order->addItem($item);
118
+ }
119
+
120
+ return $order;
121
+ }
122
+
123
+ /**
124
+ * Get the reqular order items
125
+ *
126
+ * @param varien_object $itemInfo
127
+ * @return mixed
128
+ */
129
+ protected function _getRegularItem($itemInfo)
130
+ {
131
+ $price = $itemInfo->getPrice() ? $itemInfo->getPrice() : $this->getBillingAmount();
132
+ $shippingAmount = $itemInfo->getShippingAmount() ? $itemInfo->getShippingAmount()
133
+ : $this->getShippingAmount();
134
+ $taxAmount = $itemInfo->getTaxAmount() ? $itemInfo->getTaxAmount() : $this->getTaxAmount();
135
+
136
+ $qtyOrdered = $this->getInfoValue('order_info', 'items_qty');
137
+ $pricevalue = ($price / $qtyOrdered);
138
+
139
+ $item = Mage::getModel('sales/order_item')
140
+ ->setData($this->getOrderItemInfo())
141
+ ->setQtyOrdered($this->getInfoValue('order_item_info', 'qty'))
142
+ ->setBaseOriginalPrice($this->getInfoValue('order_item_info', 'price'))
143
+ ->setPrice($pricevalue)
144
+ ->setBasePrice($pricevalue)
145
+ ->setRowTotal($price)
146
+ ->setBaseRowTotal($price)
147
+ ->setTaxAmount($taxAmount)
148
+ ->setShippingAmount($shippingAmount)
149
+ ->setId(null);
150
+ return $item;
151
+ }
152
+ }
app/code/community/Novalnet/Payment/Model/Resource/Affiliate.php CHANGED
@@ -25,7 +25,12 @@
25
  */
26
  class Novalnet_Payment_Model_Resource_Affiliate extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
-
 
 
 
 
 
29
  public function _construct()
30
  {
31
  $this->_init('novalnet_payment/aff_account_detail', 'id');
25
  */
26
  class Novalnet_Payment_Model_Resource_Affiliate extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Affiliate
33
+ */
34
  public function _construct()
35
  {
36
  $this->_init('novalnet_payment/aff_account_detail', 'id');
app/code/community/Novalnet/Payment/Model/Resource/Affiliateuser.php CHANGED
@@ -25,7 +25,12 @@
25
  */
26
  class Novalnet_Payment_Model_Resource_Affiliateuser extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
-
 
 
 
 
 
29
  public function _construct()
30
  {
31
  $this->_init('novalnet_payment/aff_user_detail', 'id');
25
  */
26
  class Novalnet_Payment_Model_Resource_Affiliateuser extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Affiliateuser
33
+ */
34
  public function _construct()
35
  {
36
  $this->_init('novalnet_payment/aff_user_detail', 'id');
app/code/community/Novalnet/Payment/Model/Resource/Amountchanged.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Resource_Amountchanged extends Mage_Core_Model_Mysql4_Abstract
27
+ {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Amountchanged
33
+ */
34
+ public function _construct()
35
+ {
36
+ $this->_init('novalnet_payment/amountchanged', 'id');
37
+ }
38
+ }
app/code/community/Novalnet/Payment/Model/Resource/Amountchanged/Collection.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Resource_Amountchanged_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
27
+ {
28
+
29
+ public function _construct()
30
+ {
31
+ $this->_init('novalnet_payment/amountchanged');
32
+ }
33
+ }
app/code/community/Novalnet/Payment/Model/Resource/Callback.php CHANGED
@@ -25,10 +25,14 @@
25
  */
26
  class Novalnet_Payment_Model_Resource_Callback extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
-
 
 
 
 
 
29
  public function _construct()
30
  {
31
  $this->_init('novalnet_payment/callback', 'id');
32
  }
33
-
34
  }
25
  */
26
  class Novalnet_Payment_Model_Resource_Callback extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Callback
33
+ */
34
  public function _construct()
35
  {
36
  $this->_init('novalnet_payment/callback', 'id');
37
  }
 
38
  }
app/code/community/Novalnet/Payment/Model/Resource/Callback/Collection.php CHANGED
@@ -30,5 +30,4 @@ class Novalnet_Payment_Model_Resource_Callback_Collection extends Mage_Core_Mode
30
  {
31
  $this->_init('novalnet_payment/callback');
32
  }
33
-
34
  }
30
  {
31
  $this->_init('novalnet_payment/callback');
32
  }
 
33
  }
app/code/community/Novalnet/Payment/Model/Resource/Recurring.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Resource_Recurring extends Mage_Core_Model_Mysql4_Abstract
27
+ {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Recurring
33
+ */
34
+ public function _construct()
35
+ {
36
+ $this->_init('novalnet_payment/recurring', 'id');
37
+ }
38
+ }
app/code/community/Novalnet/Payment/Model/Resource/Recurring/Collection.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Resource_Recurring_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
27
+ {
28
+
29
+ public function _construct()
30
+ {
31
+ $this->_init('novalnet_payment/recurring');
32
+ }
33
+ }
app/code/community/Novalnet/Payment/Model/Resource/Separefill.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Resource_Separefill extends Mage_Core_Model_Mysql4_Abstract
27
+ {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Separefill
33
+ */
34
+ public function _construct()
35
+ {
36
+ $this->_init('novalnet_payment/separefill', 'id');
37
+ }
38
+ }
app/code/community/Novalnet/Payment/Model/Resource/Separefill/Collection.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Resource_Separefill_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
27
+ {
28
+
29
+ public function _construct()
30
+ {
31
+ $this->_init('novalnet_payment/separefill');
32
+ }
33
+ }
app/code/community/Novalnet/Payment/Model/Resource/Transactionoverview.php CHANGED
@@ -25,10 +25,14 @@
25
  */
26
  class Novalnet_Payment_Model_Resource_Transactionoverview extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
-
 
 
 
 
 
29
  public function _construct()
30
  {
31
  $this->_init('novalnet_payment/order_log', 'nn_log_id');
32
  }
33
-
34
  }
25
  */
26
  class Novalnet_Payment_Model_Resource_Transactionoverview extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Transactionoverview
33
+ */
34
  public function _construct()
35
  {
36
  $this->_init('novalnet_payment/order_log', 'nn_log_id');
37
  }
 
38
  }
app/code/community/Novalnet/Payment/Model/Resource/Transactionoverview/Collection.php CHANGED
@@ -32,6 +32,8 @@ class Novalnet_Payment_Model_Resource_Transactionoverview_Collection extends Mag
32
  }
33
 
34
  /**
 
 
35
  * @param Mage_Sales_Model_Order $order
36
  * @return void
37
  */
@@ -39,5 +41,4 @@ class Novalnet_Payment_Model_Resource_Transactionoverview_Collection extends Mag
39
  {
40
  $this->addFieldToFilter('order_id', $order->getIncrementId());
41
  }
42
-
43
  }
32
  }
33
 
34
  /**
35
+ * Get order by using increment id
36
+ *
37
  * @param Mage_Sales_Model_Order $order
38
  * @return void
39
  */
41
  {
42
  $this->addFieldToFilter('order_id', $order->getIncrementId());
43
  }
 
44
  }
app/code/community/Novalnet/Payment/Model/Resource/Transactionstatus.php CHANGED
@@ -25,10 +25,14 @@
25
  */
26
  class Novalnet_Payment_Model_Resource_Transactionstatus extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
-
 
 
 
 
 
29
  public function _construct()
30
  {
31
  $this->_init('novalnet_payment/transaction_status', 'nn_txn_id');
32
  }
33
-
34
  }
25
  */
26
  class Novalnet_Payment_Model_Resource_Transactionstatus extends Mage_Core_Model_Mysql4_Abstract
27
  {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Resource_Transactionstatus
33
+ */
34
  public function _construct()
35
  {
36
  $this->_init('novalnet_payment/transaction_status', 'nn_txn_id');
37
  }
 
38
  }
app/code/community/Novalnet/Payment/Model/Resource/Transactionstatus/Collection.php CHANGED
@@ -32,6 +32,8 @@ class Novalnet_Payment_Model_Resource_Transactionstatus_Collection extends Mage_
32
  }
33
 
34
  /**
 
 
35
  * @param Mage_Sales_Model_Order $order
36
  * @return void
37
  */
@@ -39,5 +41,4 @@ class Novalnet_Payment_Model_Resource_Transactionstatus_Collection extends Mage_
39
  {
40
  $this->addFieldToFilter('order_id', $order->getIncrementId());
41
  }
42
-
43
  }
32
  }
33
 
34
  /**
35
+ * Get order by using increment id
36
+ *
37
  * @param Mage_Sales_Model_Order $order
38
  * @return void
39
  */
41
  {
42
  $this->addFieldToFilter('order_id', $order->getIncrementId());
43
  }
 
44
  }
app/code/community/Novalnet/Payment/Model/Sales/Creditmemo/Tax.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Sales_Creditmemo_Tax extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
27
+ {
28
+ /**
29
+ * Collect credit memo subtotal
30
+ *
31
+ * @param Mage_Sales_Model_Order_Creditmemo $creditmemo
32
+ * @return Mage_Sales_Model_Order_Creditmemo_Total_Abstract
33
+ */
34
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
35
+ {
36
+ $order = $creditmemo->getOrder();
37
+ $totalPaid = $order->getTotalPaid();
38
+ $helper = Mage::helper('novalnet_payment');
39
+ $orderItems = $order->getAllItems();
40
+ $nominalItem = $helper->checkNominalItem($orderItems);
41
+
42
+ $paymentname = array(
43
+ Novalnet_Payment_Model_Config::NN_CC,
44
+ Novalnet_Payment_Model_Config::NN_IDEAL,
45
+ Novalnet_Payment_Model_Config::NN_EPS,
46
+ Novalnet_Payment_Model_Config::NN_PAYPAL,
47
+ Novalnet_Payment_Model_Config::NN_SOFORT
48
+ );
49
+ if($nominalItem){
50
+ array_shift($paymentname);
51
+ }
52
+ $paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
53
+ if (preg_match("/novalnet/i", $paymentMethod) && in_array($paymentMethod, $paymentname)) {
54
+ return $this;
55
+ }
56
+ $getrefundvalue = $order->getTotalRefunded();
57
+ $orderId = $order->getId();
58
+
59
+ if ($nominalItem) {
60
+ $order->setTotalInvoiced($totalPaid);
61
+ }
62
+ $amountvalue = $helper->getAmountCollection($orderId, 1, NULL);
63
+ if ($amountvalue != '') {
64
+ $order->setTotalInvoiced($amountvalue);
65
+ $totalQtyOrder = $order->getTotalQtyOrdered();
66
+ $totalRefunded = $order->getTotalRefunded();
67
+
68
+ $creditmemoBaseGrandTotal = $creditmemo->getBaseGrandTotal();
69
+ $creditmemoGrandTotal = $creditmemo->getGrandTotal();
70
+ $creditmemoBaseTaxAmount = $creditmemo->getBaseTaxAmount();
71
+ $creditmemoTaxAmount = $creditmemo->getTaxAmount();
72
+ $captrueAmountfirst = 0;
73
+ $captrueAmount = $amountvalue;
74
+ if ($totalRefunded == 0) {
75
+ $captrueAmountfirst = $captrueAmount;
76
+ } else {
77
+ $captrueAmountfirst = 0;
78
+ }
79
+ $creditmemo->setSubtotal($captrueAmountfirst)
80
+ ->setShippingAmount(0)
81
+ ->setBaseShippingAmount(0)
82
+ ->setTaxAmount(0)
83
+ ->setBaseTaxAmount(0)
84
+ ->setBaseSubtotal($captrueAmountfirst)
85
+ ->setBaseGrandTotal($captrueAmountfirst)
86
+ ->setGrandTotal($captrueAmountfirst);
87
+ } else {
88
+ return false;
89
+ }
90
+
91
+ return $this;
92
+ }
93
+ }
app/code/community/Novalnet/Payment/Model/Sales/Creditmemo/Total.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Sales_Creditmemo_Total extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
27
+ {
28
+ /**
29
+ * Collect credit memo subtotal
30
+ *
31
+ * @param Mage_Sales_Model_Order_Creditmemo $creditmemo
32
+ * @return Mage_Sales_Model_Order_Creditmemo_Total_Abstract
33
+ */
34
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
35
+ {
36
+ $order = $creditmemo->getOrder();
37
+ $totalPaid = $order->getTotalPaid();
38
+ $helper = Mage::helper('novalnet_payment');
39
+ $orderItems = $order->getAllItems();
40
+ $nominalItem = $helper->checkNominalItem($orderItems);
41
+
42
+ $paymentname = array(
43
+ Novalnet_Payment_Model_Config::NN_CC,
44
+ Novalnet_Payment_Model_Config::NN_IDEAL,
45
+ Novalnet_Payment_Model_Config::NN_EPS,
46
+ Novalnet_Payment_Model_Config::NN_PAYPAL,
47
+ Novalnet_Payment_Model_Config::NN_SOFORT
48
+ );
49
+ if ($nominalItem) {
50
+ array_shift($paymentname);
51
+ }
52
+ $paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
53
+ if (preg_match("/novalnet/i", $paymentMethod) && in_array($paymentMethod, $paymentname)) {
54
+ return $this;
55
+ }
56
+ $getrefundvalue = $order->getTotalRefunded();
57
+ $orderId = $order->getId();
58
+
59
+ if ($nominalItem) {
60
+ $order->setTotalInvoiced($totalPaid);
61
+ }
62
+ $amountvalue = $helper->getAmountCollection($orderId, 1, NULL);
63
+ if ($amountvalue != '') {
64
+ $order->setTotalInvoiced($amountvalue);
65
+ $totalQtyOrder = $order->getTotalQtyOrdered();
66
+ $totalRefunded = $order->getTotalRefunded();
67
+
68
+ $creditmemoBaseGrandTotal = $creditmemo->getBaseGrandTotal();
69
+ $creditmemoGrandTotal = $creditmemo->getGrandTotal();
70
+ $creditmemoBaseTaxAmount = $creditmemo->getBaseTaxAmount();
71
+ $creditmemoTaxAmount = $creditmemo->getTaxAmount();
72
+ $captrueAmountfirst = 0;
73
+ $captrueAmount = $amountvalue;
74
+ if ($totalRefunded == 0) {
75
+ $captrueAmountfirst = $captrueAmount;
76
+ } else {
77
+ $captrueAmountfirst = 0;
78
+ }
79
+ $creditmemo->setSubtotal($captrueAmountfirst)
80
+ ->setShippingAmount(0)
81
+ ->setBaseShippingAmount(0)
82
+ ->setTaxAmount(0)
83
+ ->setBaseTaxAmount(0)
84
+ ->setBaseSubtotal($captrueAmountfirst)
85
+ ->setBaseGrandTotal($captrueAmountfirst)
86
+ ->setGrandTotal($captrueAmountfirst);
87
+ } else {
88
+ return false;
89
+ }
90
+
91
+ return $this;
92
+ }
93
+ }
app/code/community/Novalnet/Payment/Model/Sales/Order/Invoice.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Sales_Order_Invoice extends Mage_Sales_Model_Order_Invoice
27
+ {
28
+ /**
29
+ * Pay invoice
30
+ *
31
+ * @return Mage_Sales_Model_Order_Invoice
32
+ */
33
+ public function pay()
34
+ {
35
+ if ($this->_wasPayCalled) {
36
+ return $this;
37
+ }
38
+ $this->_wasPayCalled = true;
39
+
40
+ $invoiceState = self::STATE_PAID;
41
+ if ($this->getOrder()->getPayment()->hasForcedState()) {
42
+ $invoiceState = $this->getOrder()->getPayment()->getForcedState();
43
+ }
44
+
45
+ $paymentCode = $this->getOrder()->getPayment()->getMethodInstance()->getCode();
46
+ $helper = Mage::helper('novalnet_payment');
47
+ $countofvalue = $helper->getAmountCollection($this->getOrder()->getId(), NULL, NULL);
48
+ $tidPayment = Mage::app()->getRequest()->getParam('tid_payment');
49
+ if ($paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE && $countofvalue
50
+ == 0 && $tidPayment == '') {
51
+ $this->setState(1);
52
+ } else {
53
+ $this->setState($invoiceState);
54
+ }
55
+
56
+ $captrueAmount = Mage::app()->getRequest()->getParam('amount');
57
+ $subsBilling = Mage::app()->getRequest()->getParam('subs_billing');
58
+ $paymentType = Mage::app()->getRequest()->getParam('payment_type');
59
+
60
+ $invoicePayments = array(
61
+ Novalnet_Payment_Model_Config::NN_PREPAYMENT,
62
+ Novalnet_Payment_Model_Config::NN_INVOICE
63
+ );
64
+ $directPayment = array(
65
+ Novalnet_Payment_Model_Config::NN_SEPA,
66
+ );
67
+ $subproduct = 0;
68
+ if ($helper->checkIsAdmin()) {
69
+ $orderItems = $this->getOrder()->getAllItems();
70
+ $nominalItem = $helper->checkNominalItem($orderItems);
71
+ $subproduct = $nominalItem ? 1 : 0;
72
+ }
73
+
74
+ $this->getOrder()->getPayment()->pay($this);
75
+ if ($captrueAmount != '' && in_array($paymentCode, $invoicePayments) && $countofvalue
76
+ != 0) {
77
+ $amount = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
78
+ $this->getOrder()->setTotalPaid($amount);
79
+ $this->getOrder()->setBaseTotalPaid($amount);
80
+ } else if ($countofvalue == 1 && in_array($paymentCode, $directPayment)) {
81
+ $amount = $helper->getAmountCollection($this->getOrder()->getId(), 1, NULL);
82
+ $this->getOrder()->setTotalPaid($amount);
83
+ $this->getOrder()->setBaseTotalPaid($amount);
84
+ } else if ($subproduct || $subsBilling || $paymentType == "INVOICE_CREDIT") {
85
+ $lastTranId = $this->getOrder()->getPayment()->getLastTransId();
86
+ $amount = $helper->getModelRecurring()->getRecurringCaptureTotal($lastTranId,$this->getOrder());
87
+ $this->getOrder()->setTotalPaid($amount);
88
+ $this->getOrder()->setBaseTotalPaid($amount);
89
+
90
+ } else {
91
+ $this->getOrder()->setTotalPaid($this->getOrder()->getTotalPaid() + $this->getGrandTotal());
92
+ $this->getOrder()->setBaseTotalPaid(
93
+ $this->getOrder()->getBaseTotalPaid() + $this->getBaseGrandTotal()
94
+ );
95
+ }
96
+ Mage::dispatchEvent('sales_order_invoice_pay', array($this->_eventObject => $this));
97
+ return $this;
98
+ }
99
+ }
app/code/community/Novalnet/Payment/Model/Sales/Order/Payment.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Sales_Order_Payment extends Mage_Sales_Model_Order_Payment
27
+ {
28
+ /**
29
+ * Register capture notification
30
+ *
31
+ * @param float $amount
32
+ * @param mixed $skipFraudDetection
33
+ * @return Mage_Sales_Model_Order_Payment
34
+ */
35
+ public function registerCaptureNotification($amount, $skipFraudDetection = false)
36
+ {
37
+ $this->_generateTransactionId(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, $this->getAuthorizationTransaction()
38
+ );
39
+
40
+ $order = $this->getOrder();
41
+ $payment = $order->getPayment();
42
+ $paymentObj = $payment->getMethodInstance();
43
+ $magentoVersion = Mage::helper('novalnet_payment')->getMagentoVersion();
44
+ $captureMode = (version_compare($magentoVersion, '1.6', '<')) ? false : true;
45
+
46
+ $txnId = $this->getTransactionId();
47
+ $amount = (float) $amount;
48
+ $paymentMethod = $order->getPayment()->getMethodInstance()->getCode();
49
+ if (!preg_match("/novalnet/i", $paymentMethod)) {
50
+ return parent::registerCaptureNotification($amount);
51
+ }
52
+ $statuscode = Mage::getSingleton('core/session')->getStatusCode();
53
+ $invoice = false;
54
+ if (!$this->getIsTransactionPending()) {
55
+ $invoice = $this->_getInvoiceForTransactionId($this->getTransactionId());
56
+ // register new capture
57
+ if (!$invoice && $statuscode == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
58
+ && $paymentMethod != Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
59
+ if ($this->_isCaptureFinal($amount)) {
60
+ $payment->setTransactionId($txnId) // Add capture text to make the new transaction
61
+ ->setIsTransactionClosed($captureMode) // Close the transaction
62
+ ->capture(null)
63
+ ->save();
64
+ } else {
65
+ $this->setIsFraudDetected(true);
66
+ $this->_updateTotals(array('base_amount_paid_online' => $amount));
67
+ }
68
+ }
69
+ }
70
+ $status = true;
71
+ $setOrderAfterStatus = $paymentObj->_getConfigData('order_status') ? $paymentObj->_getConfigData('order_status')
72
+ : Mage_Sales_Model_Order::STATE_PROCESSING; // If after status is empty set default status
73
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
74
+ $payment->setTransactionId($txnId)
75
+ ->setLastTransId($txnId)
76
+ ->setParentTransactionId(null)
77
+ ->save();
78
+ $message = '';
79
+ if ($this->getIsTransactionPending()) {
80
+ $message = Mage::helper('sales')->__('Capturing amount of %s is pending approval on gateway.', $this->_formatPrice($amount));
81
+ $state = Mage_Sales_Model_Order::STATE_NEW;
82
+ if ($this->getIsFraudDetected()) {
83
+ $message = Mage::helper('sales')->__('Order is suspended as its capture amount %s is suspected to be fraudulent.', $this->_formatPrice($amount));
84
+ $status = Mage_Sales_Model_Order::STATUS_FRAUD;
85
+ }
86
+ } else if ($statuscode == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
87
+ $message = Mage::helper('sales')->__('Registered notification about captured amount of %s.', $this->_formatPrice($amount));
88
+ $state = Mage_Sales_Model_Order::STATE_PROCESSING;
89
+ if ($this->getIsFraudDetected()) {
90
+ $state = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
91
+ $message = Mage::helper('sales')->__('Order is suspended as its capture amount %s is suspected to be fraudulent.', $this->_formatPrice($amount));
92
+ $status = Mage_Sales_Model_Order::STATUS_FRAUD;
93
+ }
94
+ // register capture for an existing invoice
95
+ if ($invoice && Mage_Sales_Model_Order_Invoice::STATE_OPEN == $invoice->getState()) {
96
+ $invoice->pay();
97
+ $this->_updateTotals(array('base_amount_paid_online' => $amount));
98
+ $order->addRelatedObject($invoice);
99
+ }
100
+ }
101
+ $order->setState($state, $setOrderAfterStatus, $message);
102
+ Mage::getSingleton('core/session')->setStatusCode('');
103
+ return $this;
104
+ }
105
+
106
+ /**
107
+ * Void payment either online or offline (process void notification)
108
+ * NOTE: that in some cases authorization can be voided after a capture. In such case it makes sense to use
109
+ * the amount void amount, for informational purposes.
110
+ * Updates payment totals, updates order status and adds proper comments
111
+ *
112
+ * @param bool $isOnline
113
+ * @param float $amount
114
+ * @param string $gatewayCallback
115
+ * @return Mage_Sales_Model_Order_Payment
116
+ */
117
+ protected function _void($isOnline, $amount = null, $gatewayCallback = 'void')
118
+ {
119
+ $order = $this->getOrder();
120
+ $storeId = $order->getStoreId();
121
+ $payment = $order->getPayment();
122
+ $paymentObj = $payment->getMethodInstance();
123
+ $setOrderAfterStatus = $paymentObj->_getConfigData('void_status',true,$storeId);
124
+ $authTransaction = $this->getAuthorizationTransaction();
125
+ $this->_generateTransactionId(Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID, $authTransaction);
126
+ $this->setShouldCloseParentTransaction(true);
127
+
128
+ // attempt to void
129
+ if ($isOnline) {
130
+ $this->getMethodInstance()->setStore($order->getStoreId())->$gatewayCallback($this);
131
+ }
132
+ if ($this->_isTransactionExists()) {
133
+ return $this;
134
+ }
135
+
136
+ // if the authorization was untouched, we may assume voided amount = order grand total
137
+ // but only if the payment auth amount equals to order grand total
138
+ if ($authTransaction && ($order->getBaseGrandTotal() == $this->getBaseAmountAuthorized())
139
+ && (0 == $this->getBaseAmountCanceled())) {
140
+ if ($authTransaction->canVoidAuthorizationCompletely()) {
141
+ $amount = (float)$order->getBaseGrandTotal();
142
+ }
143
+ }
144
+
145
+ if ($amount) {
146
+ $amount = $this->_formatAmount($amount);
147
+ }
148
+
149
+ // update transactions, order state and add comments
150
+ $transaction = $this->_addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID, null, true);
151
+ $message = $this->hasMessage() ? $this->getMessage() : Mage::helper('sales')->__('Voided authorization.');
152
+ $message = $this->_prependMessage($message);
153
+ if ($amount) {
154
+ $message .= ' ' . Mage::helper('sales')->__('Amount: %s.', $this->_formatPrice($amount));
155
+ }
156
+ $setOrderAfterStatus = $setOrderAfterStatus ? $setOrderAfterStatus : true;
157
+ $message = $this->_appendTransactionToMessage($transaction, $message);
158
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $setOrderAfterStatus, $message);
159
+ return $this;
160
+ }
161
+ }
app/code/community/Novalnet/Payment/Model/Sales/Order/Pdf/Creditmemo.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Sales_Order_Pdf_Creditmemo extends Mage_Sales_Model_Order_Pdf_Creditmemo
27
+ {
28
+ /**
29
+ * Return PDF document
30
+ *
31
+ * @param array $creditmemos
32
+ * @return Zend_Pdf
33
+ */
34
+ public function getPdf($creditmemos = array())
35
+ {
36
+ $this->_beforeGetPdf();
37
+ $this->_initRenderer('creditmemo');
38
+
39
+ $pdf = new Zend_Pdf();
40
+ $this->_setPdf($pdf);
41
+ $style = new Zend_Pdf_Style();
42
+ $this->_setFontBold($style, 10);
43
+
44
+ foreach ($creditmemos as $creditmemo) {
45
+ if ($creditmemo->getStoreId()) {
46
+ Mage::app()->getLocale()->emulate($creditmemo->getStoreId());
47
+ Mage::app()->setCurrentStore($creditmemo->getStoreId());
48
+ }
49
+ $page = $this->newPage();
50
+ $order = $creditmemo->getOrder();
51
+ /* Add image */
52
+ $this->insertLogo($page, $creditmemo->getStore());
53
+ /* Add address */
54
+ $this->insertAddress($page, $creditmemo->getStore());
55
+ /* Add head */
56
+ $this->insertOrder(
57
+ $page,
58
+ $order,
59
+ Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID, $order->getStoreId())
60
+ );
61
+ /* Add document text and number */
62
+ $this->insertDocumentNumber(
63
+ $page,
64
+ Mage::helper('sales')->__('Credit Memo # ') . $creditmemo->getIncrementId()
65
+ );
66
+ /* Add table head */
67
+ $this->_drawHeader($page);
68
+ /* Add body */
69
+ foreach ($creditmemo->getAllItems() as $item){
70
+ if ($item->getOrderItem()->getParentItem()) {
71
+ continue;
72
+ }
73
+ /* Draw item */
74
+ $this->_drawItem($item, $page, $order);
75
+ $page = end($pdf->pages);
76
+ }
77
+ /* Add totals */
78
+ $this->insertTotals($page, $creditmemo);
79
+ $helper = Mage::helper('novalnet_payment');
80
+ $amountchangedvalue = $helper->getAmountCollection($order->getId(), 1, NULL);
81
+ if ($amountchangedvalue) {
82
+ $lineBlock = $this->amountRefundUpdateDetails($order,$amountchangedvalue,$creditmemo);
83
+ $this->y -= 1;
84
+ $page = $this->drawLineBlocks($page, array($lineBlock));
85
+ }
86
+ }
87
+ $this->_afterGetPdf();
88
+ if ($creditmemo->getStoreId()) {
89
+ Mage::app()->getLocale()->revert();
90
+ }
91
+ return $pdf;
92
+ }
93
+
94
+ /**
95
+ * amount refund details append in pdf
96
+ *
97
+ * @param varien_object $order
98
+ * @param int $amountchangedvalue
99
+ * @param varien_object $creditmemo
100
+ * @return Zend_Pdf
101
+ */
102
+ private function amountRefundUpdateDetails($order,$amountchangedvalue,$creditmemo)
103
+ {
104
+ $currency = $order->getOrderCurrency();
105
+ $currencyCode = $currency->getCurrencyCode();
106
+ $currencySymbol = Mage::app()->getLocale()->currency($currencyCode)->getSymbol();
107
+ $lineBlock['lines'][] = array(
108
+ array(
109
+ 'text' => Mage::helper('sales')->__('Novalnet Refunded Amount').':',
110
+ 'feed' => 475,
111
+ 'align' => 'right',
112
+ 'font_size' => 10,
113
+ 'font' => 'bold'
114
+ ),
115
+ array(
116
+ 'text' => $currencySymbol.number_format($creditmemo->getGrandTotal(),2),
117
+ 'feed' => 565,
118
+ 'align' => 'right',
119
+ 'font_size' => 10,
120
+ 'font' => 'bold'
121
+ ),
122
+ );
123
+ $lineBlock['lines'][] = array(
124
+ array(
125
+ 'text' => Mage::helper('sales')->__('Novalnet Transaction Amount').':',
126
+ 'feed' => 475,
127
+ 'align' => 'right',
128
+ 'font_size' => 10,
129
+ 'font' => 'bold'
130
+ ),
131
+ array(
132
+ 'text' => $currencySymbol.number_format($amountchangedvalue,2),
133
+ 'feed' => 565,
134
+ 'align' => 'right',
135
+ 'font_size' => 10,
136
+ 'font' => 'bold'
137
+ ),
138
+ );
139
+ return $lineBlock;
140
+ }
141
+
142
+ }
app/code/community/Novalnet/Payment/Model/Sales/Order/Pdf/Invoice.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Sales_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Invoice
27
+ {
28
+ /**
29
+ * Return PDF document
30
+ *
31
+ * @param array $invoices
32
+ * @return Zend_Pdf
33
+ */
34
+ public function getPdf($invoices = array())
35
+ {
36
+ $this->_beforeGetPdf();
37
+ $this->_initRenderer('invoice');
38
+
39
+ $pdf = new Zend_Pdf();
40
+ $this->_setPdf($pdf);
41
+ $style = new Zend_Pdf_Style();
42
+ $this->_setFontBold($style, 10);
43
+
44
+ foreach ($invoices as $invoice) {
45
+ if ($invoice->getStoreId()) {
46
+ Mage::app()->getLocale()->emulate($invoice->getStoreId());
47
+ Mage::app()->setCurrentStore($invoice->getStoreId());
48
+ }
49
+ $page = $this->newPage();
50
+ $order = $invoice->getOrder();
51
+ /* Add image */
52
+ $this->insertLogo($page, $invoice->getStore());
53
+ /* Add address */
54
+ $this->insertAddress($page, $invoice->getStore());
55
+ /* Add head */
56
+ $this->insertOrder(
57
+ $page,
58
+ $order,
59
+ Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId())
60
+ );
61
+ /* Add document text and number */
62
+ $this->insertDocumentNumber(
63
+ $page,
64
+ Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId()
65
+ );
66
+ /* Add table */
67
+ $this->_drawHeader($page);
68
+ /* Add body */
69
+ foreach ($invoice->getAllItems() as $item){
70
+ if ($item->getOrderItem()->getParentItem()) {
71
+ continue;
72
+ }
73
+ /* Draw item */
74
+ $this->_drawItem($item, $page, $order);
75
+ $page = end($pdf->pages);
76
+ }
77
+ /* Add totals */
78
+ $this->insertTotals($page, $invoice);
79
+ $helper = Mage::helper('novalnet_payment');
80
+ $amountchangedvalue = $helper->getAmountCollection($order->getId(), 1, NULL);
81
+ if($amountchangedvalue){
82
+ $lineBlock = $this->amountUpdateDetails($order,$amountchangedvalue);
83
+ $this->y -= 1;
84
+ $page = $this->drawLineBlocks($page, array($lineBlock));
85
+ }
86
+
87
+
88
+ if ($invoice->getStoreId()) {
89
+ Mage::app()->getLocale()->revert();
90
+ }
91
+ }
92
+ $this->_afterGetPdf();
93
+ return $pdf;
94
+ }
95
+
96
+ /**
97
+ * amount update details append in pdf
98
+ *
99
+ * @param varien_object $order
100
+ * @param int $amountchangedvalue
101
+ * @return Zend_Pdf
102
+ */
103
+ private function amountUpdateDetails($order,$amountchangedvalue)
104
+ {
105
+ $adjustmentamount = -($order->getGrandTotal() - $amountchangedvalue);
106
+ $currency = $order->getOrderCurrency();
107
+ $currencyCode = $currency->getCurrencyCode();
108
+ $currencySymbol = Mage::app()->getLocale()->currency($currencyCode)->getSymbol();
109
+ $lineBlock['lines'][] = array(
110
+ array(
111
+ 'text' => Mage::helper('sales')->__('Novalnet Adjusted Amount').':',
112
+ 'feed' => 475,
113
+ 'align' => 'right',
114
+ 'font_size' => 10,
115
+ 'font' => 'bold'
116
+ ),
117
+ array(
118
+ 'text' => $currencySymbol.number_format($adjustmentamount,2),
119
+ 'feed' => 565,
120
+ 'align' => 'right',
121
+ 'font_size' => 10,
122
+ 'font' => 'bold'
123
+ ),
124
+ );
125
+ $lineBlock['lines'][] = array(
126
+ array(
127
+ 'text' => Mage::helper('sales')->__('Novalnet Transaction Amount').':',
128
+ 'feed' => 475,
129
+ 'align' => 'right',
130
+ 'font_size' => 10,
131
+ 'font' => 'bold'
132
+ ),
133
+ array(
134
+ 'text' => $currencySymbol.number_format($amountchangedvalue,2),
135
+ 'feed' => 565,
136
+ 'align' => 'right',
137
+ 'font_size' => 10,
138
+ 'font' => 'bold'
139
+ ),
140
+ );
141
+ return $lineBlock;
142
+ }
143
+ }
app/code/community/Novalnet/Payment/Model/Separefill.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Model_Separefill extends Mage_Core_Model_Abstract
27
+ {
28
+ /**
29
+ * Constructor
30
+ *
31
+ * @see lib/Varien/Varien_Object#_construct()
32
+ * @return Novalnet_Payment_Model_Separefill
33
+ */
34
+ public function _construct()
35
+ {
36
+ parent::_construct();
37
+ $this->_init('novalnet_payment/separefill');
38
+ }
39
+
40
+ /**
41
+ * Get PanHash
42
+ *
43
+ * @param Novalnet_Payment_Helper_Data $helper
44
+ * @return mixed
45
+ */
46
+ public function getSepaPanHash($helper)
47
+ {
48
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
49
+ $modNovalSeparefill = $helper->getModelSepaRefill()->getCollection();
50
+ $modNovalSeparefill->addFieldToFilter('customer_id', $customerId);
51
+ $modNovalSeparefill->addFieldToSelect('pan_hash');
52
+ $modNovalSeparefillcount = count($modNovalSeparefill);
53
+ if ($modNovalSeparefillcount > 0) {
54
+ foreach ($modNovalSeparefill as $modNovalSeparefillvalue) {
55
+ $panhash = $modNovalSeparefillvalue->getPanHash();
56
+ }
57
+ } else {
58
+ $panhash = '';
59
+ }
60
+ return $panhash;
61
+ }
62
+ }
app/code/community/Novalnet/Payment/Model/System/Config/Activemethods.php CHANGED
@@ -25,7 +25,11 @@
25
  */
26
  class Novalnet_Payment_Model_System_Config_Activemethods
27
  {
28
-
 
 
 
 
29
  public function toOptionArray()
30
  {
31
  $methods = array();
@@ -46,7 +50,6 @@ class Novalnet_Payment_Model_System_Config_Activemethods
46
  foreach ($payments as $paymentCode => $paymentModel) {
47
 
48
  if (preg_match("/novalnet/i", $paymentCode)) {
49
-
50
  $paymentActive = Mage::getStoreConfig('payment/' . $paymentCode . '/active', $scopeId);
51
  if ($paymentActive == true) {
52
  $paymentMethod = Mage::helper('novalnet_payment')->__($novalnetPaymentMethods[$paymentCode]);
@@ -69,5 +72,4 @@ class Novalnet_Payment_Model_System_Config_Activemethods
69
  }
70
  return $methods;
71
  }
72
-
73
  }
25
  */
26
  class Novalnet_Payment_Model_System_Config_Activemethods
27
  {
28
+ /**
29
+ * Options getter
30
+ *
31
+ * @return array
32
+ */
33
  public function toOptionArray()
34
  {
35
  $methods = array();
50
  foreach ($payments as $paymentCode => $paymentModel) {
51
 
52
  if (preg_match("/novalnet/i", $paymentCode)) {
 
53
  $paymentActive = Mage::getStoreConfig('payment/' . $paymentCode . '/active', $scopeId);
54
  if ($paymentActive == true) {
55
  $paymentMethod = Mage::helper('novalnet_payment')->__($novalnetPaymentMethods[$paymentCode]);
72
  }
73
  return $methods;
74
  }
 
75
  }
app/code/community/Novalnet/Payment/Model/Transactionoverview.php CHANGED
@@ -25,7 +25,6 @@
25
  */
26
  class Novalnet_Payment_Model_Transactionoverview extends Mage_Core_Model_Abstract
27
  {
28
-
29
  /**
30
  * Constructor
31
  *
@@ -62,5 +61,4 @@ class Novalnet_Payment_Model_Transactionoverview extends Mage_Core_Model_Abstrac
62
  $this->load($orderLog->getNnLogId(), 'nn_log_id');
63
  return $this;
64
  }
65
-
66
  }
25
  */
26
  class Novalnet_Payment_Model_Transactionoverview extends Mage_Core_Model_Abstract
27
  {
 
28
  /**
29
  * Constructor
30
  *
61
  $this->load($orderLog->getNnLogId(), 'nn_log_id');
62
  return $this;
63
  }
 
64
  }
app/code/community/Novalnet/Payment/Model/Transactionstatus.php CHANGED
@@ -25,7 +25,6 @@
25
  */
26
  class Novalnet_Payment_Model_Transactionstatus extends Mage_Core_Model_Abstract
27
  {
28
-
29
  /**
30
  * Constructor
31
  *
25
  */
26
  class Novalnet_Payment_Model_Transactionstatus extends Mage_Core_Model_Abstract
27
  {
 
28
  /**
29
  * Constructor
30
  *
app/code/community/Novalnet/Payment/controllers/Adminhtml/Configuration/Wizard/PageController.php CHANGED
@@ -25,7 +25,6 @@
25
  */
26
  class Novalnet_Payment_Adminhtml_Configuration_Wizard_PageController extends Mage_Adminhtml_Controller_Action
27
  {
28
-
29
  /**
30
  * Init layout, menu and breadcrumb
31
  *
@@ -33,12 +32,10 @@ class Novalnet_Payment_Adminhtml_Configuration_Wizard_PageController extends Mag
33
  */
34
  protected function _initAction()
35
  {
36
- $this->loadLayout();
37
- $this->setUsedModuleName('novalnet_payment');
38
- $this->_setActiveMenu('novalnet/configuration');
39
-
40
- $this->_title($this->__('Novalnet'));
41
- $this->_title($this->__('Configuration'));
42
 
43
  return $this;
44
  }
@@ -105,26 +102,65 @@ class Novalnet_Payment_Adminhtml_Configuration_Wizard_PageController extends Mag
105
  }
106
 
107
  /**
108
- * page redirect
109
  *
110
  */
111
- public function _redirectByPageConfig()
112
  {
113
  $url = $this->helperWizard()->getNextPageUrlAsString();
114
  $this->_redirect($url, array('_current' => true));
115
  }
116
 
117
  /**
118
- * Save global configuration values
119
  *
120
  */
121
  public function saveAction()
122
  {
123
- $pageCode = $this->getRequest()->getParam('page_code');
 
 
 
 
 
124
 
125
- $config = $this->initConfig($pageCode);
 
 
126
 
 
 
 
 
 
 
 
 
 
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  $session = Mage::getSingleton('adminhtml/session');
129
 
130
  try {
@@ -149,8 +185,6 @@ class Novalnet_Payment_Adminhtml_Configuration_Wizard_PageController extends Mag
149
  $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();
150
  $session->addException($e, $msg);
151
  }
152
-
153
  $this->_redirectByPageConfig();
154
  }
155
-
156
  }
25
  */
26
  class Novalnet_Payment_Adminhtml_Configuration_Wizard_PageController extends Mage_Adminhtml_Controller_Action
27
  {
 
28
  /**
29
  * Init layout, menu and breadcrumb
30
  *
32
  */
33
  protected function _initAction()
34
  {
35
+ $this->loadLayout()
36
+ ->setUsedModuleName('novalnet_payment')
37
+ ->_setActiveMenu('novalnet/configuration')
38
+ ->_addBreadcrumb($this->__('Novalnet'), $this->__('Configuration'));
 
 
39
 
40
  return $this;
41
  }
102
  }
103
 
104
  /**
105
+ * Page redirect
106
  *
107
  */
108
+ private function _redirectByPageConfig()
109
  {
110
  $url = $this->helperWizard()->getNextPageUrlAsString();
111
  $this->_redirect($url, array('_current' => true));
112
  }
113
 
114
  /**
115
+ * Amount update process
116
  *
117
  */
118
  public function saveAction()
119
  {
120
+ $config = $this->initConfig('paymentSave');
121
+ $configPage = Mage::registry('novalnet_wizard_config_page');
122
+ Mage::getSingleton('adminhtml/config_data')
123
+ ->setSection($configPage->getData('codes/section'))
124
+ ->setWebsite($configPage->getData('codes/website'))
125
+ ->setStore($configPage->getData('codes/store'));
126
 
127
+ $session = Mage::getSingleton('adminhtml/session');
128
+
129
+ try {
130
 
131
+ $website = $this->getRequest()->getParam('website');
132
+ $store = $this->getRequest()->getParam('store');
133
+ $groups = $this->getRequest()->getPost('groups');
134
+ $configData = Mage::getModel('adminhtml/config_data');
135
+ $configData->setSection('novalnet_global')
136
+ ->setWebsite($website)
137
+ ->setStore($store)
138
+ ->setGroups($groups)
139
+ ->save();
140
 
141
+ $session->addSuccess(Mage::helper('novalnet_payment')->__('The configuration has been saved.'));
142
+ } catch (Mage_Core_Exception $e) {
143
+ foreach (explode("\n", $e->getMessage()) as $message) {
144
+ $session->addError($message);
145
+ }
146
+ } catch (Exception $e) {
147
+ $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();
148
+ $session->addException($e, $msg);
149
+ }
150
+
151
+ $this->_initAction();
152
+ $this->renderLayout();
153
+ }
154
+
155
+ /**
156
+ * Save payment configuration
157
+ *
158
+ */
159
+ public function paymentSaveAction()
160
+ {
161
+ $pageCode = $this->getRequest()->getParam('page_code');
162
+
163
+ $config = $this->initConfig($pageCode);
164
  $session = Mage::getSingleton('adminhtml/session');
165
 
166
  try {
185
  $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();
186
  $session->addException($e, $msg);
187
  }
 
188
  $this->_redirectByPageConfig();
189
  }
 
190
  }
app/code/community/Novalnet/Payment/controllers/Adminhtml/{InformationController.php → Information/ModuleController.php} RENAMED
@@ -23,16 +23,19 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Novalnet_Payment_Adminhtml_InformationController extends Mage_Adminhtml_Controller_Action
27
  {
 
 
 
 
28
  public function indexAction()
29
  {
30
- $this->loadLayout();
31
- $this->setUsedModuleName('novalnet_payment');
32
- $this->_setActiveMenu('novalnet/information');
33
- $this->_title($this->__('Novalnet'));
34
- $this->_title($this->__('Information'));
35
  $this->renderLayout();
36
  }
37
-
38
  }
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Novalnet_Payment_Adminhtml_Information_ModuleController extends Mage_Adminhtml_Controller_Action
27
  {
28
+ /**
29
+ * Render layout
30
+ *
31
+ */
32
  public function indexAction()
33
  {
34
+ $this->loadLayout()
35
+ ->setUsedModuleName('novalnet_payment')
36
+ ->_setActiveMenu('novalnet/information')
37
+ ->_addBreadcrumb($this->__('Novalnet'), $this->__('Novalnet Magento Module'));
38
+
39
  $this->renderLayout();
40
  }
 
41
  }
app/code/community/Novalnet/Payment/controllers/Adminhtml/Information/NovalnetmerchantadminController.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ class Novalnet_Payment_Adminhtml_Information_NovalnetmerchantadminController extends Mage_Adminhtml_Controller_Action
27
+ {
28
+ /**
29
+ * Render layout
30
+ *
31
+ */
32
+ public function indexAction()
33
+ {
34
+ $this->loadLayout()
35
+ ->setUsedModuleName('novalnet_payment')
36
+ ->_setActiveMenu('novalnet/information')
37
+ ->_addBreadcrumb($this->__('Novalnet'), $this->__('Novalnet Merchant Admin'));
38
+
39
+ $this->renderLayout();
40
+ }
41
+ }
app/code/community/Novalnet/Payment/controllers/Adminhtml/Sales/OrderController.php CHANGED
@@ -27,7 +27,6 @@ require_once 'Mage' . DS . 'Adminhtml' . DS . 'controllers' . DS . 'Sales' . DS
27
 
28
  class Novalnet_Payment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
29
  {
30
-
31
  var $moduleName = 'novalnet_payment';
32
 
33
  /**
@@ -92,25 +91,6 @@ class Novalnet_Payment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sa
92
  );
93
  }
94
 
95
- /**
96
- * Invoice update order
97
- *
98
- */
99
- public function invoiceupdateAction()
100
- {
101
- $order = $this->_initOrder();
102
- if ($order) {
103
- try {
104
- Mage::helper('novalnet_payment/AssignData')->setNovalnetInvoiceUpdate($order);
105
- } catch (Mage_Core_Exception $e) {
106
- $this->_getSession()->addError($e->getMessage());
107
- } catch (Exception $e) {
108
- $this->_getSession()->addError($this->__('The Invoice was not updated.'));
109
- }
110
- }
111
- $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
112
- }
113
-
114
  /**
115
  * Order confirmation process for Novalnet payments (Prepayment & Invoice)
116
  *
@@ -118,51 +98,59 @@ class Novalnet_Payment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sa
118
  public function novalnetconfirmAction()
119
  {
120
  $order = $this->_initOrder();
 
 
 
121
  if ($order) {
122
  try {
123
  $payment = $order->getPayment();
124
  $paymentObj = $payment->getMethodInstance();
125
  $paymentCode = $paymentObj->getCode();
126
- $helper = Mage::helper('novalnet_payment');
127
  $responseCodeApproved = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
128
  $request = new Varien_Object();
129
- $storeId = $payment->getOrder()->getStoreId();
130
- $customerId = $payment->getOrder()->getCustomerId();
131
  $lastTranId = $helper->makeValidNumber($payment->getLastTransId());
132
- $request = $this->_getVendorParams($request, $payment);
133
  $request->setTid($lastTranId)
134
  ->setStatus($responseCodeApproved)
135
  ->setEditStatus(true);
136
- $loadTransStatus = $helper->loadTransactionStatus($lastTranId);
137
  $transStatus = $loadTransStatus->getTransactionStatus();
138
  if (!in_array(NULL, $request->toArray()) && !empty($transStatus)
139
  && $transStatus != $responseCodeApproved) {
140
- $payportUrl = $helper->getPayportUrl('paygate');
141
  $buildNovalnetParam = http_build_query($request->getData());
142
- $response = $paymentObj->setRawCallRequest($buildNovalnetParam, $payportUrl);
143
- if ($response->getStatus() == $responseCodeApproved) {
144
- $magentoVersion = $helper->getMagentoVersion();
145
- $transMode = (version_compare($magentoVersion, '1.6', '<'))
 
146
  ? false : true;
147
  $loadTransStatus->setTransactionStatus($responseCodeApproved)
148
  ->save();
149
-
 
 
 
 
150
  if ($paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE) {
 
151
  if ($order->canInvoice()) {
152
  $this->saveInvoice($order, $lastTranId);
153
- $payment->setTransactionId($lastTranId)
154
- ->setIsTransactionClosed($transMode);
155
- $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
156
- $transaction->setParentTxnId(null)
157
- ->save();
158
  }
 
 
 
 
 
159
  }
160
  }
 
 
161
  $paymentObj->logNovalnetTransactionData($request, $response, $payment->getLastTransId(), $customerId, $storeId);
162
  }
163
- if ($response->getStatus() != $responseCodeApproved) {
164
  $this->_getSession()->addSuccess(
165
- $this->__('There was an error in refund request. Status Code : ' . $response->getStatus())
166
  );
167
  } else {
168
  $this->_getSession()->addSuccess(
@@ -183,41 +171,190 @@ class Novalnet_Payment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sa
183
  *
184
  * @param varien_object $order
185
  * @param int $txnId
 
186
  */
187
- protected function saveInvoice($order, $txnId)
188
  {
 
189
  $invoice = $order->prepareInvoice();
190
  $invoice->setTransactionId($txnId);
191
  $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
192
  ->register();
193
- $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN)
194
  ->save();
195
  Mage::getModel('core/resource_transaction')
196
  ->addObject($invoice)
197
  ->addObject($invoice->getOrder())
198
  ->save();
 
 
 
 
 
 
 
 
 
 
 
199
  }
200
 
201
  /**
202
- * Set the Order basic params
203
  *
204
- * @param varien_object $request
205
- * @param varien_object $payment
206
- * @return mixed
207
  */
208
- private function _getVendorParams($request, $payment = NULL)
209
  {
210
- //get the Basic Params Based on store
211
- $getresponseData = NULL;
212
- if ($payment) {
213
- $getresponseData = unserialize($payment->getAdditionalData());
214
- }
215
- $request->setVendor($getresponseData['vendor'])
216
- ->setAuthCode($getresponseData['auth_code'])
217
- ->setProduct($getresponseData['product'])
218
- ->setTariff($getresponseData['tariff'])
219
- ->setKey($getresponseData['key']);
220
- return $request;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  }
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  }
27
 
28
  class Novalnet_Payment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
29
  {
 
30
  var $moduleName = 'novalnet_payment';
31
 
32
  /**
91
  );
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  /**
95
  * Order confirmation process for Novalnet payments (Prepayment & Invoice)
96
  *
98
  public function novalnetconfirmAction()
99
  {
100
  $order = $this->_initOrder();
101
+ $orderItems = $order->getAllItems();
102
+ $helper = Mage::helper('novalnet_payment');
103
+ $nominalItem = $helper->checkNominalItem($orderItems);
104
  if ($order) {
105
  try {
106
  $payment = $order->getPayment();
107
  $paymentObj = $payment->getMethodInstance();
108
  $paymentCode = $paymentObj->getCode();
 
109
  $responseCodeApproved = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
110
  $request = new Varien_Object();
111
+ $storeId = $payment->getOrder()->getStoreId();
 
112
  $lastTranId = $helper->makeValidNumber($payment->getLastTransId());
113
+ $paymentObj->assignOrderBasicParams($request, $payment, $storeId, $nominalItem);
114
  $request->setTid($lastTranId)
115
  ->setStatus($responseCodeApproved)
116
  ->setEditStatus(true);
117
+ $loadTransStatus = Mage::helper('novalnet_payment')->loadTransactionStatus($lastTranId);
118
  $transStatus = $loadTransStatus->getTransactionStatus();
119
  if (!in_array(NULL, $request->toArray()) && !empty($transStatus)
120
  && $transStatus != $responseCodeApproved) {
 
121
  $buildNovalnetParam = http_build_query($request->getData());
122
+ $payportUrl = $helper->getPayportUrl('paygate');
123
+ $response = Mage::helper('novalnet_payment/AssignData')->setRawCallRequest($buildNovalnetParam, $payportUrl);
124
+ $responseStatus = $response->getStatus();
125
+ if ($responseStatus == $responseCodeApproved) {
126
+ $captureMode = (version_compare($helper->getMagentoVersion(), '1.6', '<'))
127
  ? false : true;
128
  $loadTransStatus->setTransactionStatus($responseCodeApproved)
129
  ->save();
130
+ $data = unserialize($payment->getAdditionalData());
131
+ $data['captureTid'] = $lastTranId;
132
+ $data['CaptureCreateAt'] = Mage::getModel('core/date')->date('Y-m-d H:i:s');
133
+ $payment->setAdditionalData(serialize($data))
134
+ ->save();
135
  if ($paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE) {
136
+ $order = $payment->getOrder();
137
  if ($order->canInvoice()) {
138
  $this->saveInvoice($order, $lastTranId);
 
 
 
 
 
139
  }
140
+ $payment->setTransactionId($lastTranId)
141
+ ->setIsTransactionClosed($captureMode);
142
+ $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
143
+ $transaction->setParentTxnId(null)
144
+ ->save();
145
  }
146
  }
147
+ $this->setOrderStatus($order, 'confirmStatus');
148
+ $customerId = $payment->getOrder()->getCustomerId();
149
  $paymentObj->logNovalnetTransactionData($request, $response, $payment->getLastTransId(), $customerId, $storeId);
150
  }
151
+ if ($responseStatus != $responseCodeApproved) {
152
  $this->_getSession()->addSuccess(
153
+ $this->__('There was an error in refund request. Status Code : ' . $responseStatus)
154
  );
155
  } else {
156
  $this->_getSession()->addSuccess(
171
  *
172
  * @param varien_object $order
173
  * @param int $txnId
174
+ * @param string $paymentCode
175
  */
176
+ protected function saveInvoice($order, $txnId,$paymentCode = NULL)
177
  {
178
+ $paid = $paymentCode ? Mage_Sales_Model_Order_Invoice::STATE_PAID : Mage_Sales_Model_Order_Invoice::STATE_OPEN;
179
  $invoice = $order->prepareInvoice();
180
  $invoice->setTransactionId($txnId);
181
  $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
182
  ->register();
183
+ $invoice->setState($paid)
184
  ->save();
185
  Mage::getModel('core/resource_transaction')
186
  ->addObject($invoice)
187
  ->addObject($invoice->getOrder())
188
  ->save();
189
+ if ($paymentCode != NULL) {
190
+ $magentoVersion = Mage::helper('novalnet_payment')->getMagentoVersion();
191
+ $transMode = (version_compare($magentoVersion, '1.6', '<'))
192
+ ? false : true;
193
+ $payment = $order->getPayment();
194
+ $payment->setTransactionId($txnId)
195
+ ->setIsTransactionClosed($transMode);
196
+ $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, null, false);
197
+ $transaction->setParentTxnId(null)
198
+ ->save();
199
+ }
200
  }
201
 
202
  /**
203
+ * Amount update process
204
  *
 
 
 
205
  */
206
+ public function amountupdateAction()
207
  {
208
+ $amountChanged = $this->getRequest()->getParam('amount_change');
209
+ $invoiceDuedate = $this->getRequest()->getParam('invoice_duedate');
210
+ $finalAmount = str_replace(array('.', ','), "", $amountChanged);
211
+ $rawAmount = ($finalAmount / 100);
212
+
213
+ $order = $this->_initOrder();
214
+ $helper = Mage::helper('novalnet_payment');
215
+ $incrementId = $order->getIncrementId();
216
+ $currency = $order->getOrderCurrencyCode();
217
+ $callbackTrans = $helper->loadCallbackValue($incrementId);
218
+ $callbackValue = $callbackTrans && $callbackTrans->getCallbackAmount()!= NULL ? ($callbackTrans->getCallbackAmount() / 100) : '';
219
+
220
+ try {
221
+ if (empty($rawAmount) || !is_numeric($rawAmount) || $rawAmount < $callbackValue) {
222
+ ($rawAmount < $callbackValue) ? Mage::throwException($helper->__('Customer already paid amount is ').$currency. ' ' .$callbackValue) : Mage::throwException('Enter the valid amount');
223
+ }
224
+
225
+ if ($order) {
226
+ try {
227
+ $orderId = $order->getId();
228
+ $payment = $order->getPayment();
229
+ $paymentObj = $payment->getMethodInstance();
230
+ $paymentCode = $paymentObj->getCode();
231
+ $lastTranId = $helper->makeValidNumber($payment->getLastTransId());
232
+ $responseCodeApproved = Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED;
233
+ $storeId = $order->getStoreId();
234
+ $request = new Varien_Object();
235
+ $paymentObj->assignOrderBasicParams($request, $payment, $storeId);
236
+ $request->setTid($lastTranId)
237
+ ->setStatus($responseCodeApproved)
238
+ ->setEditStatus(true)
239
+ ->setUpdateInvAmount(1)
240
+ ->setAmount($amountChanged);
241
+ if ($invoiceDuedate != '') {
242
+ $request->setDueDate($invoiceDuedate);
243
+ }
244
+
245
+ $amountChanged = $rawAmount;
246
+ $loadTransStatus = $helper->loadTransactionStatus($lastTranId);
247
+ $transStatus = $loadTransStatus->getTransactionStatus();
248
+ // set transaction amount
249
+ $loadTransStatus->setAmount($amountChanged)
250
+ ->save();
251
+
252
+ if (!in_array(NULL, $request->toArray()) && !empty($transStatus)) {
253
+ $buildNovalnetParam = http_build_query($request->getData());
254
+ $payportUrl = $helper->getPayportUrl('paygate');
255
+ $dataHelper = Mage::helper('novalnet_payment/AssignData');
256
+ $response = $dataHelper->setRawCallRequest($buildNovalnetParam, $payportUrl);
257
+
258
+ if ($response->getStatus() == $responseCodeApproved) {
259
+ // make capture transaction open for lower versions to make refund
260
+ if (version_compare($helper->getMagentoVersion(), '1.6', '<')) {
261
+ $payment->setIsTransactionClosed(false)
262
+ ->save();
263
+ }
264
+ $countAmount = $helper->getAmountCollection($orderId, NULL, NULL);
265
+ $modNovalamountchanged = $helper->getModelAmountchanged();
266
+ if ($paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE || $paymentCode == Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
267
+ $data = unserialize($payment->getAdditionalData());
268
+ if($invoiceDuedate != '')
269
+ {
270
+ $note = explode('|',$data['NnNote']);
271
+ $formatDate = Mage::helper('core')->formatDate($invoiceDuedate);
272
+ $note[0] = "Due Date: <b>$formatDate</b>";
273
+ $data['NnNote'] = implode('|',$note);
274
+ }
275
+ $data['NnNoteAmount'] = $dataHelper->getBankDetailsAmount($amountChanged);
276
+ $payment->setAdditionalData(serialize($data))
277
+ ->save();
278
+ $modNovalamountchanged->setInvoiceDuedate($invoiceDuedate);
279
+ }
280
+ $countAmount = $helper->getAmountCollection($orderId, NULL, NULL);
281
+ $modNovalamountchanged = $countAmount ? $helper->getModelAmountchanged()->load($orderId, 'order_id')
282
+ : $helper->getModelAmountchanged();
283
+ $modNovalamountchanged->setOrderId($orderId)
284
+ ->setAmountChanged($amountChanged)
285
+ ->setAmountDatetime($helper->getCurrentDateTime())
286
+ ->save();
287
+ if ($amountChanged == $callbackValue && $paymentCode == Novalnet_Payment_Model_Config::NN_PREPAYMENT) {
288
+ $this->setOrderStatus($order);
289
+ $this->saveInvoice($order,$lastTranId,$paymentCode);
290
+ $this->setNNTotalPaid($order,$amountChanged);
291
+ }
292
+
293
+ if ($paymentCode == Novalnet_Payment_Model_Config::NN_INVOICE) {
294
+ $payment->setAmountRefunded(0)
295
+ ->setBaseAmountRefunded(0)
296
+ ->save();
297
+ $order->setTotalRefunded(0);
298
+ $order->setBaseTotalRefunded(0);
299
+ $order->save();
300
+ $this->setNNTotalPaid($order,$amountChanged);
301
+
302
+ if ($amountChanged == $callbackValue) {
303
+ $this->setOrderStatus($order);
304
+ $invoice = $order->getInvoiceCollection()->getFirstItem();
305
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
306
+ $invoice->save();
307
+ }
308
+ }
309
+ } else {
310
+ Mage::throwException($response->getStatusDesc());
311
+ }
312
+ $customerId = $order->getCustomerId();
313
+ $paymentObj->logNovalnetTransactionData($request, $response, $lastTranId, $customerId, $storeId);
314
+ $this->_getSession()->addSuccess(
315
+ $this->__('Transaction amount updated successfully.')
316
+ );
317
+ }
318
+ } catch (Mage_Core_Exception $e) {
319
+ $this->_getSession()->addError($e->getMessage());
320
+ } catch (Exception $e) {
321
+ $this->_getSession()->addError($e->getMessage());
322
+ }
323
+ $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
324
+ }
325
+ } catch (Mage_Core_Exception $e) {
326
+ $this->_getSession()->addError($e->getMessage());
327
+ $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
328
+ }
329
+ }
330
+
331
+ /**
332
+ * Set the total paid amount after amount update
333
+ *
334
+ * @param varien_object $order
335
+ * @param int $amountChanged
336
+ */
337
+ private function setNNTotalPaid($order,$amountChanged)
338
+ {
339
+ $order->setTotalPaid($amountChanged)
340
+ ->setBaseTotalPaid($amountChanged)
341
+ ->save();
342
  }
343
 
344
+ /**
345
+ * Set callback status
346
+ *
347
+ * @param varien_object $order
348
+ * @return null
349
+ */
350
+ private function setOrderStatus($order, $confirmStatus = NULL)
351
+ {
352
+ $payment = $order->getPayment();
353
+ $storeId = $payment->getOrder()->getStoreId();
354
+ $paymentObj = $payment->getMethodInstance();
355
+ $orderStatus = $confirmStatus
356
+ ? $paymentObj->_getConfigData('order_status', true)
357
+ : $paymentObj->_getConfigData('order_status_after_payment', '', $storeId);
358
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $orderStatus, '', true)->save();
359
+ }
360
  }
app/code/community/Novalnet/Payment/controllers/Adminhtml/Sales/Recurring/ProfileController.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ require_once 'Mage' . DS . 'Adminhtml'. DS . 'controllers' . DS . 'Sales' . DS . 'Recurring' . DS . 'ProfileController.php';
28
+
29
+ class Novalnet_Payment_Adminhtml_Sales_Recurring_ProfileController extends Mage_Adminhtml_Sales_Recurring_ProfileController
30
+ {
31
+ /**
32
+ * Recurring profiles list
33
+ *
34
+ * @return Mage_Adminhtml_Sales_Recurring_ProfileController
35
+ */
36
+ public function indexAction()
37
+ {
38
+ $this->_title(Mage::helper('novalnet_payment')->__('Sales'))->_title(Mage::helper('novalnet_payment')->__('Novalnet Recurring Profiles'))
39
+ ->loadLayout()
40
+ ->_setActiveMenu('novalnet')
41
+ ->renderLayout();
42
+ return $this;
43
+ }
44
+
45
+ /**
46
+ * View recurring profile information's
47
+ *
48
+ */
49
+ public function viewAction()
50
+ {
51
+ try {
52
+ $this->_title(Mage::helper('sales')->__('Sales'))->_title(Mage::helper('sales')->__('Recurring Profiles'));
53
+ $profile = $this->_initProfile();
54
+ $this->loadLayout()
55
+ ->_setActiveMenu('sales/recurring_profile')
56
+ ->_title(Mage::helper('sales')->__('Profile #%s', $profile->getReferenceId()))
57
+ ->renderLayout()
58
+ ;
59
+ return;
60
+ } catch (Mage_Core_Exception $e) {
61
+ $this->_getSession()->addError($e->getMessage());
62
+ } catch (Exception $e) {
63
+ Mage::logException($e);
64
+ }
65
+ $this->_redirect('*/*/');
66
+ }
67
+
68
+ /**
69
+ * Profiles ajax grid
70
+ *
71
+ */
72
+ public function gridAction()
73
+ {
74
+ $this->getResponse()->setBody(
75
+ $this->getLayout()->createBlock('novalnet_payment/adminhtml_recurring_profile_grid')->toHtml()
76
+ );
77
+ }
78
+
79
+ /**
80
+ * Profile orders ajax grid
81
+ *
82
+ */
83
+ public function ordersAction()
84
+ {
85
+ try {
86
+ $this->_initProfile();
87
+ $this->loadLayout()->renderLayout();
88
+ } catch (Exception $e) {
89
+ Mage::logException($e);
90
+ $this->norouteAction();
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Profile state updater action
96
+ *
97
+ */
98
+ public function updateStateAction()
99
+ {
100
+ $profile = null;
101
+ try {
102
+ $profile = $this->_initProfile();
103
+
104
+ switch ($this->getRequest()->getParam('action')) {
105
+ case 'cancel':
106
+ $profile->cancel();
107
+ break;
108
+ case 'suspend':
109
+ $profile->suspend();
110
+ break;
111
+ case 'activate':
112
+ $profile->activate();
113
+ break;
114
+ }
115
+ $this->_getSession()->addSuccess(Mage::helper('sales')->__('The profile state has been updated.'));
116
+ } catch (Mage_Core_Exception $e) {
117
+ $this->_getSession()->addError($e->getMessage());
118
+ } catch (Exception $e) {
119
+ $this->_getSession()->addError(Mage::helper('sales')->__('Failed to update the profile.'));
120
+ Mage::logException($e);
121
+ }
122
+ if ($profile) {
123
+ $this->_redirect('*/*/view', array('profile' => $profile->getId()));
124
+ } else {
125
+ $this->_redirect('*/*/');
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Profile information updater action
131
+ *
132
+ */
133
+ public function updateProfileAction()
134
+ {
135
+ $profile = null;
136
+ try {
137
+ $profile = $this->_initProfile();
138
+ $profile->fetchUpdate();
139
+ if ($profile->hasDataChanges()) {
140
+ $profile->save();
141
+ $this->_getSession()->addSuccess($this->__('The profile has been updated.'));
142
+ } else {
143
+ $this->_getSession()->addNotice($this->__('The profile has no changes.'));
144
+ }
145
+ } catch (Mage_Core_Exception $e) {
146
+ $this->_getSession()->addError($e->getMessage());
147
+ } catch (Exception $e) {
148
+ $this->_getSession()->addError($this->__('Failed to update the profile.'));
149
+ Mage::logException($e);
150
+ }
151
+ if ($profile) {
152
+ $this->_redirect('*/*/view', array('profile' => $profile->getId()));
153
+ } else {
154
+ $this->_redirect('*/*/');
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Cutomer billing agreements ajax action
160
+ *
161
+ */
162
+ public function customerGridAction()
163
+ {
164
+ $this->_initCustomer();
165
+ $this->loadLayout(false)
166
+ ->renderLayout();
167
+ }
168
+
169
+ /**
170
+ * Initialize customer by ID specified in request
171
+ *
172
+ * @return Mage_Adminhtml_Sales_Billing_AgreementController
173
+ */
174
+ protected function _initCustomer()
175
+ {
176
+ $customerId = (int) $this->getRequest()->getParam('id');
177
+ $customer = Mage::getModel('customer/customer');
178
+
179
+ if ($customerId) {
180
+ $customer->load($customerId);
181
+ }
182
+
183
+ Mage::register('current_customer', $customer);
184
+ return $this;
185
+ }
186
+
187
+ /**
188
+ * Load/set profile
189
+ *
190
+ * @return Mage_Sales_Model_Recurring_Profile
191
+ */
192
+ protected function _initProfile()
193
+ {
194
+ $profile = Mage::getModel('sales/recurring_profile')->load($this->getRequest()->getParam('profile'));
195
+ if (!$profile->getId()) {
196
+ Mage::throwException($this->__('Specified profile does not exist.'));
197
+ }
198
+ Mage::register('current_recurring_profile', $profile);
199
+ return $profile;
200
+ }
201
+ }
app/code/community/Novalnet/Payment/controllers/Adminhtml/TransactionController.php CHANGED
@@ -25,22 +25,18 @@
25
  */
26
  class Novalnet_Payment_Adminhtml_TransactionController extends Mage_Adminhtml_Controller_Action
27
  {
28
-
29
  /**
 
 
30
  * @return Novalnet_Payment_Adminhtml_TransactionController
31
  *
32
  */
33
  protected function _initAction()
34
  {
35
- $this->loadLayout();
36
- $this->setUsedModuleName('novalnet_payment');
37
- $this->_setActiveMenu('novalnet/transactionstatus');
38
- $this->_addBreadcrumb(
39
- $this->__('Novalnet'), $this->__('Novalnet')
40
- );
41
-
42
- $this->_title($this->__('Novalnet'));
43
- $this->_title($this->__('Transaction'));
44
 
45
  return $this;
46
  }
@@ -72,23 +68,22 @@ class Novalnet_Payment_Adminhtml_TransactionController extends Mage_Adminhtml_Co
72
  */
73
  public function viewAction()
74
  {
75
- $id = $this->getRequest()->getParam('nntxn_id');
76
- $modelTransStatus = Mage::helper('novalnet_payment')->getModelTransactionStatus()->load($id);
77
 
78
- if (empty($id) || !$modelTransStatus->getNnTxnId()) {
79
  $this->_forward('noRoute');
80
  }
81
 
82
- $this->_title(sprintf("#%s", $modelTransStatus->getTransactionNo()));
83
 
84
- // @var $modelTransStatus Novalnet_Payment_Model_Transactionstatus
85
  $modelTransaction = Mage::helper('novalnet_payment')->getModelTransactionStatus();
86
- $modelTransaction->loadByTransactionStatusId($modelTransStatus);
87
 
88
  Mage::register('novalnet_payment_transactionstatus', $modelTransaction);
89
 
90
  $this->_initAction();
91
  $this->renderLayout();
92
  }
93
-
94
  }
25
  */
26
  class Novalnet_Payment_Adminhtml_TransactionController extends Mage_Adminhtml_Controller_Action
27
  {
 
28
  /**
29
+ * Init layout, menu and breadcrumb
30
+ *
31
  * @return Novalnet_Payment_Adminhtml_TransactionController
32
  *
33
  */
34
  protected function _initAction()
35
  {
36
+ $this->loadLayout()
37
+ ->setUsedModuleName('novalnet_payment')
38
+ ->_setActiveMenu('novalnet/transactionstatus')
39
+ ->_addBreadcrumb($this->__('Novalnet'), $this->__('Transaction'));
 
 
 
 
 
40
 
41
  return $this;
42
  }
68
  */
69
  public function viewAction()
70
  {
71
+ $nnTxnId = $this->getRequest()->getParam('nntxn_id');
72
+ $transactionStatus = Mage::helper('novalnet_payment')->getModelTransactionStatus()->load($nnTxnId);
73
 
74
+ if (empty($nnTxnId) || !$transactionStatus->getNnTxnId()) {
75
  $this->_forward('noRoute');
76
  }
77
 
78
+ $this->_title(sprintf("#%s", $transactionStatus->getTransactionNo()));
79
 
80
+ // @var $transactionStatus Novalnet_Payment_Model_Transactionstatus
81
  $modelTransaction = Mage::helper('novalnet_payment')->getModelTransactionStatus();
82
+ $modelTransaction->loadByTransactionStatusId($transactionStatus);
83
 
84
  Mage::register('novalnet_payment_transactionstatus', $modelTransaction);
85
 
86
  $this->_initAction();
87
  $this->renderLayout();
88
  }
 
89
  }
app/code/community/Novalnet/Payment/controllers/Adminhtml/TransactionoverviewController.php CHANGED
@@ -25,20 +25,18 @@
25
  */
26
  class Novalnet_Payment_Adminhtml_TransactionoverviewController extends Mage_Adminhtml_Controller_Action
27
  {
28
-
29
  /**
 
 
30
  * @return Novalnet_NovalnetIdeal_Adminhtml_TransactionController
31
  *
32
  */
33
  protected function _initAction()
34
  {
35
- $this->loadLayout();
36
- $this->setUsedModuleName('novalnet_payment');
37
- $this->_setActiveMenu('novalnet/transactionoverview');
38
- $this->_addBreadcrumb($this->__('Novalnet'), $this->__('Novalnet'));
39
-
40
- $this->_title($this->__('Novalnet'));
41
- $this->_title($this->__('Transaction Overview'));
42
 
43
  return $this;
44
  }
@@ -70,23 +68,21 @@ class Novalnet_Payment_Adminhtml_TransactionoverviewController extends Mage_Admi
70
  */
71
  public function viewAction()
72
  {
73
- $id = $this->getRequest()->getParam('nnlog_id');
74
- $modelTransOverview = Mage::helper('novalnet_payment')->getModelTransactionOverview()->load($id);
 
75
 
76
- if (empty($id) || !$modelTransOverview->getNnLogId()) {
77
  $this->_forward('noRoute');
78
  }
79
 
80
- $this->_title(sprintf("#%s", $modelTransOverview->getTransactionId()));
81
 
82
- // @var $modelTransOverview Novalnet_Payment_Model_Transactionoverview
83
- $modelTransaction = Mage::helper('novalnet_payment')->getModelTransactionOverview();
84
- $modelTransaction->loadByOrderLogId($modelTransOverview);
85
 
86
- Mage::register('novalnet_payment_transactionoverview', $modelTransOverview);
87
 
88
  $this->_initAction();
89
  $this->renderLayout();
90
  }
91
-
92
  }
25
  */
26
  class Novalnet_Payment_Adminhtml_TransactionoverviewController extends Mage_Adminhtml_Controller_Action
27
  {
 
28
  /**
29
+ * Init layout, menu and breadcrumb
30
+ *
31
  * @return Novalnet_NovalnetIdeal_Adminhtml_TransactionController
32
  *
33
  */
34
  protected function _initAction()
35
  {
36
+ $this->loadLayout()
37
+ ->setUsedModuleName('novalnet_payment')
38
+ ->_setActiveMenu('novalnet/transactionoverview')
39
+ ->_addBreadcrumb($this->__('Novalnet'), $this->__('Transaction Overview'));
 
 
 
40
 
41
  return $this;
42
  }
68
  */
69
  public function viewAction()
70
  {
71
+ $nnTxnId = $this->getRequest()->getParam('nnlog_id');
72
+ $modelTransaction = Mage::helper('novalnet_payment')->getModelTransactionOverview();
73
+ $transOverview = $modelTransaction->load($nnTxnId);
74
 
75
+ if (empty($nnTxnId) || !$transOverview->getNnLogId()) {
76
  $this->_forward('noRoute');
77
  }
78
 
79
+ $this->_title(sprintf("#%s", $transOverview->getTransactionId()));
80
 
81
+ $modelTransaction->loadByOrderLogId($transOverview);
 
 
82
 
83
+ Mage::register('novalnet_payment_transactionoverview', $transOverview);
84
 
85
  $this->_initAction();
86
  $this->renderLayout();
87
  }
 
88
  }
app/code/community/Novalnet/Payment/controllers/GatewayController.php CHANGED
@@ -25,23 +25,25 @@
25
  */
26
  class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Action
27
  {
28
-
29
  /**
30
- * when customer select payment method
 
31
  */
32
  public function redirectAction()
33
  {
34
  try {
35
  $session = $this->_getCheckout();
36
  $order = $this->_getOrder();
 
 
37
  $quoteId = $session->getQuoteId() ? $session->getQuoteId() : $session->getLastQuoteId();
38
  $items = Mage::getModel('sales/quote')->load($quoteId)->getItemsQty();
39
-
40
- $paymentObj = $order->getPayment()->getMethodInstance();
41
  $session->getQuote()->setIsActive(true)->save();
42
- if ($order->getPayment()->getAdditionalInformation($paymentObj->getCode() . '_redirectAction')
43
- != 1) {
44
- $order->getPayment()->setAdditionalInformation($paymentObj->getCode() . '_redirectAction', 1);
 
 
45
  if ($session->getLastRealOrderId() && $items) {
46
  $state = Mage_Sales_Model_Order::STATE_HOLDED; //set State,Status to HOLD
47
  $status = Mage_Sales_Model_Order::STATE_HOLDED;
@@ -74,19 +76,10 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
74
  {
75
  $session = $this->_getCheckout();
76
  $response = $this->getRequest()->getParams();
77
- $dataObj = new Varien_Object($response);
78
- $this->_getNovalnetHelper()->doTransactionOrderLog($dataObj, $response['order_no']); // Save return success response
79
  $status = $this->_checkReturnedData();
80
-
81
- if (!$response['order_no'] || !$status) {
82
- //OnFailure
83
- $session->getQuote()->setIsActive(false)->save();
84
- $this->_redirect('checkout/onepage/failure');
85
- } else {
86
- //OnSuccess
87
- $session->getQuote()->setIsActive(false)->save();
88
- $this->_redirect('checkout/onepage/success');
89
- }
90
  }
91
 
92
  /**
@@ -99,34 +92,36 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
99
  $order = $this->_getOrder();
100
  $session = $this->_getCheckout();
101
  $payment = $order->getPayment();
 
102
  $paymentObj = $payment->getMethodInstance();
103
 
104
- $paymentObj->unsetMethodSession($paymentObj->getCode());
105
  $session->getQuote()->setIsActive(false)->save();
106
  $response = $this->getRequest()->getParams();
107
- $dataObj = new Varien_Object($response);
108
- $this->_getNovalnetHelper()->doTransactionOrderLog($dataObj, $response['order_no']); // Save return error response
109
  //Unhold an order:-
110
  if ($order->canUnhold()) {
111
  $order->unhold()->save();
112
  }
113
 
114
  //Cancel the order:-
115
- if ($order->getPayment()->getAdditionalInformation($paymentObj->getCode() . '_errorAction')
 
116
  != 1) {
117
- $order->getPayment()->setAdditionalInformation($paymentObj->getCode() . '_errorAction', 1);
118
  $dataObj = new Varien_Object($response);
119
  $paymentObj->saveCancelledOrder($dataObj, $payment);
120
  $statusMessage = ($dataObj->getStatusText() != NULL) ? $dataObj->getStatusText()
121
  : $dataObj->getStatusDesc();
122
- Mage::getSingleton('core/session')->addError($statusMessage);
123
  }
124
 
 
125
  $this->_redirect('checkout/onepage/failure', array('_secure' => true));
126
  }
127
 
128
  /**
129
- * Recieves Server Response for Direct Paymetns.
130
  *
131
  * Redirects to success or failure page.
132
  */
@@ -135,43 +130,41 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
135
  $order = $this->_getOrder();
136
  $payment = $order->getPayment();
137
  $paymentObj = $payment->getMethodInstance();
 
138
 
139
- if ($order->getPayment()->getAdditionalInformation($paymentObj->getCode() . '_paymentAction')
140
  != 1) {
141
-
142
- $order->getPayment()->setAdditionalInformation($paymentObj->getCode() . '_paymentAction', 1);
143
- $paymentCode = $paymentObj->getCode();
144
- $helper = $this->_getNovalnetHelper();
145
- $methodSession = $this->_getCheckout()->getData($paymentCode);
146
 
147
  if (!$paymentObj->isCallbackTypeCall()) {
148
- $request = $methodSession->getPaymentReqData();
149
  $response = $paymentObj->postRequest($request);
150
  $error = $paymentObj->validateNovalnetResponse($payment, $response);
151
  } else {
152
- $error = $paymentObj->validateNovalnetResponse($payment, $methodSession->getPaymentResData());
153
  }
154
 
155
- if ($error !== false) {
156
- $paymentObj->unsetMethodSession($paymentCode);
157
- $this->_redirect('checkout/onepage/failure');
158
- } else {
159
- //sendNewOrderEmail
160
- if (!$order->getEmailSent() && $order->getId() && $error == false) {
161
- try {
162
- $order->sendNewOrderEmail()
163
- ->setEmailSent(true)
164
- ->save();
165
- } catch (Exception $e) {
166
- Mage::throwException($this->_getNovalnetHelper()->__('Cannot send new order email.'));
167
- }
168
  }
169
- $paymentObj->unsetMethodSession($paymentCode);
170
- $this->_redirect('checkout/onepage/success');
171
  }
 
 
 
 
 
172
  } else {
173
- $this->_redirect('checkout/cart');
174
  }
 
 
175
  }
176
 
177
  /**
@@ -185,46 +178,51 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
185
  $status = false;
186
  if (!$this->getRequest()->isPost()) {
187
  $this->norouteAction();
188
- return;
189
  }
190
 
191
  $order = $this->_getOrder();
192
  $payment = $order->getPayment();
193
  $paymentObj = $payment->getMethodInstance();
194
- $paymentCode = $paymentObj->getCode();
195
- $helper = $this->_getNovalnetHelper();
196
  $this->_getCheckout()->getQuote()->setIsActive(true)->save();
197
- $onHoldStatus = Novalnet_Payment_Model_Config::getInstance()->getNovalnetVariable('paymentOnholdStaus');
198
- array_push($onHoldStatus, '100');
199
  //Get response
200
  $response = $this->getRequest()->getParams();
 
 
201
 
202
  //Unhold an order:-
203
  if ($order->canUnhold()) {
204
  $order->unhold()->save();
205
  }
206
 
207
- $paymentObj->unsetMethodSession($paymentCode);
208
- $authorizeKey = $paymentObj->_getConfigData('password', true);
209
- if ($response['status'] == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
210
- && $paymentCode != Novalnet_Payment_Model_Config::NN_CC) {
211
- $response['status'] = $helper->checkParams($response, $authorizeKey);
212
- }
213
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  //success
215
- if (($paymentCode == Novalnet_Payment_Model_Config::NN_PAYPAL && $response['status']
216
- == Novalnet_Payment_Model_Config::PAYPAL_PENDING_CODE) || in_array($response['status'], $onHoldStatus)) {
 
217
  //set Novalnet Mode
218
- $serverResponse = ($paymentCode != Novalnet_Payment_Model_Config::NN_CC)
219
- ? $helper->getDecodedParam($response['test_mode'], $authorizeKey)
220
- : $response['test_mode'];
221
- $shopMode = $paymentObj->_getConfigData('live_mode');
222
- $testMode = (((isset($serverResponse) && $serverResponse == 1) || (isset($shopMode)
223
- && $shopMode == 0)) ? 1 : 0 );
224
- $data = unserialize($payment->getAdditionalData());
225
  $data['NnTestOrder'] = $testMode;
226
  $data['NnTid'] = $response['tid'];
227
- $transMode = ($paymentCode == Novalnet_Payment_Model_Config::NN_CC)
 
228
  ? false : true;
229
 
230
  $payment->setStatus(Novalnet_Payment_Model_Payment_Method_Abstract::STATUS_SUCCESS)
@@ -234,24 +232,26 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
234
  ->save();
235
  $order->setPayment($payment);
236
  $order->save(); //Save details in order
237
- if ($payment->getAdditionalInformation($paymentCode . '_successAction')
 
 
238
  != 1) {
239
- $payment->setAdditionalInformation($paymentCode . '_successAction', 1);
240
  $this->_saveSuccessOrder($order, $response, $authorizeKey);
241
  }
242
  $status = true;
243
  } else {
244
- $dataObj = new Varien_Object($response);
245
  $paymentObj->saveCancelledOrder($dataObj, $payment);
246
  $statusMessage = ($dataObj->getStatusText() != NULL) ? $dataObj->getStatusText()
247
  : $dataObj->getStatusDesc();
248
- Mage::getSingleton('core/session')->addError($statusMessage);
249
  $status = false;
250
  }
251
  $order->save();
252
  return $status;
253
  } catch (Mage_Core_Exception $e) {
254
  $this->_getCheckout()->addError($e->getMessage());
 
255
  } catch (Exception $e) {
256
  Mage::logException($e);
257
  }
@@ -269,31 +269,27 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
269
  $payment = $order->getPayment();
270
  $paymentObj = $payment->getMethodInstance();
271
  $txnId = $response['tid'];
272
- $helper = $this->_getNovalnetHelper();
273
  $getAdminTransaction = $paymentObj->doNovalnetStatusCall($txnId, $payment);
274
- $magentoVersion = $helper->getMagentoVersion();
275
- $captureMode = (version_compare($magentoVersion, '1.6', '<')) ? false : true;
276
-
277
- if ($order->canInvoice() && $getAdminTransaction->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
278
- $payment->setTransactionId($txnId) // Add capture text to make the new transaction
279
- ->setParentTransactionId(null)
280
- ->setIsTransactionClosed($captureMode)
281
- ->setLastTransId($txnId)
282
- ->capture(null)
283
- ->save();
284
- } else {
285
- $payment->setTransactionId($txnId)
286
  ->setLastTransId($txnId)
287
- ->setParentTransactionId(null)
288
- ->save();
 
 
 
 
289
  }
 
290
 
291
  $setOrderAfterStatus = $paymentObj->_getConfigData('order_status_after_payment')
292
- ? $paymentObj->_getConfigData('order_status_after_payment') : Mage_Sales_Model_Order::STATE_PROCESSING; // If after status is empty set default status
 
293
  if ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_PAYPAL && $response['status']
294
- == Novalnet_Payment_Model_Config::PAYPAL_PENDING_CODE) {
295
  $setOrderAfterStatus = $paymentObj->_getConfigData('order_status')
296
- ? $paymentObj->_getConfigData('order_status') : Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
297
  }
298
  $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $setOrderAfterStatus, $helper->__('Customer successfully returned from Novalnet'), true
299
  )->save();
@@ -311,17 +307,13 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
311
 
312
  $dataObj = new Varien_Object($response);
313
  $paymentObj->doNovalnetPostbackCall($dataObj); //Do Second Call
314
- $statusText = ($response['status_text']) ? $response['status_text'] : $helper->__('successful');
315
- Mage::getSingleton('core/session')->addSuccess($statusText);
316
-
317
  $order->save();
318
-
319
- // Get Admin Transaction status via API
320
- if ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_CC) {
321
- $dataObj->setAmount($helper->getFormatedAmount($response['amount'], 'RAW'));
322
- }
323
  $amount = is_numeric($response['amount']) ? $response['amount'] : $helper->getDecodedParam($response['amount'], $authorizeKey);
324
- $helper->doTransactionStatusSave($dataObj, $getAdminTransaction, $payment, $helper->getFormatedAmount($amount, 'RAW')); // Save the Transaction status
 
325
  }
326
 
327
  /**
@@ -329,7 +321,7 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
329
  *
330
  * @return Mage_Checkout_Model_Session
331
  */
332
- public function _getCheckout()
333
  {
334
  return Mage::getSingleton('checkout/session');
335
  }
@@ -354,4 +346,107 @@ class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Acti
354
  return Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->getLastRealOrderId());
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  }
25
  */
26
  class Novalnet_Payment_GatewayController extends Mage_Core_Controller_Front_Action
27
  {
 
28
  /**
29
+ * Redirection process
30
+ *
31
  */
32
  public function redirectAction()
33
  {
34
  try {
35
  $session = $this->_getCheckout();
36
  $order = $this->_getOrder();
37
+ $payment = $order->getPayment();
38
+ $paymentObj = $payment->getMethodInstance();
39
  $quoteId = $session->getQuoteId() ? $session->getQuoteId() : $session->getLastQuoteId();
40
  $items = Mage::getModel('sales/quote')->load($quoteId)->getItemsQty();
 
 
41
  $session->getQuote()->setIsActive(true)->save();
42
+ $redirectActionFlag = $paymentObj->getCode() . '_redirectAction';
43
+
44
+ if ($payment->getAdditionalInformation($redirectActionFlag)
45
+ != 1) {
46
+ $payment->setAdditionalInformation($redirectActionFlag, 1);
47
  if ($session->getLastRealOrderId() && $items) {
48
  $state = Mage_Sales_Model_Order::STATE_HOLDED; //set State,Status to HOLD
49
  $status = Mage_Sales_Model_Order::STATE_HOLDED;
76
  {
77
  $session = $this->_getCheckout();
78
  $response = $this->getRequest()->getParams();
79
+ $this->doTransactionOrderLog($response);
 
80
  $status = $this->_checkReturnedData();
81
+ $session->getQuote()->setIsActive(false)->save();
82
+ $this->_redirect((!$response['order_no'] || !$status) ? 'checkout/onepage/failure' : 'checkout/onepage/success' );
 
 
 
 
 
 
 
 
83
  }
84
 
85
  /**
92
  $order = $this->_getOrder();
93
  $session = $this->_getCheckout();
94
  $payment = $order->getPayment();
95
+ $helper = $this->_getNovalnetHelper();
96
  $paymentObj = $payment->getMethodInstance();
97
 
98
+ $paymentObj->unsetFormMethodSession();
99
  $session->getQuote()->setIsActive(false)->save();
100
  $response = $this->getRequest()->getParams();
101
+ $this->doTransactionOrderLog($response); // Save return error response
 
102
  //Unhold an order:-
103
  if ($order->canUnhold()) {
104
  $order->unhold()->save();
105
  }
106
 
107
  //Cancel the order:-
108
+ $errorActionFlag = $paymentObj->getCode() . '_errorAction';
109
+ if ($payment->getAdditionalInformation($errorActionFlag)
110
  != 1) {
111
+ $payment->setAdditionalInformation($errorActionFlag, 1);
112
  $dataObj = new Varien_Object($response);
113
  $paymentObj->saveCancelledOrder($dataObj, $payment);
114
  $statusMessage = ($dataObj->getStatusText() != NULL) ? $dataObj->getStatusText()
115
  : $dataObj->getStatusDesc();
116
+ $helper->getCoresession()->addError($statusMessage);
117
  }
118
 
119
+ $this->unsetNovalnetSessionData($paymentObj->getCode());
120
  $this->_redirect('checkout/onepage/failure', array('_secure' => true));
121
  }
122
 
123
  /**
124
+ * Recieve server response for Novalnet direct payment methods.
125
  *
126
  * Redirects to success or failure page.
127
  */
130
  $order = $this->_getOrder();
131
  $payment = $order->getPayment();
132
  $paymentObj = $payment->getMethodInstance();
133
+ $paymentActionFlag = $paymentObj->getCode() . '_paymentAction';
134
 
135
+ if ($payment->getAdditionalInformation($paymentActionFlag)
136
  != 1) {
137
+ $payment->setAdditionalInformation($paymentActionFlag, 1);
138
+ $session = $this->_getCheckout();
 
 
 
139
 
140
  if (!$paymentObj->isCallbackTypeCall()) {
141
+ $request = $session->getPaymentReqData();
142
  $response = $paymentObj->postRequest($request);
143
  $error = $paymentObj->validateNovalnetResponse($payment, $response);
144
  } else {
145
+ $error = $paymentObj->validateNovalnetResponse($payment, $session->getPaymentResData());
146
  }
147
 
148
+ //sendNewOrderEmail
149
+ if (!$order->getEmailSent() && $order->getId() && $error == false) {
150
+ try {
151
+ $order->sendNewOrderEmail()
152
+ ->setEmailSent(true)
153
+ ->save();
154
+ } catch (Exception $e) {
155
+ Mage::throwException($this->_getNovalnetHelper()->__('Cannot send new order email.'));
 
 
 
 
 
156
  }
 
 
157
  }
158
+ // unset form payment method session
159
+ $paymentObj->unsetFormMethodSession();
160
+ // unset payment request and response values
161
+ $paymentObj->unsetPaymentReqResData();
162
+ $actionUrl = $error !== false ? 'checkout/onepage/failure' : 'checkout/onepage/success';
163
  } else {
164
+ $actionUrl = 'checkout/cart';
165
  }
166
+
167
+ $this->_redirect($actionUrl);
168
  }
169
 
170
  /**
178
  $status = false;
179
  if (!$this->getRequest()->isPost()) {
180
  $this->norouteAction();
181
+ return false;
182
  }
183
 
184
  $order = $this->_getOrder();
185
  $payment = $order->getPayment();
186
  $paymentObj = $payment->getMethodInstance();
 
 
187
  $this->_getCheckout()->getQuote()->setIsActive(true)->save();
 
 
188
  //Get response
189
  $response = $this->getRequest()->getParams();
190
+ $dataObj = new Varien_Object($response);
191
+ $helper = $this->_getNovalnetHelper();
192
 
193
  //Unhold an order:-
194
  if ($order->canUnhold()) {
195
  $order->unhold()->save();
196
  }
197
 
198
+ $data = unserialize($payment->getAdditionalData());
199
+ $authorizeKey = $data['authorize_key'];
200
+ // unset payment method session
201
+ $this->unsetNovalnetSessionData($paymentObj->getCode());
202
+ $paymentObj->unsetFormMethodSession();
 
203
 
204
+ // check response status
205
+ $response = $this->responseStatus($authorizeKey,$response,$paymentObj);
206
+ if ($paymentObj->getCode() != Novalnet_Payment_Model_Config::NN_CC) {
207
+ $checkHash = $helper->checkHash($response, $authorizeKey);
208
+ if (!$checkHash) {
209
+ $response['status_text'] = $helper->__('checkHash failed');
210
+ $dataObj = new Varien_Object($response);
211
+ $paymentObj->saveCancelledOrder($dataObj, $payment);
212
+ $helper->getCoresession()->addError($helper->__('checkHash failed'));
213
+ return false;
214
+ }
215
+ }
216
  //success
217
+ if (($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_PAYPAL
218
+ && $response['status'] == Novalnet_Payment_Model_Config::PAYPAL_PENDING_CODE)
219
+ || $response['status'] == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
220
  //set Novalnet Mode
221
+ $testMode = $this->setNovalnetMode($paymentObj,$response,$authorizeKey);
 
 
 
 
 
 
222
  $data['NnTestOrder'] = $testMode;
223
  $data['NnTid'] = $response['tid'];
224
+ $amount = is_numeric($response['amount']) ? $response['amount'] : $helper->getDecodedParam($response['amount'], $authorizeKey);
225
+ $transMode = ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_CC)
226
  ? false : true;
227
 
228
  $payment->setStatus(Novalnet_Payment_Model_Payment_Method_Abstract::STATUS_SUCCESS)
232
  ->save();
233
  $order->setPayment($payment);
234
  $order->save(); //Save details in order
235
+ $successActionFlag = $paymentObj->getCode() . '_successAction';
236
+
237
+ if ($payment->getAdditionalInformation($successActionFlag)
238
  != 1) {
239
+ $payment->setAdditionalInformation($successActionFlag, 1);
240
  $this->_saveSuccessOrder($order, $response, $authorizeKey);
241
  }
242
  $status = true;
243
  } else {
 
244
  $paymentObj->saveCancelledOrder($dataObj, $payment);
245
  $statusMessage = ($dataObj->getStatusText() != NULL) ? $dataObj->getStatusText()
246
  : $dataObj->getStatusDesc();
247
+ $helper->getCoresession()->addError($statusMessage);
248
  $status = false;
249
  }
250
  $order->save();
251
  return $status;
252
  } catch (Mage_Core_Exception $e) {
253
  $this->_getCheckout()->addError($e->getMessage());
254
+ return false;
255
  } catch (Exception $e) {
256
  Mage::logException($e);
257
  }
269
  $payment = $order->getPayment();
270
  $paymentObj = $payment->getMethodInstance();
271
  $txnId = $response['tid'];
 
272
  $getAdminTransaction = $paymentObj->doNovalnetStatusCall($txnId, $payment);
273
+ $helper = $this->_getNovalnetHelper();
274
+ // save transaction id
275
+ $payment->setTransactionId($txnId)
 
 
 
 
 
 
 
 
 
276
  ->setLastTransId($txnId)
277
+ ->setParentTransactionId(null);
278
+ // capture process
279
+ if ($order->canInvoice() && $getAdminTransaction->getStatus() == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED) {
280
+ $captureMode = (version_compare($helper->getMagentoVersion(), '1.6', '<')) ? false : true;
281
+ $payment->setIsTransactionClosed($captureMode)
282
+ ->capture(null);
283
  }
284
+ $payment->save();
285
 
286
  $setOrderAfterStatus = $paymentObj->_getConfigData('order_status_after_payment')
287
+ ? $paymentObj->_getConfigData('order_status_after_payment')
288
+ : Mage_Sales_Model_Order::STATE_PROCESSING; // If after status is empty set default status
289
  if ($paymentObj->getCode() == Novalnet_Payment_Model_Config::NN_PAYPAL && $response['status']
290
+ == Novalnet_Payment_Model_Config::PAYPAL_PENDING_CODE) {
291
  $setOrderAfterStatus = $paymentObj->_getConfigData('order_status')
292
+ ? $paymentObj->_getConfigData('order_status') : Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
293
  }
294
  $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, $setOrderAfterStatus, $helper->__('Customer successfully returned from Novalnet'), true
295
  )->save();
307
 
308
  $dataObj = new Varien_Object($response);
309
  $paymentObj->doNovalnetPostbackCall($dataObj); //Do Second Call
310
+ $statusText = ($response['status_text']) ? $response['status_text']
311
+ : $helper->__('successful');
312
+ $helper->getCoresession()->addSuccess($statusText);
313
  $order->save();
 
 
 
 
 
314
  $amount = is_numeric($response['amount']) ? $response['amount'] : $helper->getDecodedParam($response['amount'], $authorizeKey);
315
+ // Save the Transaction status
316
+ $this->doTransactionStatusSave($response, $getAdminTransaction,$amount, $paymentObj->getCode());
317
  }
318
 
319
  /**
321
  *
322
  * @return Mage_Checkout_Model_Session
323
  */
324
+ private function _getCheckout()
325
  {
326
  return Mage::getSingleton('checkout/session');
327
  }
346
  return Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->getLastRealOrderId());
347
  }
348
 
349
+ /**
350
+ * Get Current payment method instance
351
+ *
352
+ * @return payment method instance
353
+ */
354
+ private function _getPaymentObject()
355
+ {
356
+ return $this->_getOrder()->getPayment()->getMethodInstance();
357
+ }
358
+
359
+ /**
360
+ * Log Novalnet transaction status data
361
+ *
362
+ * @param array $response
363
+ * @param varien_object $transactionStatus
364
+ * @param int $amount
365
+ * @param string $paymentCode
366
+ */
367
+ public function doTransactionStatusSave($response, $transactionStatus,$amount, $paymentCode)
368
+ {
369
+ $helper = $this->_getNovalnetHelper();
370
+ $ncNo = (isset($response['nc_no'])) ? $response['nc_no'] : NULL;
371
+ Mage::getModel('novalnet_payment/transactionstatus')->setTransactionNo($response['tid'])
372
+ ->setOrderId($response['order_no'])
373
+ ->setTransactionStatus(trim($transactionStatus->getStatus())) //Novalnet Admin transaction status
374
+ ->setNcNo($ncNo) //nc number
375
+ ->setCustomerId($helper->getCustomerId())
376
+ ->setPaymentName($paymentCode)
377
+ ->setAmount($helper->getFormatedAmount($amount, 'RAW'))
378
+ ->setRemoteIp($helper->getRealIpAddr())
379
+ ->setStoreId($helper->getMagentoStoreId())
380
+ ->setShopUrl($helper->getCurrentSiteUrl())
381
+ ->setCreatedDate($helper->getCurrentDateTime())
382
+ ->save();
383
+ }
384
+
385
+ /**
386
+ * Log Novalnet payment response data
387
+ *
388
+ * @param array $response
389
+ */
390
+ public function doTransactionOrderLog($response)
391
+ {
392
+
393
+ $modNovalTransactionOverview = $this->_getNovalnetHelper()->getModelTransactionOverview()->loadByAttribute('order_id', $response['order_no']);
394
+ $helper = $this->_getNovalnetHelper();
395
+
396
+ $modNovalTransactionOverview->setTransactionId($response['tid'])
397
+ ->setResponseData(base64_encode(serialize($response)))
398
+ ->setCustomerId($helper->getCustomerId())
399
+ ->setStatus($response['status']) //transaction status code
400
+ ->setStoreId($helper->getMagentoStoreId())
401
+ ->setShopUrl($helper->getCurrentSiteUrl())
402
+ ->save();
403
+ }
404
+
405
+ /**
406
+ * Unset Novalnet session
407
+ *
408
+ * @param string $paymentCode
409
+ */
410
+ private function unsetNovalnetSessionData($paymentCode)
411
+ {
412
+ if ($paymentCode == Novalnet_Payment_Model_Config::NN_CC) {
413
+ $this->_getCheckout()->unsNnCcCvc();
414
+ }
415
+ }
416
+
417
+ /**
418
+ * Set payment status for Novalnet redirect payment methods
419
+ *
420
+ * @param varien_object $paymentObj
421
+ * @param array $response
422
+ * @param mixed $authorizeKey
423
+ * @return array
424
+ */
425
+ private function responseStatus($authorizeKey,$response,$paymentObj)
426
+ {
427
+ if ($response['status'] == Novalnet_Payment_Model_Config::RESPONSE_CODE_APPROVED
428
+ && $paymentObj->getCode() != Novalnet_Payment_Model_Config::NN_CC) {
429
+ $response['status'] = $this->_getNovalnetHelper()->checkParams($response, $authorizeKey);
430
+ }
431
+ return $response;
432
+ }
433
+
434
+ /**
435
+ * Set Novalnet payment mode (test/live)
436
+ *
437
+ * @param varien_object $paymentObj
438
+ * @param array $response
439
+ * @param mixed $authorizeKey
440
+ * @return int
441
+ */
442
+ private function setNovalnetMode($paymentObj,$response,$authorizeKey)
443
+ {
444
+ $serverResponse = ($paymentObj->getCode() != Novalnet_Payment_Model_Config::NN_CC)
445
+ ? $this->_getNovalnetHelper()->getDecodedParam($response['test_mode'], $authorizeKey)
446
+ : $response['test_mode'];
447
+ $shopMode = $paymentObj->_getConfigData('live_mode');
448
+ $testMode = (((isset($serverResponse) && $serverResponse == 1) || (isset($shopMode)
449
+ && $shopMode == 0)) ? 1 : 0 );
450
+ return $testMode;
451
+ }
452
  }
app/code/community/Novalnet/Payment/etc/adminhtml.xml CHANGED
@@ -1,4 +1,4 @@
1
- <?xml version="1.0"?>
2
  <!--
3
  /**
4
  * Magento
@@ -13,7 +13,7 @@
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
- * Part of the payment modulee of Novalnet AG
17
  * https://www.novalnet.de
18
  * If you have found this script useful a small
19
  * recommendation as well as a comment on merchant form
@@ -33,59 +33,76 @@
33
  <children>
34
  <sales_order module="novalnet_payment">
35
  <title>Orders</title>
36
- <sort_order>10</sort_order>
37
  <action>novalnet_payment/adminhtml_sales_order</action>
38
  </sales_order>
 
 
 
 
 
39
  <transaction module="novalnet_payment">
40
  <title>Novalnet Transactions</title>
41
- <sort_order>20</sort_order>
42
  <children>
43
  <transactionStatus module="novalnet_payment">
44
  <title>Novalnet Transactions Overview</title>
45
- <sort_order>10</sort_order>
46
  <action>novalnet_payment/adminhtml_transaction</action>
47
  </transactionStatus>
48
  <transactionOverivew module="novalnet_payment">
49
  <title>Novalnet Transactions Log</title>
50
- <sort_order>20</sort_order>
51
  <action>novalnet_payment/adminhtml_transactionoverview</action>
52
  </transactionOverivew>
53
  </children>
54
  </transaction>
 
 
 
 
 
 
 
 
 
 
55
  <configuration module="novalnet_payment">
56
  <title>Configuration</title>
57
- <sort_order>40</sort_order>
58
  <children>
59
  <general module="novalnet_payment">
60
  <title>General</title>
61
- <sort_order>10</sort_order>
62
  <action>adminhtml/system_config/edit/section/novalnet_global/</action>
63
  </general>
64
  <payment module="novalnet_payment">
65
  <title>Payment Methods</title>
66
- <sort_order>20</sort_order>
67
  <action>adminhtml/system_config/edit/section/novalnet_paymethods/</action>
68
  </payment>
69
  </children>
70
  </configuration>
71
- <fraud_prevention module="novalnet_payment">
72
- <title>Risk and Control</title>
73
- <sort_order>30</sort_order>
74
- <action>adminhtml/system_config/edit/section/fraud_prevent/</action>
75
- </fraud_prevention>
76
- <configuration_wizard module="novalnet_payment">
77
- <title>Configuration-wizard</title>
78
- <sort_order>50</sort_order>
79
- <action>novalnet_payment/adminhtml_configuration_wizard_page</action>
80
- </configuration_wizard>
81
  <information module="novalnet_payment">
82
  <title>Information</title>
83
- <sort_order>60</sort_order>
84
- <action>novalnet_payment/adminhtml_information/</action>
 
 
 
 
 
 
 
 
 
 
 
85
  </information>
86
  </children>
87
  </novalnet>
88
  </menu>
 
89
  <acl>
90
  <resources>
91
  <admin>
@@ -96,16 +113,20 @@
96
  <children>
97
  <novalnet_global>
98
  <title>General</title>
99
- <sort_order>10</sort_order>
100
  </novalnet_global>
101
  <novalnet_paymethods>
102
  <title>Payment</title>
103
- <sort_order>20</sort_order>
104
  </novalnet_paymethods>
105
  <fraud_prevent>
106
  <title>Payment</title>
107
- <sort_order>20</sort_order>
108
  </fraud_prevent>
 
 
 
 
109
  </children>
110
  </config>
111
  </children>
@@ -116,47 +137,51 @@
116
  <children>
117
  <sales_order>
118
  <title>Orders</title>
119
- <sort_order>10</sort_order>
120
  </sales_order>
 
 
 
 
121
  <transaction module="novalnet_payment">
122
  <title>Novalnet Transactions</title>
123
- <sort_order>20</sort_order>
124
  <children>
125
  <transactionStatus module="novalnet_payment">
126
  <title>Novalnet Transactions Overview</title>
127
- <sort_order>10</sort_order>
128
  </transactionStatus>
129
  <transactionOverivew module="novalnet_payment">
130
  <title>Novalnet Transactions Log</title>
131
- <sort_order>20</sort_order>
132
  </transactionOverivew>
133
  </children>
134
  </transaction>
 
 
 
 
 
 
 
 
135
  <configuration module="novalnet_payment">
136
  <title>Configuration</title>
137
- <sort_order>40</sort_order>
138
  <children>
139
  <general module="novalnet_payment">
140
  <title>General</title>
141
- <sort_order>10</sort_order>
142
  </general>
143
  <payment module="novalnet_payment">
144
  <title>Payment Methods</title>
145
- <sort_order>20</sort_order>
146
  </payment>
147
  </children>
148
  </configuration>
149
- <fraud_prevention module="novalnet_payment">
150
- <title>Risk and Control</title>
151
- <sort_order>30</sort_order>
152
- </fraud_prevention>
153
- <configuration_wizard module="novalnet_payment">
154
- <title>Configuration-wizard</title>
155
- <sort_order>50</sort_order>
156
- </configuration_wizard>
157
  <information module="novalnet_payment">
158
  <title>Information</title>
159
- <sort_order>60</sort_order>
160
  </information>
161
  </children>
162
  </novalnet>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
  * Magento
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
+ * Part of the payment module of Novalnet AG
17
  * https://www.novalnet.de
18
  * If you have found this script useful a small
19
  * recommendation as well as a comment on merchant form
33
  <children>
34
  <sales_order module="novalnet_payment">
35
  <title>Orders</title>
36
+ <sort_order>1</sort_order>
37
  <action>novalnet_payment/adminhtml_sales_order</action>
38
  </sales_order>
39
+ <sales_recurring module="novalnet_payment">
40
+ <title>Recurring Profiles</title>
41
+ <sort_order>2</sort_order>
42
+ <action>novalnet_payment/adminhtml_sales_recurring_profile</action>
43
+ </sales_recurring>
44
  <transaction module="novalnet_payment">
45
  <title>Novalnet Transactions</title>
46
+ <sort_order>3</sort_order>
47
  <children>
48
  <transactionStatus module="novalnet_payment">
49
  <title>Novalnet Transactions Overview</title>
50
+ <sort_order>1</sort_order>
51
  <action>novalnet_payment/adminhtml_transaction</action>
52
  </transactionStatus>
53
  <transactionOverivew module="novalnet_payment">
54
  <title>Novalnet Transactions Log</title>
55
+ <sort_order>2</sort_order>
56
  <action>novalnet_payment/adminhtml_transactionoverview</action>
57
  </transactionOverivew>
58
  </children>
59
  </transaction>
60
+ <fraud_prevention module="novalnet_payment">
61
+ <title>Risk and Control</title>
62
+ <sort_order>4</sort_order>
63
+ <action>adminhtml/system_config/edit/section/fraud_prevent/</action>
64
+ </fraud_prevention>
65
+ <configuration_wizard module="novalnet_payment">
66
+ <title>Configuration-wizard</title>
67
+ <sort_order>5</sort_order>
68
+ <action>novalnet_payment/adminhtml_configuration_wizard_page</action>
69
+ </configuration_wizard>
70
  <configuration module="novalnet_payment">
71
  <title>Configuration</title>
72
+ <sort_order>6</sort_order>
73
  <children>
74
  <general module="novalnet_payment">
75
  <title>General</title>
76
+ <sort_order>1</sort_order>
77
  <action>adminhtml/system_config/edit/section/novalnet_global/</action>
78
  </general>
79
  <payment module="novalnet_payment">
80
  <title>Payment Methods</title>
81
+ <sort_order>2</sort_order>
82
  <action>adminhtml/system_config/edit/section/novalnet_paymethods/</action>
83
  </payment>
84
  </children>
85
  </configuration>
 
 
 
 
 
 
 
 
 
 
86
  <information module="novalnet_payment">
87
  <title>Information</title>
88
+ <sort_order>7</sort_order>
89
+ <children>
90
+ <novalnetmerchantadmin module="novalnet_payment">
91
+ <title>Novalnet Merchant Admin</title>
92
+ <sort_order>1</sort_order>
93
+ <action>novalnet_payment/adminhtml_information_novalnetmerchantadmin/</action>
94
+ </novalnetmerchantadmin>
95
+ <information module="novalnet_payment">
96
+ <title>Novalnet Magento Module</title>
97
+ <sort_order>2</sort_order>
98
+ <action>novalnet_payment/adminhtml_information_module/</action>
99
+ </information>
100
+ </children>
101
  </information>
102
  </children>
103
  </novalnet>
104
  </menu>
105
+ <!-- Access control-->
106
  <acl>
107
  <resources>
108
  <admin>
113
  <children>
114
  <novalnet_global>
115
  <title>General</title>
116
+ <sort_order>1</sort_order>
117
  </novalnet_global>
118
  <novalnet_paymethods>
119
  <title>Payment</title>
120
+ <sort_order>2</sort_order>
121
  </novalnet_paymethods>
122
  <fraud_prevent>
123
  <title>Payment</title>
124
+ <sort_order>3</sort_order>
125
  </fraud_prevent>
126
+ <callback_script>
127
+ <title>Payment</title>
128
+ <sort_order>4</sort_order>
129
+ </callback_script>
130
  </children>
131
  </config>
132
  </children>
137
  <children>
138
  <sales_order>
139
  <title>Orders</title>
140
+ <sort_order>1</sort_order>
141
  </sales_order>
142
+ <sales_recurring>
143
+ <title>Recurring Profiles</title>
144
+ <sort_order>2</sort_order>
145
+ </sales_recurring>
146
  <transaction module="novalnet_payment">
147
  <title>Novalnet Transactions</title>
148
+ <sort_order>3</sort_order>
149
  <children>
150
  <transactionStatus module="novalnet_payment">
151
  <title>Novalnet Transactions Overview</title>
152
+ <sort_order>1</sort_order>
153
  </transactionStatus>
154
  <transactionOverivew module="novalnet_payment">
155
  <title>Novalnet Transactions Log</title>
156
+ <sort_order>2</sort_order>
157
  </transactionOverivew>
158
  </children>
159
  </transaction>
160
+ <fraud_prevention module="novalnet_payment">
161
+ <title>Risk and Control</title>
162
+ <sort_order>4</sort_order>
163
+ </fraud_prevention>
164
+ <configuration_wizard module="novalnet_payment">
165
+ <title>Configuration-wizard</title>
166
+ <sort_order>5</sort_order>
167
+ </configuration_wizard>
168
  <configuration module="novalnet_payment">
169
  <title>Configuration</title>
170
+ <sort_order>6</sort_order>
171
  <children>
172
  <general module="novalnet_payment">
173
  <title>General</title>
174
+ <sort_order>1</sort_order>
175
  </general>
176
  <payment module="novalnet_payment">
177
  <title>Payment Methods</title>
178
+ <sort_order>2</sort_order>
179
  </payment>
180
  </children>
181
  </configuration>
 
 
 
 
 
 
 
 
182
  <information module="novalnet_payment">
183
  <title>Information</title>
184
+ <sort_order>7</sort_order>
185
  </information>
186
  </children>
187
  </novalnet>
app/code/community/Novalnet/Payment/etc/config.xml CHANGED
@@ -13,7 +13,7 @@
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
- * Part of the payment modulee of Novalnet AG
17
  * https://www.novalnet.de
18
  * If you have found this script useful a small
19
  * recommendation as well as a comment on merchant form
@@ -29,7 +29,7 @@
29
  <modules>
30
  <Novalnet_Payment>
31
  <!-- declare module's version information for database updates -->
32
- <version>5.0.4</version>
33
  </Novalnet_Payment>
34
  </modules>
35
 
@@ -51,37 +51,27 @@
51
  <rewrite>
52
  <sales_order_view>Novalnet_Payment_Block_Adminhtml_Sales_Order_View</sales_order_view>
53
  <sales_order_invoice_view>Novalnet_Payment_Block_Adminhtml_Sales_Order_Invoice_View</sales_order_invoice_view>
 
 
 
 
54
  </rewrite>
55
  </adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  </blocks>
57
- <events>
58
- <sales_order_invoice_pay>
59
- <observers>
60
- <novalnet_payment_order_observer_invoice_send_email>
61
- <type>singleton</type>
62
- <class>Novalnet_Payment_Model_Observer</class>
63
- <method>sendInvoiceEmail</method>
64
- </novalnet_payment_order_observer_invoice_send_email>
65
- </observers>
66
- </sales_order_invoice_pay>
67
- <sales_order_creditmemo_refund>
68
- <observers>
69
- <novalnet_payment_order_observer_creditmemo_send_email>
70
- <type>singleton</type>
71
- <class>Novalnet_Payment_Model_Observer</class>
72
- <method>sendCreditmemoEmail</method>
73
- </novalnet_payment_order_observer_creditmemo_send_email>
74
- </observers>
75
- </sales_order_creditmemo_refund>
76
- <core_block_abstract_prepare_layout_before>
77
- <observers>
78
- <novalnet_payment_prepare_layout_before>
79
- <class>Novalnet_Payment_Model_Observer</class>
80
- <method>prepareLayoutBefore</method>
81
- </novalnet_payment_prepare_layout_before>
82
- </observers>
83
- </core_block_abstract_prepare_layout_before>
84
- </events>
85
 
86
  <!-- declare model group for new module -->
87
  <models>
@@ -90,6 +80,17 @@
90
  <sales_order_create>Novalnet_Payment_Model_Adminhtml_Sales_Order_Create</sales_order_create>
91
  </rewrite>
92
  </adminhtml>
 
 
 
 
 
 
 
 
 
 
 
93
  <novalnet_payment>
94
  <!-- base class name for the model group -->
95
  <class>Novalnet_Payment_Model</class>
@@ -110,6 +111,15 @@
110
  <callback>
111
  <table>novalnet_payment_callback</table>
112
  </callback>
 
 
 
 
 
 
 
 
 
113
  <aff_account_detail>
114
  <table>novalnet_payment_aff_account_detail</table>
115
  </aff_account_detail>
@@ -120,7 +130,7 @@
120
  </novalnet_resource>
121
  </models>
122
 
123
- <!-- convert novalnet field values from quote to order to make it available in orderobject -->
124
  <fieldsets>
125
  <sales_convert_quote_payment>
126
  <nn_testorder>
@@ -149,7 +159,7 @@
149
  <resources>
150
  <!-- resource identifier -->
151
  <novalnet_setup>
152
- <!-- specify that this resource is a setup resource and used for upgrades -->
153
  <setup>
154
  <!-- which module to look for install/upgrade files in -->
155
  <module>Novalnet_Payment</module>
@@ -182,6 +192,59 @@
182
  <novalnet>Novalnet</novalnet>
183
  </groups>
184
  </payment>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  </global>
186
 
187
  <adminhtml>
@@ -194,11 +257,11 @@
194
  </layout>
195
  <translate>
196
  <modules>
197
- <Novalnet_Payment>
198
  <files>
199
  <default>Novalnet_Payment.csv</default>
200
  </files>
201
- </Novalnet_Payment>
202
  </modules>
203
  </translate>
204
  </adminhtml>
@@ -215,11 +278,11 @@
215
  </routers>
216
  <translate>
217
  <modules>
218
- <Novalnet_Payment>
219
  <files>
220
  <default>Novalnet_Payment.csv</default>
221
  </files>
222
- </Novalnet_Payment>
223
  </modules>
224
  </translate>
225
  <layout>
@@ -229,17 +292,6 @@
229
  </novalnet>
230
  </updates>
231
  </layout>
232
- <events>
233
- <customer_logout>
234
- <observers>
235
- <novalnet>
236
- <type>singleton</type>
237
- <class>Novalnet_Payment_Model_Observer</class>
238
- <method>customerLogin</method>
239
- </novalnet>
240
- </observers>
241
- </customer_logout>
242
- </events>
243
  </frontend>
244
 
245
  <admin>
@@ -262,6 +314,11 @@
262
  </admin>
263
 
264
  <default>
 
 
 
 
 
265
  <!-- 'payment' configuration section (tab) -->
266
  <payment>
267
  <!-- 'module' configuration group (fieldset) -->
@@ -273,7 +330,6 @@
273
  <!-- default title for payment checkout page and order view page -->
274
  <title>Novalnet Kauf auf Rechnung</title>
275
  <allowspecific>0</allowspecific>
276
- <gateway_timeout>240</gateway_timeout>
277
  <group>novalnet</group>
278
  </novalnetInvoice>
279
  <novalnetPrepayment translate="title" module="novalnet_payment">
@@ -281,23 +337,38 @@
281
  <model>novalnet_payment/payment_method_novalnetPrepayment</model>
282
  <title>Novalnet Vorauskasse</title>
283
  <allowspecific>0</allowspecific>
284
- <gateway_timeout>240</gateway_timeout>
285
  <group>novalnet</group>
286
  </novalnetPrepayment>
287
- <novalnetSofortueberweisung translate="title" module="novalnet_payment">
 
 
 
 
 
 
 
 
 
 
288
  <active>0</active>
289
- <model>novalnet_payment/payment_method_novalnetSofortueberweisung</model>
290
- <title>Novalnet Sofortuberweisung</title>
291
  <allowspecific>0</allowspecific>
292
- <gateway_timeout>240</gateway_timeout>
293
  <group>novalnet</group>
294
- </novalnetSofortueberweisung>
 
 
 
 
 
 
 
295
  <novalnetPaypal translate="title" module="novalnet_payment">
296
  <active>0</active>
297
  <model>novalnet_payment/payment_method_novalnetPaypal</model>
298
  <title>Novalnet PayPal</title>
299
  <allowspecific>0</allowspecific>
300
- <gateway_timeout>240</gateway_timeout>
301
  <group>novalnet</group>
302
  </novalnetPaypal>
303
  <novalnetIdeal translate="title" module="novalnet_payment">
@@ -305,26 +376,15 @@
305
  <model>novalnet_payment/payment_method_novalnetIdeal</model>
306
  <title>Novalnet iDEAL</title>
307
  <allowspecific>0</allowspecific>
308
- <gateway_timeout>240</gateway_timeout>
309
  <group>novalnet</group>
310
  </novalnetIdeal>
311
- <novalnetCc translate="title" module="novalnet_payment">
312
  <active>0</active>
313
- <cctypes>VI,MC</cctypes>
314
- <model>novalnet_payment/payment_method_novalnetCc</model>
315
  <allowspecific>0</allowspecific>
316
- <title>Novalnet Kreditkarte</title>
317
- <gateway_timeout>240</gateway_timeout>
318
  <group>novalnet</group>
319
- </novalnetCc>
320
- <novalnetSepa translate="title" module="novalnet_payment">
321
- <active>0</active>
322
- <model>novalnet_payment/payment_method_novalnetSepa</model>
323
- <allowspecific>0</allowspecific>
324
- <title>Novalnet Lastschrift SEPA</title>
325
- <gateway_timeout>240</gateway_timeout>
326
- <group>novalnet</group>
327
- </novalnetSepa>
328
  </payment>
329
  </default>
330
  </config>
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
+ * Part of the payment module of Novalnet AG
17
  * https://www.novalnet.de
18
  * If you have found this script useful a small
19
  * recommendation as well as a comment on merchant form
29
  <modules>
30
  <Novalnet_Payment>
31
  <!-- declare module's version information for database updates -->
32
+ <version>10.0.0</version>
33
  </Novalnet_Payment>
34
  </modules>
35
 
51
  <rewrite>
52
  <sales_order_view>Novalnet_Payment_Block_Adminhtml_Sales_Order_View</sales_order_view>
53
  <sales_order_invoice_view>Novalnet_Payment_Block_Adminhtml_Sales_Order_Invoice_View</sales_order_invoice_view>
54
+ <sales_order_totals>Novalnet_Payment_Block_Adminhtml_Sales_Order_Totals</sales_order_totals>
55
+ <sales_order_invoice_totals>Novalnet_Payment_Block_Adminhtml_Sales_Order_Invoice_Totals</sales_order_invoice_totals>
56
+ <sales_order_view_tab_invoices>Novalnet_Payment_Block_Adminhtml_Sales_Order_View_Tab_Invoices</sales_order_view_tab_invoices>
57
+ <sales_order_creditmemo_totals>Novalnet_Payment_Block_Adminhtml_Sales_Order_Creditmemo_Totals</sales_order_creditmemo_totals>
58
  </rewrite>
59
  </adminhtml>
60
+ <sales>
61
+ <rewrite>
62
+ <order_totals>Novalnet_Payment_Block_Sales_Order_Totals</order_totals>
63
+ <order_invoice_totals>Novalnet_Payment_Block_Sales_Order_Invoice_Totals</order_invoice_totals>
64
+ <order_creditmemo_totals>Novalnet_Payment_Block_Sales_Order_Creditmemo_Totals</order_creditmemo_totals>
65
+ <recurring_profile_view>Novalnet_Payment_Block_Sales_Recurring_Profile_View</recurring_profile_view>
66
+ <adminhtml_recurring_profile_view>Novalnet_Payment_Block_Sales_Adminhtml_Recurring_Profile_View</adminhtml_recurring_profile_view>
67
+ </rewrite>
68
+ </sales>
69
+ <checkout>
70
+ <rewrite>
71
+ <cart_item_renderer>Novalnet_Payment_Block_Cart_Item_Renderer</cart_item_renderer>
72
+ </rewrite>
73
+ </checkout>
74
  </blocks>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  <!-- declare model group for new module -->
77
  <models>
80
  <sales_order_create>Novalnet_Payment_Model_Adminhtml_Sales_Order_Create</sales_order_create>
81
  </rewrite>
82
  </adminhtml>
83
+ <sales>
84
+ <rewrite>
85
+ <order_invoice>Novalnet_Payment_Model_Sales_Order_Invoice</order_invoice>
86
+ <order_payment>Novalnet_Payment_Model_Sales_Order_Payment</order_payment>
87
+ <order_pdf_invoice>Novalnet_Payment_Model_Sales_Order_Pdf_Invoice</order_pdf_invoice>
88
+ <order_pdf_creditmemo>Novalnet_Payment_Model_Sales_Order_Pdf_Creditmemo</order_pdf_creditmemo>
89
+ <recurring_profile>Novalnet_Payment_Model_Recurring_Profile</recurring_profile>
90
+ <quote_address_total_nominal>Novalnet_Payment_Model_Quote_Address_Total_Nominal</quote_address_total_nominal>
91
+ </rewrite>
92
+ </sales>
93
+
94
  <novalnet_payment>
95
  <!-- base class name for the model group -->
96
  <class>Novalnet_Payment_Model</class>
111
  <callback>
112
  <table>novalnet_payment_callback</table>
113
  </callback>
114
+ <separefill>
115
+ <table>novalnet_payment_separefill</table>
116
+ </separefill>
117
+ <amountchanged>
118
+ <table>novalnet_payment_amountchanged</table>
119
+ </amountchanged>
120
+ <recurring>
121
+ <table>novalnet_payment_recurring</table>
122
+ </recurring>
123
  <aff_account_detail>
124
  <table>novalnet_payment_aff_account_detail</table>
125
  </aff_account_detail>
130
  </novalnet_resource>
131
  </models>
132
 
133
+ <!-- convert Novalnet field values from quote to order, make it available in orderobject -->
134
  <fieldsets>
135
  <sales_convert_quote_payment>
136
  <nn_testorder>
159
  <resources>
160
  <!-- resource identifier -->
161
  <novalnet_setup>
162
+ <!-- this resource is a setup resource and used for upgrades -->
163
  <setup>
164
  <!-- which module to look for install/upgrade files in -->
165
  <module>Novalnet_Payment</module>
192
  <novalnet>Novalnet</novalnet>
193
  </groups>
194
  </payment>
195
+ <sales>
196
+ <order_creditmemo>
197
+ <totals>
198
+ <novalnet_payment>
199
+ <class>novalnet_payment/sales_creditmemo_total</class>
200
+ <after>subtotal,discount,shipping</after>
201
+ <before>tax,grand_total</before>
202
+ </novalnet_payment>
203
+ <novalnet_payment_tax>
204
+ <class>novalnet_payment/sales_creditmemo_tax</class>
205
+ <after>subtotal,discount,shipping,tax</after>
206
+ <before>grand_total</before>
207
+ </novalnet_payment_tax>
208
+ </totals>
209
+ </order_creditmemo>
210
+ </sales>
211
+ <events>
212
+ <core_block_abstract_prepare_layout_before>
213
+ <observers>
214
+ <novalnet_payment_prepare_layout_before>
215
+ <class>Novalnet_Payment_Model_Observer</class>
216
+ <method>prepareLayoutBefore</method>
217
+ </novalnet_payment_prepare_layout_before>
218
+ </observers>
219
+ </core_block_abstract_prepare_layout_before>
220
+ <customer_logout>
221
+ <observers>
222
+ <novalnet>
223
+ <type>singleton</type>
224
+ <class>Novalnet_Payment_Model_Observer</class>
225
+ <method>customerLogin</method>
226
+ </novalnet>
227
+ </observers>
228
+ </customer_logout>
229
+ <sales_order_invoice_pay>
230
+ <observers>
231
+ <novalnet_payment_order_observer_invoice_send_email>
232
+ <type>singleton</type>
233
+ <class>Novalnet_Payment_Model_Observer</class>
234
+ <method>sendInvoiceEmail</method>
235
+ </novalnet_payment_order_observer_invoice_send_email>
236
+ </observers>
237
+ </sales_order_invoice_pay>
238
+ <sales_order_creditmemo_refund>
239
+ <observers>
240
+ <novalnet_payment_order_observer_creditmemo_send_email>
241
+ <type>singleton</type>
242
+ <class>Novalnet_Payment_Model_Observer</class>
243
+ <method>sendCreditmemoEmail</method>
244
+ </novalnet_payment_order_observer_creditmemo_send_email>
245
+ </observers>
246
+ </sales_order_creditmemo_refund>
247
+ </events>
248
  </global>
249
 
250
  <adminhtml>
257
  </layout>
258
  <translate>
259
  <modules>
260
+ <novalnet_Payment>
261
  <files>
262
  <default>Novalnet_Payment.csv</default>
263
  </files>
264
+ </novalnet_Payment>
265
  </modules>
266
  </translate>
267
  </adminhtml>
278
  </routers>
279
  <translate>
280
  <modules>
281
+ <novalnet_Payment>
282
  <files>
283
  <default>Novalnet_Payment.csv</default>
284
  </files>
285
+ </novalnet_Payment>
286
  </modules>
287
  </translate>
288
  <layout>
292
  </novalnet>
293
  </updates>
294
  </layout>
 
 
 
 
 
 
 
 
 
 
 
295
  </frontend>
296
 
297
  <admin>
314
  </admin>
315
 
316
  <default>
317
+ <novalnet_global>
318
+ <novalnet>
319
+ <gateway_timeout>240</gateway_timeout>
320
+ </novalnet>
321
+ </novalnet_global>
322
  <!-- 'payment' configuration section (tab) -->
323
  <payment>
324
  <!-- 'module' configuration group (fieldset) -->
330
  <!-- default title for payment checkout page and order view page -->
331
  <title>Novalnet Kauf auf Rechnung</title>
332
  <allowspecific>0</allowspecific>
 
333
  <group>novalnet</group>
334
  </novalnetInvoice>
335
  <novalnetPrepayment translate="title" module="novalnet_payment">
337
  <model>novalnet_payment/payment_method_novalnetPrepayment</model>
338
  <title>Novalnet Vorauskasse</title>
339
  <allowspecific>0</allowspecific>
 
340
  <group>novalnet</group>
341
  </novalnetPrepayment>
342
+ <novalnetCc translate="title" module="novalnet_payment">
343
+ <cctypes>VI,MC</cctypes>
344
+ <active>0</active>
345
+ <cc_refill>0</cc_refill>
346
+ <cc_valid_year>25</cc_valid_year>
347
+ <model>novalnet_payment/payment_method_novalnetCc</model>
348
+ <title>Novalnet Kreditkarte</title>
349
+ <allowspecific>0</allowspecific>
350
+ <group>novalnet</group>
351
+ </novalnetCc>
352
+ <novalnetSepa translate="title" module="novalnet_payment">
353
  <active>0</active>
354
+ <sepa_refill>0</sepa_refill>
355
+ <model>novalnet_payment/payment_method_novalnetSepa</model>
356
  <allowspecific>0</allowspecific>
357
+ <title>Novalnet Lastschrift SEPA</title>
358
  <group>novalnet</group>
359
+ </novalnetSepa>
360
+ <novalnetBanktransfer translate="title" module="novalnet_payment">
361
+ <active>0</active>
362
+ <model>novalnet_payment/payment_method_novalnetBanktransfer</model>
363
+ <title>Novalnet Sofortüberweisung</title>
364
+ <allowspecific>0</allowspecific>
365
+ <group>novalnet</group>
366
+ </novalnetBanktransfer>
367
  <novalnetPaypal translate="title" module="novalnet_payment">
368
  <active>0</active>
369
  <model>novalnet_payment/payment_method_novalnetPaypal</model>
370
  <title>Novalnet PayPal</title>
371
  <allowspecific>0</allowspecific>
 
372
  <group>novalnet</group>
373
  </novalnetPaypal>
374
  <novalnetIdeal translate="title" module="novalnet_payment">
376
  <model>novalnet_payment/payment_method_novalnetIdeal</model>
377
  <title>Novalnet iDEAL</title>
378
  <allowspecific>0</allowspecific>
 
379
  <group>novalnet</group>
380
  </novalnetIdeal>
381
+ <novalnetEps translate="title" module="novalnet_payment">
382
  <active>0</active>
383
+ <model>novalnet_payment/payment_method_novalnetEps</model>
384
+ <title>Novalnet Eps</title>
385
  <allowspecific>0</allowspecific>
 
 
386
  <group>novalnet</group>
387
+ </novalnetEps>
 
 
 
 
 
 
 
 
388
  </payment>
389
  </default>
390
  </config>
app/code/community/Novalnet/Payment/etc/system.xml CHANGED
@@ -13,7 +13,7 @@
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
- * Part of the payment modulee of Novalnet AG
17
  * https://www.novalnet.de
18
  * If you have found this script useful a small
19
  * recommendation as well as a comment on merchant form
@@ -40,127 +40,250 @@
40
  <label>General</label>
41
  <tab>novalnet</tab>
42
  <frontend_type>text</frontend_type>
43
- <sort_order>20</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
47
  <groups>
48
  <novalnet translate="label" module="novalnet_payment">
49
- <label>Novalnet Payment</label>
50
  <frontend_type>text</frontend_type>
51
- <sort_order>10</sort_order>
52
  <show_in_default>1</show_in_default>
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>1</show_in_store>
55
  <fields>
56
  <merchant_id translate="label">
57
  <label>Novalnet Merchant ID</label>
58
- <comment>Enter your Novalnet Merchant ID</comment>
59
  <frontend_type>text</frontend_type>
60
  <validate>required-entry validate-digits</validate>
61
- <sort_order>10</sort_order>
62
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  </merchant_id>
66
  <auth_code translate="label">
67
- <label>Novalnet Auth Code</label>
68
- <comment>Enter your Novalnet Merchant Authorisation code</comment>
69
  <frontend_type>text</frontend_type>
 
70
  <validate>required-entry</validate>
71
- <sort_order>20</sort_order>
72
  <show_in_default>1</show_in_default>
73
  <show_in_website>1</show_in_website>
74
  <show_in_store>1</show_in_store>
75
  </auth_code>
76
  <product_id translate="label">
77
- <label>Novalnet Product ID</label>
78
- <comment>Enter your Novalnet Product ID</comment>
79
  <frontend_type>text</frontend_type>
 
80
  <validate>required-entry validate-digits</validate>
81
- <sort_order>30</sort_order>
82
  <show_in_default>1</show_in_default>
83
  <show_in_website>1</show_in_website>
84
  <show_in_store>1</show_in_store>
85
  </product_id>
86
  <tariff_id translate="label">
87
- <label>Novalnet Tariff ID</label>
88
- <comment>Enter your Novalnet Tariff ID</comment>
89
  <frontend_type>text</frontend_type>
 
90
  <validate>required-entry validate-digits</validate>
91
- <sort_order>40</sort_order>
92
  <show_in_default>1</show_in_default>
93
  <show_in_website>1</show_in_website>
94
  <show_in_store>1</show_in_store>
95
  </tariff_id>
 
 
 
 
 
 
 
 
 
96
  <password translate="label">
97
- <label>Novalnet Password</label>
98
- <comment>Enter your Novalnet Password</comment>
99
  <frontend_type>text</frontend_type>
100
- <sort_order>50</sort_order>
101
  <show_in_default>1</show_in_default>
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>1</show_in_store>
104
  </password>
 
 
 
 
 
 
 
 
 
 
105
  <live_mode translate="label">
106
  <label>Novalnet Live Mode</label>
107
  <comment>Selected payment methods will be in Live Mode</comment>
108
  <frontend_type>multiselect</frontend_type>
109
  <source_model>novalnet_payment/system_config_activemethods</source_model>
110
  <can_be_empty>1</can_be_empty>
111
- <sort_order>60</sort_order>
112
  <show_in_default>1</show_in_default>
113
  <show_in_website>1</show_in_website>
114
  <show_in_store>1</show_in_store>
115
  </live_mode>
116
- <api_user translate="label">
117
- <label>PAYPAL API User Name</label>
118
- <comment>Please enter your PayPal API username</comment>
119
  <frontend_type>text</frontend_type>
120
- <sort_order>70</sort_order>
 
121
  <show_in_default>1</show_in_default>
122
  <show_in_website>1</show_in_website>
123
  <show_in_store>1</show_in_store>
124
- </api_user>
125
- <api_password translate="label">
126
- <label>PAYPAL API Password</label>
127
- <comment>Please enter your PayPal API password</comment>
128
- <frontend_type>text</frontend_type>
129
- <sort_order>80</sort_order>
 
130
  <show_in_default>1</show_in_default>
131
  <show_in_website>1</show_in_website>
132
  <show_in_store>1</show_in_store>
133
- </api_password>
134
- <api_sign translate="label">
135
- <label>PAYPAL API Signature</label>
136
- <comment>Please enter your PayPal API signature</comment>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  <frontend_type>text</frontend_type>
138
- <sort_order>90</sort_order>
 
 
 
 
 
 
 
 
 
 
139
  <show_in_default>1</show_in_default>
140
  <show_in_website>1</show_in_website>
141
  <show_in_store>1</show_in_store>
142
- </api_sign>
143
- <referrer_id translate="label">
144
- <label>Referrer ID</label>
145
- <comment>Referrer ID Desc</comment>
146
- <validate>validate-digits</validate>
 
 
 
 
 
 
 
 
147
  <frontend_type>text</frontend_type>
148
- <sort_order>100</sort_order>
 
149
  <show_in_default>1</show_in_default>
150
  <show_in_website>1</show_in_website>
151
  <show_in_store>1</show_in_store>
152
- </referrer_id>
153
  </fields>
154
  </novalnet>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  </groups>
156
  </novalnet_global>
157
  <!--}}} Global tab-->
158
- <!-- Novalnet paymethods -->
159
  <novalnet_paymethods translate="label" module="novalnet_payment">
160
  <label>Payment Methods</label>
161
  <tab>novalnet</tab>
162
  <frontend_type>text</frontend_type>
163
- <sort_order>30</sort_order>
164
  <show_in_default>1</show_in_default>
165
  <show_in_website>1</show_in_website>
166
  <show_in_store>1</show_in_store>
@@ -168,13 +291,13 @@
168
  <!--{{{ Novalnet Credit Card-->
169
  <novalnetCc translate="label" module="novalnet_payment">
170
  <label>Novalnet Credit Card</label>
171
- <sort_order>680</sort_order>
172
  <show_in_default>1</show_in_default>
173
  <show_in_website>1</show_in_website>
174
  <show_in_store>1</show_in_store>
175
  <fields>
176
  <active translate="label">
177
- <label>Enable Novalnet Module</label>
178
  <frontend_type>select</frontend_type>
179
  <source_model>adminhtml/system_config_source_yesno</source_model>
180
  <config_path>payment/novalnetCc/active</config_path>
@@ -184,7 +307,7 @@
184
  <show_in_store>1</show_in_store>
185
  </active>
186
  <title translate="label">
187
- <label>Novalnet Title</label>
188
  <frontend_type>text</frontend_type>
189
  <config_path>payment/novalnetCc/title</config_path>
190
  <validate>required-entry</validate>
@@ -193,12 +316,23 @@
193
  <show_in_website>1</show_in_website>
194
  <show_in_store>1</show_in_store>
195
  </title>
 
 
 
 
 
 
 
 
 
 
 
196
  <order_status translate="label">
197
- <label>Order Completion Status</label>
198
  <frontend_type>select</frontend_type>
199
  <config_path>payment/novalnetCc/order_status</config_path>
200
  <source_model>adminhtml/system_config_source_order_status</source_model>
201
- <sort_order>3</sort_order>
202
  <show_in_default>1</show_in_default>
203
  <show_in_website>1</show_in_website>
204
  <show_in_store>1</show_in_store>
@@ -207,11 +341,11 @@
207
  </depends>
208
  </order_status>
209
  <order_status_before_payment translate="label">
210
- <label>Order Status Before Payment</label>
211
  <frontend_type>select</frontend_type>
212
  <config_path>payment/novalnetCc/order_status</config_path>
213
  <source_model>adminhtml/system_config_source_order_status</source_model>
214
- <sort_order>3</sort_order>
215
  <show_in_default>1</show_in_default>
216
  <show_in_website>1</show_in_website>
217
  <show_in_store>1</show_in_store>
@@ -220,11 +354,11 @@
220
  </depends>
221
  </order_status_before_payment>
222
  <order_status_after_payment translate="label">
223
- <label>Order Status After Successful Payment</label>
224
  <frontend_type>select</frontend_type>
225
  <config_path>payment/novalnetCc/order_status_after_payment</config_path>
226
  <source_model>adminhtml/system_config_source_order_status</source_model>
227
- <sort_order>4</sort_order>
228
  <show_in_default>1</show_in_default>
229
  <show_in_website>1</show_in_website>
230
  <show_in_store>1</show_in_store>
@@ -236,121 +370,68 @@
236
  <label>Credit Card Types</label>
237
  <frontend_type>multiselect</frontend_type>
238
  <config_path>payment/novalnetCc/cctypes</config_path>
239
- <source_model>novalnet_payment/novalnet_source_cctypes</source_model>
240
- <sort_order>5</sort_order>
241
- <show_in_default>1</show_in_default>
242
- <show_in_website>1</show_in_website>
243
- <show_in_store>1</show_in_store>
244
- </cctypes>
245
- <active_cc3d translate="label">
246
- <label>Enable cc3d</label>
247
- <comment>cc3d description</comment>
248
- <frontend_type>select</frontend_type>
249
- <source_model>adminhtml/system_config_source_yesno</source_model>
250
- <config_path>payment/novalnetCc/active_cc3d</config_path>
251
- <sort_order>6</sort_order>
252
- <show_in_default>1</show_in_default>
253
- <show_in_website>1</show_in_website>
254
- <show_in_store>1</show_in_store>
255
- </active_cc3d>
256
- <manual_checking_amount tranlate="label" >
257
- <label>Manual checking of order</label>
258
- <comment>Manual checking of order Desc</comment>
259
- <frontend_type>text</frontend_type>
260
- <validate>validate-digits</validate>
261
- <config_path>payment/novalnetCc/manual_checking_amount</config_path>
262
  <sort_order>7</sort_order>
263
  <show_in_default>1</show_in_default>
264
  <show_in_website>1</show_in_website>
265
  <show_in_store>1</show_in_store>
266
- </manual_checking_amount>
267
- <second_product_id translate="label">
268
- <label>Second Product ID for manual check condition</label>
269
- <comment>Second Product ID in Novalnet to use the manual check condition</comment>
270
  <frontend_type>text</frontend_type>
271
- <validate>validate-digits</validate>
272
- <config_path>payment/novalnetCc/second_product_id</config_path>
273
  <sort_order>8</sort_order>
274
  <show_in_default>1</show_in_default>
275
  <show_in_website>1</show_in_website>
276
  <show_in_store>1</show_in_store>
277
- </second_product_id>
278
- <second_tariff_id translate="label">
279
- <label>Second Tariff ID for manual check condition</label>
280
- <comment>Second Tariff ID in Novalnet to use the manual check condition</comment>
281
- <frontend_type>text</frontend_type>
282
- <validate>validate-digits</validate>
283
- <config_path>payment/novalnetCc/second_tariff_id</config_path>
284
- <sort_order>9</sort_order>
285
- <show_in_default>1</show_in_default>
286
- <show_in_website>1</show_in_website>
287
- <show_in_store>1</show_in_store>
288
- </second_tariff_id>
289
- <cc_refill translate="label">
290
- <label>Auto refill the payment data entered in payment page</label>
291
- <comment>If yes, the entered payment data will be automatically refilled while error handling</comment>
292
- <frontend_type>select</frontend_type>
293
- <source_model>adminhtml/system_config_source_yesno</source_model>
294
- <config_path>payment/novalnetCc/cc_refill</config_path>
295
- <sort_order>10</sort_order>
296
- <show_in_default>1</show_in_default>
297
- <show_in_website>1</show_in_website>
298
- <show_in_store>1</show_in_store>
299
- </cc_refill>
300
  <reference_one translate="label">
301
  <label>Transaction reference 1</label>
302
- <comment>This will appear in the transactions details / account statement</comment>
303
  <frontend_type>text</frontend_type>
304
  <config_path>payment/novalnetCc/reference_one</config_path>
305
- <sort_order>11</sort_order>
306
  <show_in_default>1</show_in_default>
307
  <show_in_website>1</show_in_website>
308
  <show_in_store>1</show_in_store>
309
  </reference_one>
310
  <reference_two translate="label">
311
  <label>Transaction reference 2</label>
312
- <comment>This will appear in the transactions details / account statement</comment>
313
  <frontend_type>text</frontend_type>
314
  <config_path>payment/novalnetCc/reference_two</config_path>
315
- <sort_order>12</sort_order>
316
  <show_in_default>1</show_in_default>
317
  <show_in_website>1</show_in_website>
318
  <show_in_store>1</show_in_store>
319
  </reference_two>
320
  <booking_reference translate="label">
321
- <label>Information to the end customer (this will appear in the payment page)</label>
 
322
  <frontend_type>text</frontend_type>
323
  <config_path>payment/novalnetCc/booking_reference</config_path>
324
- <sort_order>13</sort_order>
325
  <show_in_default>1</show_in_default>
326
  <show_in_website>1</show_in_website>
327
  <show_in_store>1</show_in_store>
328
  </booking_reference>
329
  <user_group_excluded translate="label">
330
- <comment>Excluded User Group Desc</comment>
331
  <label>User Group Excluded</label>
 
332
  <frontend_type>text</frontend_type>
333
  <config_path>payment/novalnetCc/user_group_excluded</config_path>
334
- <sort_order>14</sort_order>
335
  <show_in_default>1</show_in_default>
336
  <show_in_website>1</show_in_website>
337
  <show_in_store>1</show_in_store>
338
  </user_group_excluded>
339
- <gateway_timeout translate="label">
340
- <comment>Gateway Timeout in seconds</comment>
341
- <label>Gateway Timeout</label>
342
- <frontend_type>text</frontend_type>
343
- <config_path>payment/novalnetCc/gateway_timeout</config_path>
344
- <sort_order>15</sort_order>
345
- <show_in_default>1</show_in_default>
346
- <show_in_website>1</show_in_website>
347
- <show_in_store>1</show_in_store>
348
- </gateway_timeout>
349
  <allowspecific translate="label">
350
  <label>Payment from applicable countries</label>
351
- <frontend_type>allowspecific</frontend_type>
352
  <config_path>payment/novalnetCc/allowspecific</config_path>
353
- <sort_order>16</sort_order>
354
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
355
  <show_in_default>1</show_in_default>
356
  <show_in_website>1</show_in_website>
@@ -360,7 +441,7 @@
360
  <label>Payment from Specific countries</label>
361
  <frontend_type>multiselect</frontend_type>
362
  <config_path>payment/novalnetCc/specificcountry</config_path>
363
- <sort_order>17</sort_order>
364
  <source_model>adminhtml/system_config_source_country</source_model>
365
  <show_in_default>1</show_in_default>
366
  <show_in_website>1</show_in_website>
@@ -373,7 +454,8 @@
373
  <label>Novalnet Minimum Order Total</label>
374
  <frontend_type>text</frontend_type>
375
  <config_path>payment/novalnetCc/min_order_total</config_path>
376
- <sort_order>18</sort_order>
 
377
  <show_in_default>1</show_in_default>
378
  <show_in_website>1</show_in_website>
379
  <show_in_store>1</show_in_store>
@@ -382,7 +464,8 @@
382
  <label>Novalnet Maximum Order Total</label>
383
  <frontend_type>text</frontend_type>
384
  <config_path>payment/novalnetCc/max_order_total</config_path>
385
- <sort_order>19</sort_order>
 
386
  <show_in_default>1</show_in_default>
387
  <show_in_website>1</show_in_website>
388
  <show_in_store>1</show_in_store>
@@ -391,7 +474,8 @@
391
  <label>Novalnet Minimum Orders Count</label>
392
  <frontend_type>text</frontend_type>
393
  <config_path>payment/novalnetCc/orderscount</config_path>
394
- <sort_order>20</sort_order>
 
395
  <comment>Novalnet Minimum Orders Count Desc</comment>
396
  <show_in_default>1</show_in_default>
397
  <show_in_website>1</show_in_website>
@@ -402,7 +486,8 @@
402
  <comment>Sort order of display. Lowest is displayed first.</comment>
403
  <frontend_type>text</frontend_type>
404
  <config_path>payment/novalnetCc/sort_order</config_path>
405
- <sort_order>21</sort_order>
 
406
  <show_in_default>1</show_in_default>
407
  <show_in_website>1</show_in_website>
408
  <show_in_store>1</show_in_store>
@@ -413,13 +498,13 @@
413
  <!--{{{ Novalnet SEPA-->
414
  <novalnetSepa translate="label" module="novalnet_payment">
415
  <label>Novalnet Direct Debit SEPA</label>
416
- <sort_order>683</sort_order>
417
  <show_in_default>1</show_in_default>
418
  <show_in_website>1</show_in_website>
419
  <show_in_store>1</show_in_store>
420
  <fields>
421
  <active translate="label">
422
- <label>Enable Novalnet Module</label>
423
  <frontend_type>select</frontend_type>
424
  <source_model>adminhtml/system_config_source_yesno</source_model>
425
  <config_path>payment/novalnetSepa/active</config_path>
@@ -429,7 +514,7 @@
429
  <show_in_store>1</show_in_store>
430
  </active>
431
  <title translate="label">
432
- <label>Novalnet Title</label>
433
  <frontend_type>text</frontend_type>
434
  <config_path>payment/novalnetSepa/title</config_path>
435
  <validate>required-entry</validate>
@@ -439,134 +524,82 @@
439
  <show_in_store>1</show_in_store>
440
  </title>
441
  <order_status translate="label">
442
- <label>Order Completion Status</label>
443
  <frontend_type>select</frontend_type>
444
- <config_path>payment/novalnetSepa/order_status</config_path>
445
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
446
  <sort_order>3</sort_order>
447
  <show_in_default>1</show_in_default>
448
  <show_in_website>1</show_in_website>
449
  <show_in_store>1</show_in_store>
450
  </order_status>
451
- <manual_checking_amount tranlate="label" >
452
- <label>Manual checking of order</label>
453
- <comment>Manual checking of order Desc</comment>
454
- <frontend_type>text</frontend_type>
455
- <validate>validate-digits</validate>
456
- <config_path>payment/novalnetSepa/manual_checking_amount</config_path>
457
- <sort_order>4</sort_order>
458
- <show_in_default>1</show_in_default>
459
- <show_in_website>1</show_in_website>
460
- <show_in_store>1</show_in_store>
461
- </manual_checking_amount>
462
- <second_product_id translate="label">
463
- <label>Second Product ID for manual check condition</label>
464
- <comment>Second Product ID in Novalnet to use the manual check condition</comment>
465
- <frontend_type>text</frontend_type>
466
- <validate>validate-digits</validate>
467
- <config_path>payment/novalnetSepa/second_product_id</config_path>
468
- <sort_order>5</sort_order>
469
- <show_in_default>1</show_in_default>
470
- <show_in_website>1</show_in_website>
471
- <show_in_store>1</show_in_store>
472
- </second_product_id>
473
- <second_tariff_id translate="label">
474
- <label>Second Tariff ID for manual check condition</label>
475
- <comment>Second Tariff ID in Novalnet to use the manual check condition</comment>
476
- <frontend_type>text</frontend_type>
477
- <validate>validate-digits</validate>
478
- <config_path>payment/novalnetSepa/second_tariff_id</config_path>
479
- <sort_order>6</sort_order>
480
- <show_in_default>1</show_in_default>
481
- <show_in_website>1</show_in_website>
482
- <show_in_store>1</show_in_store>
483
- </second_tariff_id>
484
- <sepa_refill translate="label">
485
- <label>Auto refill the payment data entered in payment page</label>
486
- <comment>If yes, the entered payment data will be automatically refilled while error handling</comment>
487
- <frontend_type>select</frontend_type>
488
- <source_model>adminhtml/system_config_source_yesno</source_model>
489
- <config_path>payment/novalnetSepa/sepa_refill</config_path>
490
- <sort_order>7</sort_order>
491
- <show_in_default>1</show_in_default>
492
- <show_in_website>1</show_in_website>
493
- <show_in_store>1</show_in_store>
494
- </sepa_refill>
495
  <sepa_duedate translate="label">
496
  <label>SEPA Payment duration in days</label>
497
- <comment>SEPA Due Date description</comment>
498
  <frontend_type>text</frontend_type>
499
- <validate>validate-digits validate-greater-than-zero</validate>
500
  <config_path>payment/novalnetSepa/sepa_due_date</config_path>
501
- <sort_order>8</sort_order>
 
502
  <show_in_default>1</show_in_default>
503
  <show_in_website>1</show_in_website>
504
  <show_in_store>1</show_in_store>
505
  </sepa_duedate>
506
- <sepa_refill translate="label">
507
- <label>Auto refill the payment data entered in payment page</label>
 
508
  <frontend_type>select</frontend_type>
509
  <source_model>adminhtml/system_config_source_yesno</source_model>
510
- <config_path>payment/novalnetSepa/sepa_refill</config_path>
511
- <sort_order>9</sort_order>
512
  <show_in_default>1</show_in_default>
513
  <show_in_website>1</show_in_website>
514
  <show_in_store>1</show_in_store>
515
- </sepa_refill>
516
  <reference_one translate="label">
517
  <label>Transaction reference 1</label>
518
- <comment>This will appear in the transactions details / account statement</comment>
519
  <frontend_type>text</frontend_type>
520
  <config_path>payment/novalnetSepa/reference_one</config_path>
521
- <sort_order>10</sort_order>
522
  <show_in_default>1</show_in_default>
523
  <show_in_website>1</show_in_website>
524
  <show_in_store>1</show_in_store>
525
  </reference_one>
526
  <reference_two translate="label">
527
  <label>Transaction reference 2</label>
528
- <comment>This will appear in the transactions details / account statement</comment>
529
  <frontend_type>text</frontend_type>
530
  <config_path>payment/novalnetSepa/reference_two</config_path>
531
- <sort_order>11</sort_order>
532
  <show_in_default>1</show_in_default>
533
  <show_in_website>1</show_in_website>
534
  <show_in_store>1</show_in_store>
535
  </reference_two>
536
  <booking_reference translate="label">
537
- <label>Information to the end customer (this will appear in the payment page)</label>
 
538
  <frontend_type>text</frontend_type>
539
  <config_path>payment/novalnetSepa/booking_reference</config_path>
540
- <sort_order>12</sort_order>
541
  <show_in_default>1</show_in_default>
542
  <show_in_website>1</show_in_website>
543
  <show_in_store>1</show_in_store>
544
  </booking_reference>
545
  <user_group_excluded translate="label">
546
- <comment>Excluded User Group Desc</comment>
547
  <label>User Group Excluded</label>
 
548
  <frontend_type>text</frontend_type>
549
  <config_path>payment/novalnetSepa/user_group_excluded</config_path>
550
- <sort_order>13</sort_order>
551
  <show_in_default>1</show_in_default>
552
  <show_in_website>1</show_in_website>
553
  <show_in_store>1</show_in_store>
554
  </user_group_excluded>
555
- <gateway_timeout translate="label">
556
- <comment>Gateway Timeout in seconds</comment>
557
- <label>Gateway Timeout</label>
558
- <frontend_type>text</frontend_type>
559
- <config_path>payment/novalnetSepa/gateway_timeout</config_path>
560
- <sort_order>14</sort_order>
561
- <show_in_default>1</show_in_default>
562
- <show_in_website>1</show_in_website>
563
- <show_in_store>1</show_in_store>
564
- </gateway_timeout>
565
  <allowspecific translate="label">
566
  <label>Payment from applicable countries</label>
567
- <frontend_type>allowspecific</frontend_type>
568
  <config_path>payment/novalnetSepa/allowspecific</config_path>
569
- <sort_order>15</sort_order>
570
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
571
  <show_in_default>1</show_in_default>
572
  <show_in_website>1</show_in_website>
@@ -576,7 +609,7 @@
576
  <label>Payment from Specific countries</label>
577
  <frontend_type>multiselect</frontend_type>
578
  <config_path>payment/novalnetSepa/specificcountry</config_path>
579
- <sort_order>16</sort_order>
580
  <source_model>adminhtml/system_config_source_country</source_model>
581
  <show_in_default>1</show_in_default>
582
  <show_in_website>1</show_in_website>
@@ -589,7 +622,8 @@
589
  <label>Novalnet Minimum Order Total</label>
590
  <frontend_type>text</frontend_type>
591
  <config_path>payment/novalnetSepa/min_order_total</config_path>
592
- <sort_order>17</sort_order>
 
593
  <show_in_default>1</show_in_default>
594
  <show_in_website>1</show_in_website>
595
  <show_in_store>1</show_in_store>
@@ -598,17 +632,19 @@
598
  <label>Novalnet Maximum Order Total</label>
599
  <frontend_type>text</frontend_type>
600
  <config_path>payment/novalnetSepa/max_order_total</config_path>
601
- <sort_order>18</sort_order>
 
602
  <show_in_default>1</show_in_default>
603
  <show_in_website>1</show_in_website>
604
  <show_in_store>1</show_in_store>
605
  </max_order_total>
606
  <orderscount translate="label">
607
  <label>Novalnet Minimum Orders Count</label>
 
608
  <frontend_type>text</frontend_type>
609
  <config_path>payment/novalnetSepa/orderscount</config_path>
610
- <sort_order>19</sort_order>
611
- <comment>Novalnet Minimum Orders Count Desc</comment>
612
  <show_in_default>1</show_in_default>
613
  <show_in_website>1</show_in_website>
614
  <show_in_store>1</show_in_store>
@@ -618,7 +654,8 @@
618
  <comment>Sort order of display. Lowest is displayed first.</comment>
619
  <frontend_type>text</frontend_type>
620
  <config_path>payment/novalnetSepa/sort_order</config_path>
621
- <sort_order>20</sort_order>
 
622
  <show_in_default>1</show_in_default>
623
  <show_in_website>1</show_in_website>
624
  <show_in_store>1</show_in_store>
@@ -629,13 +666,13 @@
629
  <!--{{{ Novalnet Invoice-->
630
  <novalnetInvoice translate="label" module="novalnet_payment">
631
  <label>Novalnet Invoice</label>
632
- <sort_order>684</sort_order>
633
  <show_in_default>1</show_in_default>
634
  <show_in_website>1</show_in_website>
635
  <show_in_store>1</show_in_store>
636
  <fields>
637
  <active translate="label">
638
- <label>Enable Novalnet Module</label>
639
  <frontend_type>select</frontend_type>
640
  <config_path>payment/novalnetInvoice/active</config_path>
641
  <source_model>adminhtml/system_config_source_yesno</source_model>
@@ -645,7 +682,7 @@
645
  <show_in_store>1</show_in_store>
646
  </active>
647
  <title translate="label">
648
- <label>Novalnet Title</label>
649
  <frontend_type>text</frontend_type>
650
  <config_path>payment/novalnetInvoice/title</config_path>
651
  <validate>required-entry</validate>
@@ -655,7 +692,7 @@
655
  <show_in_store>1</show_in_store>
656
  </title>
657
  <order_status translate="label">
658
- <label>Order Status Before Payment</label>
659
  <frontend_type>select</frontend_type>
660
  <config_path>payment/novalnetInvoice/order_status</config_path>
661
  <source_model>adminhtml/system_config_source_order_status</source_model>
@@ -665,7 +702,7 @@
665
  <show_in_store>1</show_in_store>
666
  </order_status>
667
  <order_status_after_payment translate="label">
668
- <label>Order Status After Payment</label>
669
  <frontend_type>select</frontend_type>
670
  <config_path>payment/novalnetInvoice/order_status_after_payment</config_path>
671
  <source_model>adminhtml/system_config_source_order_status</source_model>
@@ -675,7 +712,8 @@
675
  <show_in_store>1</show_in_store>
676
  </order_status_after_payment>
677
  <booking_reference translate="label">
678
- <label>Information to the end customer (this will appear in the payment page)</label>
 
679
  <frontend_type>text</frontend_type>
680
  <config_path>payment/novalnetInvoice/booking_reference</config_path>
681
  <sort_order>5</sort_order>
@@ -685,7 +723,7 @@
685
  </booking_reference>
686
  <reference_one translate="label">
687
  <label>Transaction reference 1</label>
688
- <comment>This will appear in the transactions details / account statement</comment>
689
  <frontend_type>text</frontend_type>
690
  <config_path>payment/novalnetInvoice/reference_one</config_path>
691
  <sort_order>6</sort_order>
@@ -695,7 +733,7 @@
695
  </reference_one>
696
  <reference_two translate="label">
697
  <label>Transaction reference 2</label>
698
- <comment>This will appear in the transactions details / account statement</comment>
699
  <frontend_type>text</frontend_type>
700
  <config_path>payment/novalnetInvoice/reference_two</config_path>
701
  <sort_order>7</sort_order>
@@ -704,42 +742,188 @@
704
  <show_in_store>1</show_in_store>
705
  </reference_two>
706
  <payment_duration translate="label">
707
- <label>Payment period in days</label>
708
- <comment>Invoice Due Date description</comment>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  <frontend_type>text</frontend_type>
710
- <validate>validate-digits</validate>
711
- <config_path>payment/novalnetInvoice/payment_duration</config_path>
712
- <sort_order>8</sort_order>
713
  <show_in_default>1</show_in_default>
714
  <show_in_website>1</show_in_website>
715
  <show_in_store>1</show_in_store>
716
- </payment_duration>
717
  <user_group_excluded translate="label">
718
- <comment>Excluded User Group Desc</comment>
719
  <label>User Group Excluded</label>
 
720
  <frontend_type>text</frontend_type>
721
- <config_path>payment/novalnetInvoice/user_group_excluded</config_path>
722
- <sort_order>9</sort_order>
723
  <show_in_default>1</show_in_default>
724
  <show_in_website>1</show_in_website>
725
  <show_in_store>1</show_in_store>
726
  </user_group_excluded>
727
- <gateway_timeout translate="label">
728
- <comment>Gateway Timeout in seconds</comment>
729
- <label>Gateway Timeout</label>
730
- <frontend_type>text</frontend_type>
731
- <config_path>payment/novalnetInvoice/gateway_timeout</config_path>
732
- <sort_order>10</sort_order>
733
- <show_in_default>1</show_in_default>
734
- <show_in_website>1</show_in_website>
735
- <show_in_store>1</show_in_store>
736
- </gateway_timeout>
737
  <allowspecific translate="label">
738
  <label>Payment from applicable countries</label>
739
- <frontend_type>allowspecific</frontend_type>
740
- <config_path>payment/novalnetInvoice/allowspecific</config_path>
741
- <sort_order>11</sort_order>
742
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
 
 
743
  <show_in_default>1</show_in_default>
744
  <show_in_website>1</show_in_website>
745
  <show_in_store>1</show_in_store>
@@ -747,9 +931,9 @@
747
  <specificcountry translate="label">
748
  <label>Payment from Specific countries</label>
749
  <frontend_type>multiselect</frontend_type>
750
- <config_path>payment/novalnetInvoice/specificcountry</config_path>
751
- <sort_order>12</sort_order>
752
  <source_model>adminhtml/system_config_source_country</source_model>
 
 
753
  <show_in_default>1</show_in_default>
754
  <show_in_website>1</show_in_website>
755
  <show_in_store>1</show_in_store>
@@ -760,9 +944,9 @@
760
  <min_order_total translate="label">
761
  <label>Novalnet Minimum Order Total</label>
762
  <frontend_type>text</frontend_type>
 
763
  <validate>validate-number</validate>
764
- <config_path>payment/novalnetInvoice/min_order_total</config_path>
765
- <sort_order>13</sort_order>
766
  <show_in_default>1</show_in_default>
767
  <show_in_website>1</show_in_website>
768
  <show_in_store>1</show_in_store>
@@ -770,9 +954,9 @@
770
  <max_order_total translate="label">
771
  <label>Novalnet Maximum Order Total</label>
772
  <frontend_type>text</frontend_type>
 
773
  <validate>validate-number</validate>
774
- <config_path>payment/novalnetInvoice/max_order_total</config_path>
775
- <sort_order>14</sort_order>
776
  <show_in_default>1</show_in_default>
777
  <show_in_website>1</show_in_website>
778
  <show_in_store>1</show_in_store>
@@ -780,9 +964,9 @@
780
  <orderscount translate="label">
781
  <label>Novalnet Minimum Orders Count</label>
782
  <frontend_type>text</frontend_type>
 
783
  <validate>validate-digits</validate>
784
- <config_path>payment/novalnetInvoice/orderscount</config_path>
785
- <sort_order>15</sort_order>
786
  <comment>Novalnet Minimum Orders Count Desc</comment>
787
  <show_in_default>1</show_in_default>
788
  <show_in_website>1</show_in_website>
@@ -792,38 +976,38 @@
792
  <label>Novalnet Sort Order</label>
793
  <comment>Sort order of display. Lowest is displayed first.</comment>
794
  <frontend_type>text</frontend_type>
 
795
  <validate>validate-digits</validate>
796
- <config_path>payment/novalnetInvoice/sort_order</config_path>
797
- <sort_order>16</sort_order>
798
  <show_in_default>1</show_in_default>
799
  <show_in_website>1</show_in_website>
800
  <show_in_store>1</show_in_store>
801
  </sort_order>
802
  </fields>
803
- </novalnetInvoice>
804
- <!--}}} Novalnet Invoice-->
805
- <!--{{{ Novalnet Prepayment-->
806
- <novalnetPrepayment translate="label" module="novalnet_payment">
807
- <label>Novalnet Prepayment</label>
808
- <sort_order>685</sort_order>
809
  <show_in_default>1</show_in_default>
810
  <show_in_website>1</show_in_website>
811
  <show_in_store>1</show_in_store>
812
  <fields>
813
  <active translate="label">
814
- <label>Enable Novalnet Module</label>
815
  <frontend_type>select</frontend_type>
816
- <config_path>payment/novalnetPrepayment/active</config_path>
817
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
818
  <sort_order>1</sort_order>
819
  <show_in_default>1</show_in_default>
820
  <show_in_website>1</show_in_website>
821
  <show_in_store>1</show_in_store>
822
  </active>
823
  <title translate="label">
824
- <label>Novalnet Title</label>
825
  <frontend_type>text</frontend_type>
826
- <config_path>payment/novalnetPrepayment/title</config_path>
827
  <validate>required-entry</validate>
828
  <sort_order>2</sort_order>
829
  <show_in_default>1</show_in_default>
@@ -831,29 +1015,30 @@
831
  <show_in_store>1</show_in_store>
832
  </title>
833
  <order_status translate="label">
834
- <label>Order Status Before Payment</label>
835
  <frontend_type>select</frontend_type>
836
- <config_path>payment/novalnetPrepayment/order_status</config_path>
837
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
838
  <sort_order>3</sort_order>
839
  <show_in_default>1</show_in_default>
840
  <show_in_website>1</show_in_website>
841
  <show_in_store>1</show_in_store>
842
  </order_status>
843
  <order_status_after_payment translate="label">
844
- <label>Order Status After Payment</label>
845
  <frontend_type>select</frontend_type>
846
- <config_path>payment/novalnetPrepayment/order_status_after_payment</config_path>
847
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
848
  <sort_order>4</sort_order>
849
  <show_in_default>1</show_in_default>
850
  <show_in_website>1</show_in_website>
851
  <show_in_store>1</show_in_store>
852
  </order_status_after_payment>
853
  <booking_reference translate="label">
854
- <label>Information to the end customer (this will appear in the payment page)</label>
 
855
  <frontend_type>text</frontend_type>
856
- <config_path>payment/novalnetPrepayment/booking_reference</config_path>
857
  <sort_order>5</sort_order>
858
  <show_in_default>1</show_in_default>
859
  <show_in_website>1</show_in_website>
@@ -861,9 +1046,9 @@
861
  </booking_reference>
862
  <reference_one translate="label">
863
  <label>Transaction reference 1</label>
864
- <comment>This will appear in the transactions details / account statement</comment>
865
  <frontend_type>text</frontend_type>
866
- <config_path>payment/novalnetPrepayment/reference_one</config_path>
867
  <sort_order>6</sort_order>
868
  <show_in_default>1</show_in_default>
869
  <show_in_website>1</show_in_website>
@@ -871,40 +1056,30 @@
871
  </reference_one>
872
  <reference_two translate="label">
873
  <label>Transaction reference 2</label>
874
- <comment>This will appear in the transactions details / account statement</comment>
875
  <frontend_type>text</frontend_type>
876
- <config_path>payment/novalnetPrepayment/reference_two</config_path>
877
  <sort_order>7</sort_order>
878
  <show_in_default>1</show_in_default>
879
  <show_in_website>1</show_in_website>
880
  <show_in_store>1</show_in_store>
881
  </reference_two>
882
  <user_group_excluded translate="label">
883
- <comment>Excluded User Group Desc</comment>
884
  <label>User Group Excluded</label>
 
885
  <frontend_type>text</frontend_type>
886
- <config_path>payment/novalnetPrepayment/user_group_excluded</config_path>
887
  <sort_order>8</sort_order>
888
  <show_in_default>1</show_in_default>
889
  <show_in_website>1</show_in_website>
890
  <show_in_store>1</show_in_store>
891
  </user_group_excluded>
892
- <gateway_timeout translate="label">
893
- <comment>Gateway Timeout in seconds</comment>
894
- <label>Gateway Timeout</label>
895
- <frontend_type>text</frontend_type>
896
- <config_path>payment/novalnetPrepayment/gateway_timeout</config_path>
897
- <sort_order>9</sort_order>
898
- <show_in_default>1</show_in_default>
899
- <show_in_website>1</show_in_website>
900
- <show_in_store>1</show_in_store>
901
- </gateway_timeout>
902
  <allowspecific translate="label">
903
  <label>Payment from applicable countries</label>
904
- <frontend_type>allowspecific</frontend_type>
905
- <config_path>payment/novalnetPrepayment/allowspecific</config_path>
906
- <sort_order>10</sort_order>
907
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
 
 
908
  <show_in_default>1</show_in_default>
909
  <show_in_website>1</show_in_website>
910
  <show_in_store>1</show_in_store>
@@ -912,9 +1087,9 @@
912
  <specificcountry translate="label">
913
  <label>Payment from Specific countries</label>
914
  <frontend_type>multiselect</frontend_type>
915
- <config_path>payment/novalnetPrepayment/specificcountry</config_path>
916
- <sort_order>11</sort_order>
917
  <source_model>adminhtml/system_config_source_country</source_model>
 
 
918
  <show_in_default>1</show_in_default>
919
  <show_in_website>1</show_in_website>
920
  <show_in_store>1</show_in_store>
@@ -925,9 +1100,9 @@
925
  <min_order_total translate="label">
926
  <label>Novalnet Minimum Order Total</label>
927
  <frontend_type>text</frontend_type>
 
928
  <validate>validate-number</validate>
929
- <config_path>payment/novalnetPrepayment/min_order_total</config_path>
930
- <sort_order>12</sort_order>
931
  <show_in_default>1</show_in_default>
932
  <show_in_website>1</show_in_website>
933
  <show_in_store>1</show_in_store>
@@ -935,20 +1110,20 @@
935
  <max_order_total translate="label">
936
  <label>Novalnet Maximum Order Total</label>
937
  <frontend_type>text</frontend_type>
 
938
  <validate>validate-number</validate>
939
- <config_path>payment/novalnetPrepayment/max_order_total</config_path>
940
- <sort_order>13</sort_order>
941
  <show_in_default>1</show_in_default>
942
  <show_in_website>1</show_in_website>
943
  <show_in_store>1</show_in_store>
944
  </max_order_total>
945
  <orderscount translate="label">
946
  <label>Novalnet Minimum Orders Count</label>
 
947
  <frontend_type>text</frontend_type>
 
 
948
  <validate>validate-digits</validate>
949
- <config_path>payment/novalnetPrepayment/orderscount</config_path>
950
- <sort_order>14</sort_order>
951
- <comment>Novalnet Minimum Orders Count Desc</comment>
952
  <show_in_default>1</show_in_default>
953
  <show_in_website>1</show_in_website>
954
  <show_in_store>1</show_in_store>
@@ -957,38 +1132,39 @@
957
  <label>Novalnet Sort Order</label>
958
  <comment>Sort order of display. Lowest is displayed first.</comment>
959
  <frontend_type>text</frontend_type>
 
960
  <validate>validate-digits</validate>
961
- <config_path>payment/novalnetPrepayment/sort_order</config_path>
962
- <sort_order>15</sort_order>
963
  <show_in_default>1</show_in_default>
964
  <show_in_website>1</show_in_website>
965
  <show_in_store>1</show_in_store>
966
  </sort_order>
967
  </fields>
968
- </novalnetPrepayment>
969
- <!--}}} Novalnet Prepayment-->
970
- <!--{{{ Novalnet Instant-->
971
- <novalnetSofortueberweisung translate="label" module="novalnet_payment">
972
- <label>Novalnet Instant Bank Transfer</label>
973
- <sort_order>688</sort_order>
 
974
  <show_in_default>1</show_in_default>
975
  <show_in_website>1</show_in_website>
976
  <show_in_store>1</show_in_store>
977
  <fields>
978
  <active translate="label">
979
- <label>Enable Novalnet Module</label>
980
  <frontend_type>select</frontend_type>
981
- <config_path>payment/novalnetSofortueberweisung/active</config_path>
982
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
983
  <sort_order>1</sort_order>
984
  <show_in_default>1</show_in_default>
985
  <show_in_website>1</show_in_website>
986
  <show_in_store>1</show_in_store>
987
  </active>
988
  <title translate="label">
989
- <label>Novalnet Title</label>
990
  <frontend_type>text</frontend_type>
991
- <config_path>payment/novalnetSofortueberweisung/title</config_path>
992
  <validate>required-entry</validate>
993
  <sort_order>2</sort_order>
994
  <show_in_default>1</show_in_default>
@@ -996,29 +1172,30 @@
996
  <show_in_store>1</show_in_store>
997
  </title>
998
  <order_status translate="label">
999
- <label>Order Status Before Payment</label>
1000
  <frontend_type>select</frontend_type>
1001
- <config_path>payment/novalnetSofortueberweisung/order_status</config_path>
1002
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
1003
  <sort_order>3</sort_order>
1004
  <show_in_default>1</show_in_default>
1005
  <show_in_website>1</show_in_website>
1006
  <show_in_store>1</show_in_store>
1007
  </order_status>
1008
  <order_status_after_payment translate="label">
1009
- <label>Order Status After Successful Payment</label>
1010
  <frontend_type>select</frontend_type>
1011
- <config_path>payment/novalnetSofortueberweisung/order_status_after_payment</config_path>
1012
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
1013
  <sort_order>4</sort_order>
1014
  <show_in_default>1</show_in_default>
1015
  <show_in_website>1</show_in_website>
1016
  <show_in_store>1</show_in_store>
1017
  </order_status_after_payment>
1018
  <booking_reference translate="label">
1019
- <label>Information to the end customer (this will appear in the payment page)</label>
 
1020
  <frontend_type>text</frontend_type>
1021
- <config_path>payment/novalnetSofortueberweisung/booking_reference</config_path>
1022
  <sort_order>5</sort_order>
1023
  <show_in_default>1</show_in_default>
1024
  <show_in_website>1</show_in_website>
@@ -1026,9 +1203,9 @@
1026
  </booking_reference>
1027
  <reference_one translate="label">
1028
  <label>Transaction reference 1</label>
1029
- <comment>This will appear in the transactions details / account statement</comment>
1030
  <frontend_type>text</frontend_type>
1031
- <config_path>payment/novalnetSofortueberweisung/reference_one</config_path>
1032
  <sort_order>6</sort_order>
1033
  <show_in_default>1</show_in_default>
1034
  <show_in_website>1</show_in_website>
@@ -1036,40 +1213,30 @@
1036
  </reference_one>
1037
  <reference_two translate="label">
1038
  <label>Transaction reference 2</label>
1039
- <comment>This will appear in the transactions details / account statement</comment>
1040
  <frontend_type>text</frontend_type>
1041
- <config_path>payment/novalnetSofortueberweisung/reference_two</config_path>
1042
  <sort_order>7</sort_order>
1043
  <show_in_default>1</show_in_default>
1044
  <show_in_website>1</show_in_website>
1045
  <show_in_store>1</show_in_store>
1046
  </reference_two>
1047
  <user_group_excluded translate="label">
1048
- <comment>Excluded User Group Desc</comment>
1049
  <label>User Group Excluded</label>
 
1050
  <frontend_type>text</frontend_type>
1051
- <config_path>payment/novalnetSofortueberweisung/user_group_excluded</config_path>
1052
  <sort_order>8</sort_order>
1053
  <show_in_default>1</show_in_default>
1054
  <show_in_website>1</show_in_website>
1055
  <show_in_store>1</show_in_store>
1056
  </user_group_excluded>
1057
- <gateway_timeout translate="label">
1058
- <comment>Gateway Timeout in seconds</comment>
1059
- <label>Gateway Timeout</label>
1060
- <frontend_type>text</frontend_type>
1061
- <config_path>payment/novalnetSofortueberweisung/gateway_timeout</config_path>
1062
- <sort_order>9</sort_order>
1063
- <show_in_default>1</show_in_default>
1064
- <show_in_website>1</show_in_website>
1065
- <show_in_store>1</show_in_store>
1066
- </gateway_timeout>
1067
  <allowspecific translate="label">
1068
  <label>Payment from applicable countries</label>
1069
- <frontend_type>allowspecific</frontend_type>
1070
- <config_path>payment/novalnetSofortueberweisung/allowspecific</config_path>
1071
- <sort_order>10</sort_order>
1072
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
 
 
1073
  <show_in_default>1</show_in_default>
1074
  <show_in_website>1</show_in_website>
1075
  <show_in_store>1</show_in_store>
@@ -1077,9 +1244,9 @@
1077
  <specificcountry translate="label">
1078
  <label>Payment from Specific countries</label>
1079
  <frontend_type>multiselect</frontend_type>
1080
- <config_path>payment/novalnetSofortueberweisung/specificcountry</config_path>
1081
- <sort_order>11</sort_order>
1082
  <source_model>adminhtml/system_config_source_country</source_model>
 
 
1083
  <show_in_default>1</show_in_default>
1084
  <show_in_website>1</show_in_website>
1085
  <show_in_store>1</show_in_store>
@@ -1090,9 +1257,9 @@
1090
  <min_order_total translate="label">
1091
  <label>Novalnet Minimum Order Total</label>
1092
  <frontend_type>text</frontend_type>
 
1093
  <validate>validate-number</validate>
1094
- <config_path>payment/novalnetSofortueberweisung/min_order_total</config_path>
1095
- <sort_order>12</sort_order>
1096
  <show_in_default>1</show_in_default>
1097
  <show_in_website>1</show_in_website>
1098
  <show_in_store>1</show_in_store>
@@ -1100,20 +1267,20 @@
1100
  <max_order_total translate="label">
1101
  <label>Novalnet Maximum Order Total</label>
1102
  <frontend_type>text</frontend_type>
 
1103
  <validate>validate-number</validate>
1104
- <config_path>payment/novalnetSofortueberweisung/max_order_total</config_path>
1105
- <sort_order>13</sort_order>
1106
  <show_in_default>1</show_in_default>
1107
  <show_in_website>1</show_in_website>
1108
  <show_in_store>1</show_in_store>
1109
  </max_order_total>
1110
  <orderscount translate="label">
1111
  <label>Novalnet Minimum Orders Count</label>
 
1112
  <frontend_type>text</frontend_type>
 
1113
  <validate>validate-digits</validate>
1114
- <config_path>payment/novalnetSofortueberweisung/orderscount</config_path>
1115
- <sort_order>14</sort_order>
1116
- <comment>Novalnet Minimum Orders Count Desc</comment>
1117
  <show_in_default>1</show_in_default>
1118
  <show_in_website>1</show_in_website>
1119
  <show_in_store>1</show_in_store>
@@ -1122,39 +1289,39 @@
1122
  <label>Novalnet Sort Order</label>
1123
  <comment>Sort order of display. Lowest is displayed first.</comment>
1124
  <frontend_type>text</frontend_type>
 
1125
  <validate>validate-digits</validate>
1126
- <config_path>payment/novalnetSofortueberweisung/sort_order</config_path>
1127
- <sort_order>15</sort_order>
1128
  <show_in_default>1</show_in_default>
1129
  <show_in_website>1</show_in_website>
1130
  <show_in_store>1</show_in_store>
1131
  </sort_order>
1132
  </fields>
1133
- </novalnetSofortueberweisung>
1134
- <!--}}} Novalnet Instant-->
1135
- <!--{{{ Novalnet Paypal-->
1136
- <novalnetPaypal translate="label" module="novalnet_payment">
1137
- <label>Novalnet PayPal</label>
1138
  <frontend_type>text</frontend_type>
1139
- <sort_order>686</sort_order>
1140
  <show_in_default>1</show_in_default>
1141
  <show_in_website>1</show_in_website>
1142
  <show_in_store>1</show_in_store>
1143
  <fields>
1144
  <active translate="label">
1145
- <label>Enable Novalnet Module</label>
1146
  <frontend_type>select</frontend_type>
1147
- <config_path>payment/novalnetPaypal/active</config_path>
1148
  <source_model>adminhtml/system_config_source_yesno</source_model>
 
1149
  <sort_order>1</sort_order>
1150
  <show_in_default>1</show_in_default>
1151
  <show_in_website>1</show_in_website>
1152
  <show_in_store>1</show_in_store>
1153
  </active>
1154
  <title translate="label">
1155
- <label>Novalnet Title</label>
1156
  <frontend_type>text</frontend_type>
1157
- <config_path>payment/novalnetPaypal/title</config_path>
1158
  <validate>required-entry</validate>
1159
  <sort_order>2</sort_order>
1160
  <show_in_default>1</show_in_default>
@@ -1162,29 +1329,30 @@
1162
  <show_in_store>1</show_in_store>
1163
  </title>
1164
  <order_status translate="label">
1165
- <label>Order Status Before Payment</label>
1166
  <frontend_type>select</frontend_type>
1167
- <config_path>payment/novalnetPaypal/order_status</config_path>
1168
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
1169
  <sort_order>3</sort_order>
1170
  <show_in_default>1</show_in_default>
1171
  <show_in_website>1</show_in_website>
1172
  <show_in_store>1</show_in_store>
1173
  </order_status>
1174
  <order_status_after_payment translate="label">
1175
- <label>Order Status After Successful Payment</label>
1176
  <frontend_type>select</frontend_type>
1177
- <config_path>payment/novalnetPaypal/order_status_after_payment</config_path>
1178
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
1179
  <sort_order>4</sort_order>
1180
  <show_in_default>1</show_in_default>
1181
  <show_in_website>1</show_in_website>
1182
  <show_in_store>1</show_in_store>
1183
  </order_status_after_payment>
1184
  <booking_reference translate="label">
1185
- <label>Information to the end customer (this will appear in the payment page)</label>
 
1186
  <frontend_type>text</frontend_type>
1187
- <config_path>payment/novalnetPaypal/booking_reference</config_path>
1188
  <sort_order>5</sort_order>
1189
  <show_in_default>1</show_in_default>
1190
  <show_in_website>1</show_in_website>
@@ -1192,9 +1360,9 @@
1192
  </booking_reference>
1193
  <reference_one translate="label">
1194
  <label>Transaction reference 1</label>
1195
- <comment>This will appear in the transactions details / account statement</comment>
1196
  <frontend_type>text</frontend_type>
1197
- <config_path>payment/novalnetPaypal/reference_one</config_path>
1198
  <sort_order>6</sort_order>
1199
  <show_in_default>1</show_in_default>
1200
  <show_in_website>1</show_in_website>
@@ -1202,39 +1370,29 @@
1202
  </reference_one>
1203
  <reference_two translate="label">
1204
  <label>Transaction reference 2</label>
1205
- <comment>This will appear in the transactions details / account statement</comment>
1206
  <frontend_type>text</frontend_type>
1207
- <config_path>payment/novalnetPaypal/reference_two</config_path>
1208
  <sort_order>7</sort_order>
1209
  <show_in_default>1</show_in_default>
1210
  <show_in_website>1</show_in_website>
1211
  <show_in_store>1</show_in_store>
1212
  </reference_two>
1213
  <user_group_excluded translate="label">
1214
- <comment>Excluded User Group Desc</comment>
1215
  <label>User Group Excluded</label>
 
1216
  <frontend_type>text</frontend_type>
1217
- <config_path>payment/novalnetPaypal/user_group_excluded</config_path>
1218
  <sort_order>8</sort_order>
1219
  <show_in_default>1</show_in_default>
1220
  <show_in_website>1</show_in_website>
1221
  <show_in_store>1</show_in_store>
1222
  </user_group_excluded>
1223
- <gateway_timeout translate="label">
1224
- <comment>Gateway Timeout in seconds</comment>
1225
- <label>Gateway Timeout</label>
1226
- <frontend_type>text</frontend_type>
1227
- <config_path>payment/novalnetPaypal/gateway_timeout</config_path>
1228
- <sort_order>9</sort_order>
1229
- <show_in_default>1</show_in_default>
1230
- <show_in_website>1</show_in_website>
1231
- <show_in_store>1</show_in_store>
1232
- </gateway_timeout>
1233
  <allowspecific translate="label">
1234
  <label>Payment from applicable countries</label>
1235
- <frontend_type>allowspecific</frontend_type>
1236
- <config_path>payment/novalnetPaypal/allowspecific</config_path>
1237
- <sort_order>10</sort_order>
1238
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1239
  <show_in_default>1</show_in_default>
1240
  <show_in_website>1</show_in_website>
@@ -1243,8 +1401,8 @@
1243
  <specificcountry translate="label">
1244
  <label>Payment from Specific countries</label>
1245
  <frontend_type>multiselect</frontend_type>
1246
- <config_path>payment/novalnetPaypal/specificcountry</config_path>
1247
- <sort_order>11</sort_order>
1248
  <source_model>adminhtml/system_config_source_country</source_model>
1249
  <show_in_default>1</show_in_default>
1250
  <show_in_website>1</show_in_website>
@@ -1253,14 +1411,12 @@
1253
  <allowspecific>1</allowspecific>
1254
  </depends>
1255
  </specificcountry>
1256
- <model>
1257
- </model>
1258
  <min_order_total translate="label">
1259
  <label>Novalnet Minimum Order Total</label>
1260
  <frontend_type>text</frontend_type>
 
1261
  <validate>validate-number</validate>
1262
- <config_path>payment/novalnetPaypal/min_order_total</config_path>
1263
- <sort_order>12</sort_order>
1264
  <show_in_default>1</show_in_default>
1265
  <show_in_website>1</show_in_website>
1266
  <show_in_store>1</show_in_store>
@@ -1268,9 +1424,9 @@
1268
  <max_order_total translate="label">
1269
  <label>Novalnet Maximum Order Total</label>
1270
  <frontend_type>text</frontend_type>
 
1271
  <validate>validate-number</validate>
1272
- <config_path>payment/novalnetPaypal/max_order_total</config_path>
1273
- <sort_order>13</sort_order>
1274
  <show_in_default>1</show_in_default>
1275
  <show_in_website>1</show_in_website>
1276
  <show_in_store>1</show_in_store>
@@ -1278,9 +1434,9 @@
1278
  <orderscount translate="label">
1279
  <label>Novalnet Minimum Orders Count</label>
1280
  <frontend_type>text</frontend_type>
 
 
1281
  <validate>validate-digits</validate>
1282
- <config_path>payment/novalnetPaypal/orderscount</config_path>
1283
- <sort_order>14</sort_order>
1284
  <comment>Novalnet Minimum Orders Count Desc</comment>
1285
  <show_in_default>1</show_in_default>
1286
  <show_in_website>1</show_in_website>
@@ -1290,29 +1446,29 @@
1290
  <label>Novalnet Sort Order</label>
1291
  <comment>Sort order of display. Lowest is displayed first.</comment>
1292
  <frontend_type>text</frontend_type>
 
1293
  <validate>validate-digits</validate>
1294
- <config_path>payment/novalnetPaypal/sort_order</config_path>
1295
- <sort_order>15</sort_order>
1296
  <show_in_default>1</show_in_default>
1297
  <show_in_website>1</show_in_website>
1298
  <show_in_store>1</show_in_store>
1299
  </sort_order>
1300
  </fields>
1301
- </novalnetPaypal>
1302
- <!--}}} Novalnet Paypal-->
1303
- <!--{{{ Novalnet Ideal-->
1304
- <novalnetIdeal translate="label" module="novalnet_payment">
1305
- <label>Novalnet iDEAL</label>
1306
  <frontend_type>text</frontend_type>
1307
- <sort_order>687</sort_order>
1308
  <show_in_default>1</show_in_default>
1309
  <show_in_website>1</show_in_website>
1310
  <show_in_store>1</show_in_store>
1311
  <fields>
1312
  <active translate="label">
1313
- <label>Enable Novalnet Module</label>
1314
  <frontend_type>select</frontend_type>
1315
- <config_path>payment/novalnetIdeal/active</config_path>
1316
  <source_model>adminhtml/system_config_source_yesno</source_model>
1317
  <sort_order>1</sort_order>
1318
  <show_in_default>1</show_in_default>
@@ -1320,9 +1476,9 @@
1320
  <show_in_store>1</show_in_store>
1321
  </active>
1322
  <title translate="label">
1323
- <label>Novalnet Title</label>
1324
  <frontend_type>text</frontend_type>
1325
- <config_path>payment/novalnetIdeal/title</config_path>
1326
  <validate>required-entry</validate>
1327
  <sort_order>2</sort_order>
1328
  <show_in_default>1</show_in_default>
@@ -1330,29 +1486,30 @@
1330
  <show_in_store>1</show_in_store>
1331
  </title>
1332
  <order_status translate="label">
1333
- <label>Order Status Before Payment</label>
1334
  <frontend_type>select</frontend_type>
1335
- <config_path>payment/novalnetIdeal/order_status</config_path>
1336
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
1337
  <sort_order>3</sort_order>
1338
  <show_in_default>1</show_in_default>
1339
  <show_in_website>1</show_in_website>
1340
  <show_in_store>1</show_in_store>
1341
  </order_status>
1342
  <order_status_after_payment translate="label">
1343
- <label>Order Status After Successful Payment</label>
1344
  <frontend_type>select</frontend_type>
1345
- <config_path>payment/novalnetIdeal/order_status_after_payment</config_path>
1346
  <source_model>adminhtml/system_config_source_order_status</source_model>
 
1347
  <sort_order>4</sort_order>
1348
  <show_in_default>1</show_in_default>
1349
  <show_in_website>1</show_in_website>
1350
  <show_in_store>1</show_in_store>
1351
  </order_status_after_payment>
1352
  <booking_reference translate="label">
1353
- <label>Information to the end customer (this will appear in the payment page)</label>
 
1354
  <frontend_type>text</frontend_type>
1355
- <config_path>payment/novalnetIdeal/booking_reference</config_path>
1356
  <sort_order>5</sort_order>
1357
  <show_in_default>1</show_in_default>
1358
  <show_in_website>1</show_in_website>
@@ -1360,9 +1517,9 @@
1360
  </booking_reference>
1361
  <reference_one translate="label">
1362
  <label>Transaction reference 1</label>
1363
- <comment>This will appear in the transactions details / account statement</comment>
1364
  <frontend_type>text</frontend_type>
1365
- <config_path>payment/novalnetIdeal/reference_one</config_path>
1366
  <sort_order>6</sort_order>
1367
  <show_in_default>1</show_in_default>
1368
  <show_in_website>1</show_in_website>
@@ -1370,40 +1527,30 @@
1370
  </reference_one>
1371
  <reference_two translate="label">
1372
  <label>Transaction reference 2</label>
1373
- <comment>This will appear in the transactions details / account statement</comment>
1374
  <frontend_type>text</frontend_type>
1375
- <config_path>payment/novalnetIdeal/reference_two</config_path>
1376
  <sort_order>7</sort_order>
1377
  <show_in_default>1</show_in_default>
1378
  <show_in_website>1</show_in_website>
1379
  <show_in_store>1</show_in_store>
1380
  </reference_two>
1381
  <user_group_excluded translate="label">
1382
- <comment>Excluded User Group Desc</comment>
1383
  <label>User Group Excluded</label>
 
1384
  <frontend_type>text</frontend_type>
1385
- <config_path>payment/novalnetIdeal/user_group_excluded</config_path>
1386
  <sort_order>8</sort_order>
1387
  <show_in_default>1</show_in_default>
1388
  <show_in_website>1</show_in_website>
1389
  <show_in_store>1</show_in_store>
1390
  </user_group_excluded>
1391
- <gateway_timeout translate="label">
1392
- <comment>Gateway Timeout in seconds</comment>
1393
- <label>Gateway Timeout</label>
1394
- <frontend_type>text</frontend_type>
1395
- <config_path>payment/novalnetIdeal/gateway_timeout</config_path>
1396
- <sort_order>9</sort_order>
1397
- <show_in_default>1</show_in_default>
1398
- <show_in_website>1</show_in_website>
1399
- <show_in_store>1</show_in_store>
1400
- </gateway_timeout>
1401
  <allowspecific translate="label">
1402
  <label>Payment from applicable countries</label>
1403
- <frontend_type>allowspecific</frontend_type>
1404
- <config_path>payment/novalnetIdeal/allowspecific</config_path>
1405
- <sort_order>10</sort_order>
1406
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
 
 
1407
  <show_in_default>1</show_in_default>
1408
  <show_in_website>1</show_in_website>
1409
  <show_in_store>1</show_in_store>
@@ -1411,9 +1558,9 @@
1411
  <specificcountry translate="label">
1412
  <label>Payment from Specific countries</label>
1413
  <frontend_type>multiselect</frontend_type>
1414
- <config_path>payment/novalnetIdeal/specificcountry</config_path>
1415
- <sort_order>11</sort_order>
1416
  <source_model>adminhtml/system_config_source_country</source_model>
 
 
1417
  <show_in_default>1</show_in_default>
1418
  <show_in_website>1</show_in_website>
1419
  <show_in_store>1</show_in_store>
@@ -1424,9 +1571,9 @@
1424
  <min_order_total translate="label">
1425
  <label>Novalnet Minimum Order Total</label>
1426
  <frontend_type>text</frontend_type>
 
1427
  <validate>validate-number</validate>
1428
- <config_path>payment/novalnetIdeal/min_order_total</config_path>
1429
- <sort_order>12</sort_order>
1430
  <show_in_default>1</show_in_default>
1431
  <show_in_website>1</show_in_website>
1432
  <show_in_store>1</show_in_store>
@@ -1434,20 +1581,20 @@
1434
  <max_order_total translate="label">
1435
  <label>Novalnet Maximum Order Total</label>
1436
  <frontend_type>text</frontend_type>
 
1437
  <validate>validate-number</validate>
1438
- <config_path>payment/novalnetIdeal/max_order_total</config_path>
1439
- <sort_order>13</sort_order>
1440
  <show_in_default>1</show_in_default>
1441
  <show_in_website>1</show_in_website>
1442
  <show_in_store>1</show_in_store>
1443
  </max_order_total>
1444
  <orderscount translate="label">
1445
  <label>Novalnet Minimum Orders Count</label>
 
1446
  <frontend_type>text</frontend_type>
 
1447
  <validate>validate-digits</validate>
1448
- <config_path>payment/novalnetIdeal/orderscount</config_path>
1449
- <sort_order>14</sort_order>
1450
- <comment>Novalnet Minimum Orders Count Desc</comment>
1451
  <show_in_default>1</show_in_default>
1452
  <show_in_website>1</show_in_website>
1453
  <show_in_store>1</show_in_store>
@@ -1456,26 +1603,26 @@
1456
  <label>Novalnet Sort Order</label>
1457
  <comment>Sort order of display. Lowest is displayed first.</comment>
1458
  <frontend_type>text</frontend_type>
 
1459
  <validate>validate-digits</validate>
1460
- <config_path>payment/novalnetIdeal/sort_order</config_path>
1461
- <sort_order>15</sort_order>
1462
  <show_in_default>1</show_in_default>
1463
  <show_in_website>1</show_in_website>
1464
  <show_in_store>1</show_in_store>
1465
  </sort_order>
1466
  </fields>
1467
- </novalnetIdeal>
1468
- <!--}}} Novalnet Ideal-->
1469
  </groups>
1470
  </novalnet_paymethods>
1471
- <!-- novalnet paymethods -->
1472
 
1473
  <!-- Fraud prevention -->
1474
  <fraud_prevent translate="label" module="novalnet_payment">
1475
  <label>Risk and Control</label>
1476
  <tab>novalnet</tab>
1477
  <frontend_type>text</frontend_type>
1478
- <sort_order>40</sort_order>
1479
  <show_in_default>1</show_in_default>
1480
  <show_in_website>1</show_in_website>
1481
  <show_in_store>1</show_in_store>
@@ -1484,27 +1631,28 @@
1484
  <label>Novalnet Credit Card</label>
1485
  <comment>Enable the payment Method and activate the Risk and Control option</comment>
1486
  <frontend_type>text</frontend_type>
1487
- <sort_order>10</sort_order>
1488
  <show_in_default>1</show_in_default>
1489
  <show_in_website>1</show_in_website>
1490
  <show_in_store>1</show_in_store>
1491
  <fields>
1492
  <callback translate="label">
1493
- <comment>PIN by Callback/SMS/E-Mail Desc</comment>
1494
- <label>Fraud prevention through PIN by Callback/SMS/E-Mail</label>
1495
  <frontend_type>select</frontend_type>
1496
- <config_path>payment/novalnetCc/callback</config_path>
1497
  <source_model>novalnet_payment/novalnet_source_callbacktypes</source_model>
 
1498
  <sort_order>1</sort_order>
1499
  <show_in_default>1</show_in_default>
1500
  <show_in_website>1</show_in_website>
1501
  <show_in_store>1</show_in_store>
1502
  </callback>
1503
  <callback_minimum_amount>
1504
- <label>Minimum Amount For Callback (in cents)</label>
 
1505
  <frontend_type>text</frontend_type>
1506
- <validate>validate-digits</validate>
1507
  <config_path>payment/novalnetCc/callback_minimum_amount</config_path>
 
1508
  <sort_order>2</sort_order>
1509
  <show_in_default>1</show_in_default>
1510
  <show_in_website>1</show_in_website>
@@ -1512,71 +1660,72 @@
1512
  </callback_minimum_amount>
1513
  </fields>
1514
  </novalnetCc>
1515
- <novalnetSepa translate="label" module="novalnet_payment">
1516
- <label>Novalnet Direct Debit SEPA</label>
1517
  <comment>Enable the payment Method and activate the Risk and Control option</comment>
1518
  <frontend_type>text</frontend_type>
1519
- <sort_order>11</sort_order>
1520
  <show_in_default>1</show_in_default>
1521
  <show_in_website>1</show_in_website>
1522
  <show_in_store>1</show_in_store>
1523
  <fields>
1524
  <callback translate="label">
1525
- <comment>PIN by Callback/SMS/E-Mail Desc</comment>
1526
- <label>Fraud prevention through PIN by Callback/SMS/E-Mail</label>
1527
  <frontend_type>select</frontend_type>
1528
- <config_path>payment/novalnetSepa/callback</config_path>
1529
  <source_model>novalnet_payment/novalnet_source_callbacktypes</source_model>
 
1530
  <sort_order>1</sort_order>
1531
  <show_in_default>1</show_in_default>
1532
  <show_in_website>1</show_in_website>
1533
  <show_in_store>1</show_in_store>
1534
  </callback>
1535
  <callback_minimum_amount>
1536
- <label>Minimum Amount For Callback (in cents)</label>
 
1537
  <frontend_type>text</frontend_type>
 
1538
  <validate>validate-digits</validate>
1539
- <config_path>payment/novalnetSepa/callback_minimum_amount</config_path>
1540
  <sort_order>2</sort_order>
1541
  <show_in_default>1</show_in_default>
1542
  <show_in_website>1</show_in_website>
1543
  <show_in_store>1</show_in_store>
1544
  </callback_minimum_amount>
1545
  </fields>
1546
- </novalnetSepa>
1547
- <novalnetInvoice translate="label" module="novalnet_payment">
1548
- <label>Novalnet Invoice</label>
1549
  <comment>Enable the payment Method and activate the Risk and Control option</comment>
1550
  <frontend_type>text</frontend_type>
1551
- <sort_order>12</sort_order>
1552
  <show_in_default>1</show_in_default>
1553
  <show_in_website>1</show_in_website>
1554
  <show_in_store>1</show_in_store>
1555
  <fields>
1556
  <callback translate="label">
1557
- <comment>PIN by Callback/SMS/E-Mail Desc</comment>
1558
- <label>Fraud prevention through PIN by Callback/SMS/E-Mail</label>
1559
  <frontend_type>select</frontend_type>
1560
- <config_path>payment/novalnetInvoice/callback</config_path>
1561
  <source_model>novalnet_payment/novalnet_source_callbacktypes</source_model>
 
1562
  <sort_order>1</sort_order>
1563
  <show_in_default>1</show_in_default>
1564
  <show_in_website>1</show_in_website>
1565
  <show_in_store>1</show_in_store>
1566
  </callback>
1567
  <callback_minimum_amount>
1568
- <label>Minimum Amount For Callback (in cents)</label>
 
1569
  <frontend_type>text</frontend_type>
 
1570
  <validate>validate-digits</validate>
1571
- <config_path>payment/novalnetInvoice/callback_minimum_amount</config_path>
1572
  <sort_order>2</sort_order>
1573
  <show_in_default>1</show_in_default>
1574
  <show_in_website>1</show_in_website>
1575
  <show_in_store>1</show_in_store>
1576
  </callback_minimum_amount>
1577
-
1578
  </fields>
1579
- </novalnetInvoice>
1580
  </groups>
1581
  </fraud_prevent>
1582
  <!-- Fraud prevention -->
13
  * obtain it through the world-wide-web, please send an email
14
  * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
+ * Part of the payment module of Novalnet AG
17
  * https://www.novalnet.de
18
  * If you have found this script useful a small
19
  * recommendation as well as a comment on merchant form
40
  <label>General</label>
41
  <tab>novalnet</tab>
42
  <frontend_type>text</frontend_type>
43
+ <sort_order>1</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
47
  <groups>
48
  <novalnet translate="label" module="novalnet_payment">
49
+ <label>Novalnet Payment Configuration</label>
50
  <frontend_type>text</frontend_type>
51
+ <sort_order>1</sort_order>
52
  <show_in_default>1</show_in_default>
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>1</show_in_store>
55
  <fields>
56
  <merchant_id translate="label">
57
  <label>Novalnet Merchant ID</label>
58
+ <comment>Enter Novalnet merchant ID</comment>
59
  <frontend_type>text</frontend_type>
60
  <validate>required-entry validate-digits</validate>
61
+ <sort_order>1</sort_order>
62
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  </merchant_id>
66
  <auth_code translate="label">
67
+ <label>Authentication code</label>
68
+ <comment>Enter Novalnet authentication code</comment>
69
  <frontend_type>text</frontend_type>
70
+ <sort_order>2</sort_order>
71
  <validate>required-entry</validate>
 
72
  <show_in_default>1</show_in_default>
73
  <show_in_website>1</show_in_website>
74
  <show_in_store>1</show_in_store>
75
  </auth_code>
76
  <product_id translate="label">
77
+ <label>Project ID</label>
78
+ <comment>Enter Novalnet project ID</comment>
79
  <frontend_type>text</frontend_type>
80
+ <sort_order>3</sort_order>
81
  <validate>required-entry validate-digits</validate>
 
82
  <show_in_default>1</show_in_default>
83
  <show_in_website>1</show_in_website>
84
  <show_in_store>1</show_in_store>
85
  </product_id>
86
  <tariff_id translate="label">
87
+ <label>Tariff ID</label>
88
+ <comment>Enter Novalnet tariff ID</comment>
89
  <frontend_type>text</frontend_type>
90
+ <sort_order>4</sort_order>
91
  <validate>required-entry validate-digits</validate>
 
92
  <show_in_default>1</show_in_default>
93
  <show_in_website>1</show_in_website>
94
  <show_in_store>1</show_in_store>
95
  </tariff_id>
96
+ <subscrib_tariff_id translate="label">
97
+ <label>Subscription Tariff ID</label>
98
+ <comment>Enter Novalnet subscription tariff ID</comment>
99
+ <frontend_type>text</frontend_type>
100
+ <sort_order>5</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>1</show_in_store>
104
+ </subscrib_tariff_id>
105
  <password translate="label">
106
+ <label>Payment access key</label>
107
+ <comment>Enter the Novalnet payment access key</comment>
108
  <frontend_type>text</frontend_type>
109
+ <sort_order>6</sort_order>
110
  <show_in_default>1</show_in_default>
111
  <show_in_website>1</show_in_website>
112
  <show_in_store>1</show_in_store>
113
  </password>
114
+ <manual_checking_amount tranlate="label" >
115
+ <label>Set a limit for on-hold transaction</label>
116
+ <comment>Manual checking of order description</comment>
117
+ <frontend_type>text</frontend_type>
118
+ <validate>validate-greater-than-zero validate-digits</validate>
119
+ <sort_order>7</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ </manual_checking_amount>
124
  <live_mode translate="label">
125
  <label>Novalnet Live Mode</label>
126
  <comment>Selected payment methods will be in Live Mode</comment>
127
  <frontend_type>multiselect</frontend_type>
128
  <source_model>novalnet_payment/system_config_activemethods</source_model>
129
  <can_be_empty>1</can_be_empty>
130
+ <sort_order>8</sort_order>
131
  <show_in_default>1</show_in_default>
132
  <show_in_website>1</show_in_website>
133
  <show_in_store>1</show_in_store>
134
  </live_mode>
135
+ <referrer_id translate="label">
136
+ <label>Referrer ID</label>
137
+ <comment>Referrer id description</comment>
138
  <frontend_type>text</frontend_type>
139
+ <sort_order>9</sort_order>
140
+ <validate>validate-digits</validate>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
143
  <show_in_store>1</show_in_store>
144
+ </referrer_id>
145
+ <auto_refill translate="label">
146
+ <label>Enable auto-fill</label>
147
+ <comment>Autofill description</comment>
148
+ <frontend_type>select</frontend_type>
149
+ <source_model>adminhtml/system_config_source_yesno</source_model>
150
+ <sort_order>10</sort_order>
151
  <show_in_default>1</show_in_default>
152
  <show_in_website>1</show_in_website>
153
  <show_in_store>1</show_in_store>
154
+ </auto_refill>
155
+ <payment_last_success translate="label">
156
+ <label>Enable default payment method</label>
157
+ <comment>Payment last success description</comment>
158
+ <frontend_type>select</frontend_type>
159
+ <source_model>adminhtml/system_config_source_yesno</source_model>
160
+ <sort_order>11</sort_order>
161
+ <show_in_default>1</show_in_default>
162
+ </payment_last_success>
163
+ <use_proxy translate="label">
164
+ <label>Use Proxy</label>
165
+ <frontend_type>select</frontend_type>
166
+ <source_model>adminhtml/system_config_source_yesno</source_model>
167
+ <sort_order>12</sort_order>
168
+ <show_in_default>1</show_in_default>
169
+ <show_in_website>1</show_in_website>
170
+ <shared>1</shared>
171
+ </use_proxy>
172
+ <proxy_host translate="label">
173
+ <label>Proxy Host</label>
174
+ <frontend_type>text</frontend_type>
175
+ <sort_order>13</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <depends><use_proxy>1</use_proxy></depends>
179
+ <shared>1</shared>
180
+ </proxy_host>
181
+ <proxy_port translate="label">
182
+ <label>Proxy Port</label>
183
  <frontend_type>text</frontend_type>
184
+ <sort_order>14</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <depends><use_proxy>1</use_proxy></depends>
188
+ <shared>1</shared>
189
+ </proxy_port>
190
+ <order_status translate="label">
191
+ <label>OnHold transaction completion status</label>
192
+ <frontend_type>select</frontend_type>
193
+ <source_model>adminhtml/system_config_source_order_status</source_model>
194
+ <sort_order>15</sort_order>
195
  <show_in_default>1</show_in_default>
196
  <show_in_website>1</show_in_website>
197
  <show_in_store>1</show_in_store>
198
+ </order_status>
199
+ <void_status translate="label">
200
+ <label>OnHold cancellation / VOID Transaction status</label>
201
+ <frontend_type>select</frontend_type>
202
+ <source_model>adminhtml/system_config_source_order_status</source_model>
203
+ <sort_order>16</sort_order>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>1</show_in_website>
206
+ <show_in_store>1</show_in_store>
207
+ </void_status>
208
+ <gateway_timeout translate="label">
209
+ <label>Gateway timeout</label>
210
+ <comment>Gateway timeout description</comment>
211
  <frontend_type>text</frontend_type>
212
+ <validate>validate-digits</validate>
213
+ <sort_order>17</sort_order>
214
  <show_in_default>1</show_in_default>
215
  <show_in_website>1</show_in_website>
216
  <show_in_store>1</show_in_store>
217
+ </gateway_timeout>
218
  </fields>
219
  </novalnet>
220
+ <novalnetsetting translate="label" module="novalnet_payment">
221
+ <label>Merchant script management</label>
222
+ <frontend_type>text</frontend_type>
223
+ <sort_order>2</sort_order>
224
+ <show_in_default>1</show_in_default>
225
+ <show_in_website>1</show_in_website>
226
+ <show_in_store>1</show_in_store>
227
+ <fields>
228
+ <enabledebugmode translate="label">
229
+ <label>Enable debug mode</label>
230
+ <comment>Debug mode description</comment>
231
+ <frontend_type>select</frontend_type>
232
+ <config_path>payment/novalnetcallback/enabledebugmode</config_path>
233
+ <source_model>adminhtml/system_config_source_yesno</source_model>
234
+ <sort_order>1</sort_order>
235
+ <show_in_default>1</show_in_default>
236
+ </enabledebugmode>
237
+ <enabletestmode translate="label">
238
+ <label>Enable test mode</label>
239
+ <comment>Test mode description</comment>
240
+ <frontend_type>select</frontend_type>
241
+ <config_path>payment/novalnetcallback/enabletestmode</config_path>
242
+ <source_model>adminhtml/system_config_source_yesno</source_model>
243
+ <sort_order>2</sort_order>
244
+ <show_in_default>1</show_in_default>
245
+ </enabletestmode>
246
+ <emailsendoption translate="label">
247
+ <label>Enable E-mail notification for callback</label>
248
+ <frontend_type>select</frontend_type>
249
+ <config_path>payment/novalnetcallback/emailsendoption</config_path>
250
+ <source_model>adminhtml/system_config_source_yesno</source_model>
251
+ <sort_order>3</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ </emailsendoption>
256
+ <emailtoaddr translate="label">
257
+ <label>E-mail To Address</label>
258
+ <comment>Email To address description</comment>
259
+ <frontend_type>text</frontend_type>
260
+ <config_path>payment/novalnetcallback/emailtoaddr</config_path>
261
+ <sort_order>4</sort_order>
262
+ <show_in_default>1</show_in_default>
263
+ <show_in_website>1</show_in_website>
264
+ <show_in_store>1</show_in_store>
265
+ </emailtoaddr>
266
+ <emailBcc translate="label">
267
+ <label>E-mail Bcc Address</label>
268
+ <comment>Email Bcc address description</comment>
269
+ <frontend_type>text</frontend_type>
270
+ <config_path>payment/novalnetcallback/emailBcc</config_path>
271
+ <sort_order>5</sort_order>
272
+ <show_in_default>1</show_in_default>
273
+ <show_in_website>1</show_in_website>
274
+ <show_in_store>1</show_in_store>
275
+ </emailBcc>
276
+ </fields>
277
+ </novalnetsetting>
278
  </groups>
279
  </novalnet_global>
280
  <!--}}} Global tab-->
281
+ <!-- Novalnet payment methods -->
282
  <novalnet_paymethods translate="label" module="novalnet_payment">
283
  <label>Payment Methods</label>
284
  <tab>novalnet</tab>
285
  <frontend_type>text</frontend_type>
286
+ <sort_order>2</sort_order>
287
  <show_in_default>1</show_in_default>
288
  <show_in_website>1</show_in_website>
289
  <show_in_store>1</show_in_store>
291
  <!--{{{ Novalnet Credit Card-->
292
  <novalnetCc translate="label" module="novalnet_payment">
293
  <label>Novalnet Credit Card</label>
294
+ <sort_order>1</sort_order>
295
  <show_in_default>1</show_in_default>
296
  <show_in_website>1</show_in_website>
297
  <show_in_store>1</show_in_store>
298
  <fields>
299
  <active translate="label">
300
+ <label>Enable module</label>
301
  <frontend_type>select</frontend_type>
302
  <source_model>adminhtml/system_config_source_yesno</source_model>
303
  <config_path>payment/novalnetCc/active</config_path>
307
  <show_in_store>1</show_in_store>
308
  </active>
309
  <title translate="label">
310
+ <label>Title</label>
311
  <frontend_type>text</frontend_type>
312
  <config_path>payment/novalnetCc/title</config_path>
313
  <validate>required-entry</validate>
316
  <show_in_website>1</show_in_website>
317
  <show_in_store>1</show_in_store>
318
  </title>
319
+ <active_cc3d translate="label">
320
+ <label>Enable 3D secure</label>
321
+ <comment>CC-3D secure description</comment>
322
+ <frontend_type>select</frontend_type>
323
+ <source_model>adminhtml/system_config_source_yesno</source_model>
324
+ <config_path>payment/novalnetCc/active_cc3d</config_path>
325
+ <sort_order>3</sort_order>
326
+ <show_in_default>1</show_in_default>
327
+ <show_in_website>1</show_in_website>
328
+ <show_in_store>1</show_in_store>
329
+ </active_cc3d>
330
  <order_status translate="label">
331
+ <label>Order completion status</label>
332
  <frontend_type>select</frontend_type>
333
  <config_path>payment/novalnetCc/order_status</config_path>
334
  <source_model>adminhtml/system_config_source_order_status</source_model>
335
+ <sort_order>4</sort_order>
336
  <show_in_default>1</show_in_default>
337
  <show_in_website>1</show_in_website>
338
  <show_in_store>1</show_in_store>
341
  </depends>
342
  </order_status>
343
  <order_status_before_payment translate="label">
344
+ <label>Order status for the pending payment</label>
345
  <frontend_type>select</frontend_type>
346
  <config_path>payment/novalnetCc/order_status</config_path>
347
  <source_model>adminhtml/system_config_source_order_status</source_model>
348
+ <sort_order>5</sort_order>
349
  <show_in_default>1</show_in_default>
350
  <show_in_website>1</show_in_website>
351
  <show_in_store>1</show_in_store>
354
  </depends>
355
  </order_status_before_payment>
356
  <order_status_after_payment translate="label">
357
+ <label>Order completion status</label>
358
  <frontend_type>select</frontend_type>
359
  <config_path>payment/novalnetCc/order_status_after_payment</config_path>
360
  <source_model>adminhtml/system_config_source_order_status</source_model>
361
+ <sort_order>6</sort_order>
362
  <show_in_default>1</show_in_default>
363
  <show_in_website>1</show_in_website>
364
  <show_in_store>1</show_in_store>
370
  <label>Credit Card Types</label>
371
  <frontend_type>multiselect</frontend_type>
372
  <config_path>payment/novalnetCc/cctypes</config_path>
373
+ <source_model>novalnet_payment/novalnet_source_cctype</source_model>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  <sort_order>7</sort_order>
375
  <show_in_default>1</show_in_default>
376
  <show_in_website>1</show_in_website>
377
  <show_in_store>1</show_in_store>
378
+ </cctypes>
379
+ <cc_valid_year translate="label">
380
+ <label>Limit for expiry year</label>
381
+ <comment>Limit for expiry year description</comment>
382
  <frontend_type>text</frontend_type>
383
+ <validate>validate-number validate-greater-than-zero</validate>
384
+ <config_path>payment/novalnetCc/cc_valid_year</config_path>
385
  <sort_order>8</sort_order>
386
  <show_in_default>1</show_in_default>
387
  <show_in_website>1</show_in_website>
388
  <show_in_store>1</show_in_store>
389
+ </cc_valid_year>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  <reference_one translate="label">
391
  <label>Transaction reference 1</label>
392
+ <comment>This reference will appear in your bank account statement</comment>
393
  <frontend_type>text</frontend_type>
394
  <config_path>payment/novalnetCc/reference_one</config_path>
395
+ <sort_order>9</sort_order>
396
  <show_in_default>1</show_in_default>
397
  <show_in_website>1</show_in_website>
398
  <show_in_store>1</show_in_store>
399
  </reference_one>
400
  <reference_two translate="label">
401
  <label>Transaction reference 2</label>
402
+ <comment>This reference will appear in your bank account statement</comment>
403
  <frontend_type>text</frontend_type>
404
  <config_path>payment/novalnetCc/reference_two</config_path>
405
+ <sort_order>10</sort_order>
406
  <show_in_default>1</show_in_default>
407
  <show_in_website>1</show_in_website>
408
  <show_in_store>1</show_in_store>
409
  </reference_two>
410
  <booking_reference translate="label">
411
+ <label>Notification for the buyer</label>
412
+ <comment>The entered text will be displayed on the checkout page</comment>
413
  <frontend_type>text</frontend_type>
414
  <config_path>payment/novalnetCc/booking_reference</config_path>
415
+ <sort_order>11</sort_order>
416
  <show_in_default>1</show_in_default>
417
  <show_in_website>1</show_in_website>
418
  <show_in_store>1</show_in_store>
419
  </booking_reference>
420
  <user_group_excluded translate="label">
 
421
  <label>User Group Excluded</label>
422
+ <comment>Excluded User Group description</comment>
423
  <frontend_type>text</frontend_type>
424
  <config_path>payment/novalnetCc/user_group_excluded</config_path>
425
+ <sort_order>12</sort_order>
426
  <show_in_default>1</show_in_default>
427
  <show_in_website>1</show_in_website>
428
  <show_in_store>1</show_in_store>
429
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
430
  <allowspecific translate="label">
431
  <label>Payment from applicable countries</label>
432
+ <frontend_type>select</frontend_type>
433
  <config_path>payment/novalnetCc/allowspecific</config_path>
434
+ <sort_order>13</sort_order>
435
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
436
  <show_in_default>1</show_in_default>
437
  <show_in_website>1</show_in_website>
441
  <label>Payment from Specific countries</label>
442
  <frontend_type>multiselect</frontend_type>
443
  <config_path>payment/novalnetCc/specificcountry</config_path>
444
+ <sort_order>14</sort_order>
445
  <source_model>adminhtml/system_config_source_country</source_model>
446
  <show_in_default>1</show_in_default>
447
  <show_in_website>1</show_in_website>
454
  <label>Novalnet Minimum Order Total</label>
455
  <frontend_type>text</frontend_type>
456
  <config_path>payment/novalnetCc/min_order_total</config_path>
457
+ <validate>validate-number</validate>
458
+ <sort_order>15</sort_order>
459
  <show_in_default>1</show_in_default>
460
  <show_in_website>1</show_in_website>
461
  <show_in_store>1</show_in_store>
464
  <label>Novalnet Maximum Order Total</label>
465
  <frontend_type>text</frontend_type>
466
  <config_path>payment/novalnetCc/max_order_total</config_path>
467
+ <sort_order>16</sort_order>
468
+ <validate>validate-number</validate>
469
  <show_in_default>1</show_in_default>
470
  <show_in_website>1</show_in_website>
471
  <show_in_store>1</show_in_store>
474
  <label>Novalnet Minimum Orders Count</label>
475
  <frontend_type>text</frontend_type>
476
  <config_path>payment/novalnetCc/orderscount</config_path>
477
+ <validate>validate-digits</validate>
478
+ <sort_order>17</sort_order>
479
  <comment>Novalnet Minimum Orders Count Desc</comment>
480
  <show_in_default>1</show_in_default>
481
  <show_in_website>1</show_in_website>
486
  <comment>Sort order of display. Lowest is displayed first.</comment>
487
  <frontend_type>text</frontend_type>
488
  <config_path>payment/novalnetCc/sort_order</config_path>
489
+ <validate>validate-digits</validate>
490
+ <sort_order>18</sort_order>
491
  <show_in_default>1</show_in_default>
492
  <show_in_website>1</show_in_website>
493
  <show_in_store>1</show_in_store>
498
  <!--{{{ Novalnet SEPA-->
499
  <novalnetSepa translate="label" module="novalnet_payment">
500
  <label>Novalnet Direct Debit SEPA</label>
501
+ <sort_order>2</sort_order>
502
  <show_in_default>1</show_in_default>
503
  <show_in_website>1</show_in_website>
504
  <show_in_store>1</show_in_store>
505
  <fields>
506
  <active translate="label">
507
+ <label>Enable module</label>
508
  <frontend_type>select</frontend_type>
509
  <source_model>adminhtml/system_config_source_yesno</source_model>
510
  <config_path>payment/novalnetSepa/active</config_path>
514
  <show_in_store>1</show_in_store>
515
  </active>
516
  <title translate="label">
517
+ <label>Title</label>
518
  <frontend_type>text</frontend_type>
519
  <config_path>payment/novalnetSepa/title</config_path>
520
  <validate>required-entry</validate>
524
  <show_in_store>1</show_in_store>
525
  </title>
526
  <order_status translate="label">
527
+ <label>Order completion status</label>
528
  <frontend_type>select</frontend_type>
 
529
  <source_model>adminhtml/system_config_source_order_status</source_model>
530
+ <config_path>payment/novalnetSepa/order_status</config_path>
531
  <sort_order>3</sort_order>
532
  <show_in_default>1</show_in_default>
533
  <show_in_website>1</show_in_website>
534
  <show_in_store>1</show_in_store>
535
  </order_status>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  <sepa_duedate translate="label">
537
  <label>SEPA Payment duration in days</label>
538
+ <comment>SEPA Payment duration in days description</comment>
539
  <frontend_type>text</frontend_type>
 
540
  <config_path>payment/novalnetSepa/sepa_due_date</config_path>
541
+ <validate>validate-digits validate-greater-than-zero</validate>
542
+ <sort_order>4</sort_order>
543
  <show_in_default>1</show_in_default>
544
  <show_in_website>1</show_in_website>
545
  <show_in_store>1</show_in_store>
546
  </sepa_duedate>
547
+ <sepa_payment_refill translate="label">
548
+ <label>Enable auto-fill for payment data</label>
549
+ <comment>Enable auto-fill for payment data description</comment>
550
  <frontend_type>select</frontend_type>
551
  <source_model>adminhtml/system_config_source_yesno</source_model>
552
+ <config_path>payment/novalnetSepa/sepa_payment_refill</config_path>
553
+ <sort_order>5</sort_order>
554
  <show_in_default>1</show_in_default>
555
  <show_in_website>1</show_in_website>
556
  <show_in_store>1</show_in_store>
557
+ </sepa_payment_refill>
558
  <reference_one translate="label">
559
  <label>Transaction reference 1</label>
560
+ <comment>This reference will appear in your bank account statement</comment>
561
  <frontend_type>text</frontend_type>
562
  <config_path>payment/novalnetSepa/reference_one</config_path>
563
+ <sort_order>6</sort_order>
564
  <show_in_default>1</show_in_default>
565
  <show_in_website>1</show_in_website>
566
  <show_in_store>1</show_in_store>
567
  </reference_one>
568
  <reference_two translate="label">
569
  <label>Transaction reference 2</label>
570
+ <comment>This reference will appear in your bank account statement</comment>
571
  <frontend_type>text</frontend_type>
572
  <config_path>payment/novalnetSepa/reference_two</config_path>
573
+ <sort_order>7</sort_order>
574
  <show_in_default>1</show_in_default>
575
  <show_in_website>1</show_in_website>
576
  <show_in_store>1</show_in_store>
577
  </reference_two>
578
  <booking_reference translate="label">
579
+ <label>Notification for the buyer</label>
580
+ <comment>The entered text will be displayed on the checkout page</comment>
581
  <frontend_type>text</frontend_type>
582
  <config_path>payment/novalnetSepa/booking_reference</config_path>
583
+ <sort_order>8</sort_order>
584
  <show_in_default>1</show_in_default>
585
  <show_in_website>1</show_in_website>
586
  <show_in_store>1</show_in_store>
587
  </booking_reference>
588
  <user_group_excluded translate="label">
 
589
  <label>User Group Excluded</label>
590
+ <comment>Excluded User Group description</comment>
591
  <frontend_type>text</frontend_type>
592
  <config_path>payment/novalnetSepa/user_group_excluded</config_path>
593
+ <sort_order>9</sort_order>
594
  <show_in_default>1</show_in_default>
595
  <show_in_website>1</show_in_website>
596
  <show_in_store>1</show_in_store>
597
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
598
  <allowspecific translate="label">
599
  <label>Payment from applicable countries</label>
600
+ <frontend_type>select</frontend_type>
601
  <config_path>payment/novalnetSepa/allowspecific</config_path>
602
+ <sort_order>10</sort_order>
603
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
604
  <show_in_default>1</show_in_default>
605
  <show_in_website>1</show_in_website>
609
  <label>Payment from Specific countries</label>
610
  <frontend_type>multiselect</frontend_type>
611
  <config_path>payment/novalnetSepa/specificcountry</config_path>
612
+ <sort_order>11</sort_order>
613
  <source_model>adminhtml/system_config_source_country</source_model>
614
  <show_in_default>1</show_in_default>
615
  <show_in_website>1</show_in_website>
622
  <label>Novalnet Minimum Order Total</label>
623
  <frontend_type>text</frontend_type>
624
  <config_path>payment/novalnetSepa/min_order_total</config_path>
625
+ <validate>validate-number</validate>
626
+ <sort_order>12</sort_order>
627
  <show_in_default>1</show_in_default>
628
  <show_in_website>1</show_in_website>
629
  <show_in_store>1</show_in_store>
632
  <label>Novalnet Maximum Order Total</label>
633
  <frontend_type>text</frontend_type>
634
  <config_path>payment/novalnetSepa/max_order_total</config_path>
635
+ <validate>validate-number</validate>
636
+ <sort_order>13</sort_order>
637
  <show_in_default>1</show_in_default>
638
  <show_in_website>1</show_in_website>
639
  <show_in_store>1</show_in_store>
640
  </max_order_total>
641
  <orderscount translate="label">
642
  <label>Novalnet Minimum Orders Count</label>
643
+ <comment>Novalnet Minimum Orders Count Desc</comment>
644
  <frontend_type>text</frontend_type>
645
  <config_path>payment/novalnetSepa/orderscount</config_path>
646
+ <validate>validate-digits</validate>
647
+ <sort_order>14</sort_order>
648
  <show_in_default>1</show_in_default>
649
  <show_in_website>1</show_in_website>
650
  <show_in_store>1</show_in_store>
654
  <comment>Sort order of display. Lowest is displayed first.</comment>
655
  <frontend_type>text</frontend_type>
656
  <config_path>payment/novalnetSepa/sort_order</config_path>
657
+ <validate>validate-digits</validate>
658
+ <sort_order>15</sort_order>
659
  <show_in_default>1</show_in_default>
660
  <show_in_website>1</show_in_website>
661
  <show_in_store>1</show_in_store>
666
  <!--{{{ Novalnet Invoice-->
667
  <novalnetInvoice translate="label" module="novalnet_payment">
668
  <label>Novalnet Invoice</label>
669
+ <sort_order>3</sort_order>
670
  <show_in_default>1</show_in_default>
671
  <show_in_website>1</show_in_website>
672
  <show_in_store>1</show_in_store>
673
  <fields>
674
  <active translate="label">
675
+ <label>Enable module</label>
676
  <frontend_type>select</frontend_type>
677
  <config_path>payment/novalnetInvoice/active</config_path>
678
  <source_model>adminhtml/system_config_source_yesno</source_model>
682
  <show_in_store>1</show_in_store>
683
  </active>
684
  <title translate="label">
685
+ <label>Title</label>
686
  <frontend_type>text</frontend_type>
687
  <config_path>payment/novalnetInvoice/title</config_path>
688
  <validate>required-entry</validate>
692
  <show_in_store>1</show_in_store>
693
  </title>
694
  <order_status translate="label">
695
+ <label>Order completion status</label>
696
  <frontend_type>select</frontend_type>
697
  <config_path>payment/novalnetInvoice/order_status</config_path>
698
  <source_model>adminhtml/system_config_source_order_status</source_model>
702
  <show_in_store>1</show_in_store>
703
  </order_status>
704
  <order_status_after_payment translate="label">
705
+ <label>Callback order status</label>
706
  <frontend_type>select</frontend_type>
707
  <config_path>payment/novalnetInvoice/order_status_after_payment</config_path>
708
  <source_model>adminhtml/system_config_source_order_status</source_model>
712
  <show_in_store>1</show_in_store>
713
  </order_status_after_payment>
714
  <booking_reference translate="label">
715
+ <label>Notification for the buyer</label>
716
+ <comment>The entered text will be displayed on the checkout page</comment>
717
  <frontend_type>text</frontend_type>
718
  <config_path>payment/novalnetInvoice/booking_reference</config_path>
719
  <sort_order>5</sort_order>
723
  </booking_reference>
724
  <reference_one translate="label">
725
  <label>Transaction reference 1</label>
726
+ <comment>This reference will appear in your bank account statement</comment>
727
  <frontend_type>text</frontend_type>
728
  <config_path>payment/novalnetInvoice/reference_one</config_path>
729
  <sort_order>6</sort_order>
733
  </reference_one>
734
  <reference_two translate="label">
735
  <label>Transaction reference 2</label>
736
+ <comment>This reference will appear in your bank account statement</comment>
737
  <frontend_type>text</frontend_type>
738
  <config_path>payment/novalnetInvoice/reference_two</config_path>
739
  <sort_order>7</sort_order>
742
  <show_in_store>1</show_in_store>
743
  </reference_two>
744
  <payment_duration translate="label">
745
+ <label>Invoice payment duration</label>
746
+ <comment>Invoice payment duration description</comment>
747
+ <frontend_type>text</frontend_type>
748
+ <validate>validate-digits</validate>
749
+ <config_path>payment/novalnetInvoice/payment_duration</config_path>
750
+ <sort_order>8</sort_order>
751
+ <show_in_default>1</show_in_default>
752
+ <show_in_website>1</show_in_website>
753
+ <show_in_store>1</show_in_store>
754
+ </payment_duration>
755
+ <user_group_excluded translate="label">
756
+ <label>User Group Excluded</label>
757
+ <comment>Excluded User Group description</comment>
758
+ <frontend_type>text</frontend_type>
759
+ <config_path>payment/novalnetInvoice/user_group_excluded</config_path>
760
+ <sort_order>9</sort_order>
761
+ <show_in_default>1</show_in_default>
762
+ <show_in_website>1</show_in_website>
763
+ <show_in_store>1</show_in_store>
764
+ </user_group_excluded>
765
+ <allowspecific translate="label">
766
+ <label>Payment from applicable countries</label>
767
+ <frontend_type>select</frontend_type>
768
+ <config_path>payment/novalnetInvoice/allowspecific</config_path>
769
+ <sort_order>10</sort_order>
770
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
771
+ <show_in_default>1</show_in_default>
772
+ <show_in_website>1</show_in_website>
773
+ <show_in_store>1</show_in_store>
774
+ </allowspecific>
775
+ <specificcountry translate="label">
776
+ <label>Payment from Specific countries</label>
777
+ <frontend_type>multiselect</frontend_type>
778
+ <config_path>payment/novalnetInvoice/specificcountry</config_path>
779
+ <sort_order>11</sort_order>
780
+ <source_model>adminhtml/system_config_source_country</source_model>
781
+ <show_in_default>1</show_in_default>
782
+ <show_in_website>1</show_in_website>
783
+ <show_in_store>1</show_in_store>
784
+ <depends>
785
+ <allowspecific>1</allowspecific>
786
+ </depends>
787
+ </specificcountry>
788
+ <min_order_total translate="label">
789
+ <label>Novalnet Minimum Order Total</label>
790
+ <frontend_type>text</frontend_type>
791
+ <config_path>payment/novalnetInvoice/min_order_total</config_path>
792
+ <validate>validate-number</validate>
793
+ <sort_order>12</sort_order>
794
+ <show_in_default>1</show_in_default>
795
+ <show_in_website>1</show_in_website>
796
+ <show_in_store>1</show_in_store>
797
+ </min_order_total>
798
+ <max_order_total translate="label">
799
+ <label>Novalnet Maximum Order Total</label>
800
+ <frontend_type>text</frontend_type>
801
+ <config_path>payment/novalnetInvoice/max_order_total</config_path>
802
+ <validate>validate-number</validate>
803
+ <sort_order>13</sort_order>
804
+ <show_in_default>1</show_in_default>
805
+ <show_in_website>1</show_in_website>
806
+ <show_in_store>1</show_in_store>
807
+ </max_order_total>
808
+ <orderscount translate="label">
809
+ <label>Novalnet Minimum Orders Count</label>
810
+ <comment>Novalnet Minimum Orders Count Desc</comment>
811
+ <frontend_type>text</frontend_type>
812
+ <config_path>payment/novalnetInvoice/orderscount</config_path>
813
+ <validate>validate-digits</validate>
814
+ <sort_order>14</sort_order>
815
+ <show_in_default>1</show_in_default>
816
+ <show_in_website>1</show_in_website>
817
+ <show_in_store>1</show_in_store>
818
+ </orderscount>
819
+ <sort_order translate="label">
820
+ <label>Novalnet Sort Order</label>
821
+ <comment>Sort order of display. Lowest is displayed first.</comment>
822
+ <frontend_type>text</frontend_type>
823
+ <config_path>payment/novalnetInvoice/sort_order</config_path>
824
+ <validate>validate-digits</validate>
825
+ <sort_order>15</sort_order>
826
+ <show_in_default>1</show_in_default>
827
+ <show_in_website>1</show_in_website>
828
+ <show_in_store>1</show_in_store>
829
+ </sort_order>
830
+ </fields>
831
+ </novalnetInvoice>
832
+ <!--}}} Novalnet Invoice-->
833
+ <!--{{{ Novalnet Prepayment-->
834
+ <novalnetPrepayment translate="label" module="novalnet_payment">
835
+ <label>Novalnet Prepayment</label>
836
+ <sort_order>4</sort_order>
837
+ <show_in_default>1</show_in_default>
838
+ <show_in_website>1</show_in_website>
839
+ <show_in_store>1</show_in_store>
840
+ <fields>
841
+ <active translate="label">
842
+ <label>Enable module</label>
843
+ <frontend_type>select</frontend_type>
844
+ <source_model>adminhtml/system_config_source_yesno</source_model>
845
+ <config_path>payment/novalnetPrepayment/active</config_path>
846
+ <sort_order>1</sort_order>
847
+ <show_in_default>1</show_in_default>
848
+ <show_in_website>1</show_in_website>
849
+ <show_in_store>1</show_in_store>
850
+ </active>
851
+ <title translate="label">
852
+ <label>Title</label>
853
+ <frontend_type>text</frontend_type>
854
+ <config_path>payment/novalnetPrepayment/title</config_path>
855
+ <validate>required-entry</validate>
856
+ <sort_order>2</sort_order>
857
+ <show_in_default>1</show_in_default>
858
+ <show_in_website>1</show_in_website>
859
+ <show_in_store>1</show_in_store>
860
+ </title>
861
+ <order_status translate="label">
862
+ <label>Order completion status</label>
863
+ <frontend_type>select</frontend_type>
864
+ <source_model>adminhtml/system_config_source_order_status</source_model>
865
+ <config_path>payment/novalnetPrepayment/order_status</config_path>
866
+ <sort_order>3</sort_order>
867
+ <show_in_default>1</show_in_default>
868
+ <show_in_website>1</show_in_website>
869
+ <show_in_store>1</show_in_store>
870
+ </order_status>
871
+ <order_status_after_payment translate="label">
872
+ <label>Callback order status</label>
873
+ <frontend_type>select</frontend_type>
874
+ <source_model>adminhtml/system_config_source_order_status</source_model>
875
+ <config_path>payment/novalnetPrepayment/order_status_after_payment</config_path>
876
+ <sort_order>4</sort_order>
877
+ <show_in_default>1</show_in_default>
878
+ <show_in_website>1</show_in_website>
879
+ <show_in_store>1</show_in_store>
880
+ </order_status_after_payment>
881
+ <booking_reference translate="label">
882
+ <label>Notification for the buyer</label>
883
+ <comment>The entered text will be displayed on the checkout page</comment>
884
+ <frontend_type>text</frontend_type>
885
+ <config_path>payment/novalnetPrepayment/booking_reference</config_path>
886
+ <sort_order>5</sort_order>
887
+ <show_in_default>1</show_in_default>
888
+ <show_in_website>1</show_in_website>
889
+ <show_in_store>1</show_in_store>
890
+ </booking_reference>
891
+ <reference_one translate="label">
892
+ <label>Transaction reference 1</label>
893
+ <comment>This reference will appear in your bank account statement</comment>
894
+ <frontend_type>text</frontend_type>
895
+ <config_path>payment/novalnetPrepayment/reference_one</config_path>
896
+ <sort_order>6</sort_order>
897
+ <show_in_default>1</show_in_default>
898
+ <show_in_website>1</show_in_website>
899
+ <show_in_store>1</show_in_store>
900
+ </reference_one>
901
+ <reference_two translate="label">
902
+ <label>Transaction reference 2</label>
903
+ <comment>This reference will appear in your bank account statement</comment>
904
  <frontend_type>text</frontend_type>
905
+ <config_path>payment/novalnetPrepayment/reference_two</config_path>
906
+ <sort_order>7</sort_order>
 
907
  <show_in_default>1</show_in_default>
908
  <show_in_website>1</show_in_website>
909
  <show_in_store>1</show_in_store>
910
+ </reference_two>
911
  <user_group_excluded translate="label">
 
912
  <label>User Group Excluded</label>
913
+ <comment>Excluded User Group description</comment>
914
  <frontend_type>text</frontend_type>
915
+ <config_path>payment/novalnetPrepayment/user_group_excluded</config_path>
916
+ <sort_order>8</sort_order>
917
  <show_in_default>1</show_in_default>
918
  <show_in_website>1</show_in_website>
919
  <show_in_store>1</show_in_store>
920
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
921
  <allowspecific translate="label">
922
  <label>Payment from applicable countries</label>
923
+ <frontend_type>select</frontend_type>
 
 
924
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
925
+ <config_path>payment/novalnetPrepayment/allowspecific</config_path>
926
+ <sort_order>9</sort_order>
927
  <show_in_default>1</show_in_default>
928
  <show_in_website>1</show_in_website>
929
  <show_in_store>1</show_in_store>
931
  <specificcountry translate="label">
932
  <label>Payment from Specific countries</label>
933
  <frontend_type>multiselect</frontend_type>
 
 
934
  <source_model>adminhtml/system_config_source_country</source_model>
935
+ <config_path>payment/novalnetPrepayment/specificcountry</config_path>
936
+ <sort_order>10</sort_order>
937
  <show_in_default>1</show_in_default>
938
  <show_in_website>1</show_in_website>
939
  <show_in_store>1</show_in_store>
944
  <min_order_total translate="label">
945
  <label>Novalnet Minimum Order Total</label>
946
  <frontend_type>text</frontend_type>
947
+ <config_path>payment/novalnetPrepayment/min_order_total</config_path>
948
  <validate>validate-number</validate>
949
+ <sort_order>11</sort_order>
 
950
  <show_in_default>1</show_in_default>
951
  <show_in_website>1</show_in_website>
952
  <show_in_store>1</show_in_store>
954
  <max_order_total translate="label">
955
  <label>Novalnet Maximum Order Total</label>
956
  <frontend_type>text</frontend_type>
957
+ <config_path>payment/novalnetPrepayment/max_order_total</config_path>
958
  <validate>validate-number</validate>
959
+ <sort_order>12</sort_order>
 
960
  <show_in_default>1</show_in_default>
961
  <show_in_website>1</show_in_website>
962
  <show_in_store>1</show_in_store>
964
  <orderscount translate="label">
965
  <label>Novalnet Minimum Orders Count</label>
966
  <frontend_type>text</frontend_type>
967
+ <config_path>payment/novalnetPrepayment/orderscount</config_path>
968
  <validate>validate-digits</validate>
969
+ <sort_order>13</sort_order>
 
970
  <comment>Novalnet Minimum Orders Count Desc</comment>
971
  <show_in_default>1</show_in_default>
972
  <show_in_website>1</show_in_website>
976
  <label>Novalnet Sort Order</label>
977
  <comment>Sort order of display. Lowest is displayed first.</comment>
978
  <frontend_type>text</frontend_type>
979
+ <config_path>payment/novalnetPrepayment/sort_order</config_path>
980
  <validate>validate-digits</validate>
981
+ <sort_order>14</sort_order>
 
982
  <show_in_default>1</show_in_default>
983
  <show_in_website>1</show_in_website>
984
  <show_in_store>1</show_in_store>
985
  </sort_order>
986
  </fields>
987
+ </novalnetPrepayment>
988
+ <!--}}} Novalnet Prepayment-->
989
+ <!--{{{ Novalnet Instant Bank Transfer-->
990
+ <novalnetBanktransfer translate="label" module="novalnet_payment">
991
+ <label>Novalnet Instant Bank Transfer</label>
992
+ <sort_order>5</sort_order>
993
  <show_in_default>1</show_in_default>
994
  <show_in_website>1</show_in_website>
995
  <show_in_store>1</show_in_store>
996
  <fields>
997
  <active translate="label">
998
+ <label>Enable module</label>
999
  <frontend_type>select</frontend_type>
 
1000
  <source_model>adminhtml/system_config_source_yesno</source_model>
1001
+ <config_path>payment/novalnetBanktransfer/active</config_path>
1002
  <sort_order>1</sort_order>
1003
  <show_in_default>1</show_in_default>
1004
  <show_in_website>1</show_in_website>
1005
  <show_in_store>1</show_in_store>
1006
  </active>
1007
  <title translate="label">
1008
+ <label>Title</label>
1009
  <frontend_type>text</frontend_type>
1010
+ <config_path>payment/novalnetBanktransfer/title</config_path>
1011
  <validate>required-entry</validate>
1012
  <sort_order>2</sort_order>
1013
  <show_in_default>1</show_in_default>
1015
  <show_in_store>1</show_in_store>
1016
  </title>
1017
  <order_status translate="label">
1018
+ <label>Order status for the pending payment</label>
1019
  <frontend_type>select</frontend_type>
 
1020
  <source_model>adminhtml/system_config_source_order_status</source_model>
1021
+ <config_path>payment/novalnetBanktransfer/order_status</config_path>
1022
  <sort_order>3</sort_order>
1023
  <show_in_default>1</show_in_default>
1024
  <show_in_website>1</show_in_website>
1025
  <show_in_store>1</show_in_store>
1026
  </order_status>
1027
  <order_status_after_payment translate="label">
1028
+ <label>Order completion status</label>
1029
  <frontend_type>select</frontend_type>
 
1030
  <source_model>adminhtml/system_config_source_order_status</source_model>
1031
+ <config_path>payment/novalnetBanktransfer/order_status_after_payment</config_path>
1032
  <sort_order>4</sort_order>
1033
  <show_in_default>1</show_in_default>
1034
  <show_in_website>1</show_in_website>
1035
  <show_in_store>1</show_in_store>
1036
  </order_status_after_payment>
1037
  <booking_reference translate="label">
1038
+ <label>Notification for the buyer</label>
1039
+ <comment>The entered text will be displayed on the checkout page</comment>
1040
  <frontend_type>text</frontend_type>
1041
+ <config_path>payment/novalnetBanktransfer/booking_reference</config_path>
1042
  <sort_order>5</sort_order>
1043
  <show_in_default>1</show_in_default>
1044
  <show_in_website>1</show_in_website>
1046
  </booking_reference>
1047
  <reference_one translate="label">
1048
  <label>Transaction reference 1</label>
1049
+ <comment>This reference will appear in your bank account statement</comment>
1050
  <frontend_type>text</frontend_type>
1051
+ <config_path>payment/novalnetBanktransfer/reference_one</config_path>
1052
  <sort_order>6</sort_order>
1053
  <show_in_default>1</show_in_default>
1054
  <show_in_website>1</show_in_website>
1056
  </reference_one>
1057
  <reference_two translate="label">
1058
  <label>Transaction reference 2</label>
1059
+ <comment>This reference will appear in your bank account statement</comment>
1060
  <frontend_type>text</frontend_type>
1061
+ <config_path>payment/novalnetBanktransfer/reference_two</config_path>
1062
  <sort_order>7</sort_order>
1063
  <show_in_default>1</show_in_default>
1064
  <show_in_website>1</show_in_website>
1065
  <show_in_store>1</show_in_store>
1066
  </reference_two>
1067
  <user_group_excluded translate="label">
 
1068
  <label>User Group Excluded</label>
1069
+ <comment>Excluded User Group description</comment>
1070
  <frontend_type>text</frontend_type>
1071
+ <config_path>payment/novalnetBanktransfer/user_group_excluded</config_path>
1072
  <sort_order>8</sort_order>
1073
  <show_in_default>1</show_in_default>
1074
  <show_in_website>1</show_in_website>
1075
  <show_in_store>1</show_in_store>
1076
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
1077
  <allowspecific translate="label">
1078
  <label>Payment from applicable countries</label>
1079
+ <frontend_type>select</frontend_type>
 
 
1080
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1081
+ <config_path>payment/novalnetBanktransfer/allowspecific</config_path>
1082
+ <sort_order>9</sort_order>
1083
  <show_in_default>1</show_in_default>
1084
  <show_in_website>1</show_in_website>
1085
  <show_in_store>1</show_in_store>
1087
  <specificcountry translate="label">
1088
  <label>Payment from Specific countries</label>
1089
  <frontend_type>multiselect</frontend_type>
 
 
1090
  <source_model>adminhtml/system_config_source_country</source_model>
1091
+ <config_path>payment/novalnetBanktransfer/specificcountry</config_path>
1092
+ <sort_order>10</sort_order>
1093
  <show_in_default>1</show_in_default>
1094
  <show_in_website>1</show_in_website>
1095
  <show_in_store>1</show_in_store>
1100
  <min_order_total translate="label">
1101
  <label>Novalnet Minimum Order Total</label>
1102
  <frontend_type>text</frontend_type>
1103
+ <config_path>payment/novalnetBanktransfer/min_order_total</config_path>
1104
  <validate>validate-number</validate>
1105
+ <sort_order>11</sort_order>
 
1106
  <show_in_default>1</show_in_default>
1107
  <show_in_website>1</show_in_website>
1108
  <show_in_store>1</show_in_store>
1110
  <max_order_total translate="label">
1111
  <label>Novalnet Maximum Order Total</label>
1112
  <frontend_type>text</frontend_type>
1113
+ <config_path>payment/novalnetBanktransfer/max_order_total</config_path>
1114
  <validate>validate-number</validate>
1115
+ <sort_order>12</sort_order>
 
1116
  <show_in_default>1</show_in_default>
1117
  <show_in_website>1</show_in_website>
1118
  <show_in_store>1</show_in_store>
1119
  </max_order_total>
1120
  <orderscount translate="label">
1121
  <label>Novalnet Minimum Orders Count</label>
1122
+ <comment>Novalnet Minimum Orders Count Desc</comment>
1123
  <frontend_type>text</frontend_type>
1124
+ <config_path>payment/novalnetBanktransfer/orderscount</config_path>
1125
+ <sort_order>13</sort_order>
1126
  <validate>validate-digits</validate>
 
 
 
1127
  <show_in_default>1</show_in_default>
1128
  <show_in_website>1</show_in_website>
1129
  <show_in_store>1</show_in_store>
1132
  <label>Novalnet Sort Order</label>
1133
  <comment>Sort order of display. Lowest is displayed first.</comment>
1134
  <frontend_type>text</frontend_type>
1135
+ <config_path>payment/novalnetBanktransfer/sort_order</config_path>
1136
  <validate>validate-digits</validate>
1137
+ <sort_order>14</sort_order>
 
1138
  <show_in_default>1</show_in_default>
1139
  <show_in_website>1</show_in_website>
1140
  <show_in_store>1</show_in_store>
1141
  </sort_order>
1142
  </fields>
1143
+ </novalnetBanktransfer>
1144
+ <!--}}} Novalnet Instant Bank Transfer-->
1145
+ <!--{{{ Novalnet Paypal-->
1146
+ <novalnetPaypal translate="label" module="novalnet_payment">
1147
+ <label>Novalnet PayPal</label>
1148
+ <frontend_type>text</frontend_type>
1149
+ <sort_order>6</sort_order>
1150
  <show_in_default>1</show_in_default>
1151
  <show_in_website>1</show_in_website>
1152
  <show_in_store>1</show_in_store>
1153
  <fields>
1154
  <active translate="label">
1155
+ <label>Enable module</label>
1156
  <frontend_type>select</frontend_type>
 
1157
  <source_model>adminhtml/system_config_source_yesno</source_model>
1158
+ <config_path>payment/novalnetPaypal/active</config_path>
1159
  <sort_order>1</sort_order>
1160
  <show_in_default>1</show_in_default>
1161
  <show_in_website>1</show_in_website>
1162
  <show_in_store>1</show_in_store>
1163
  </active>
1164
  <title translate="label">
1165
+ <label>Title</label>
1166
  <frontend_type>text</frontend_type>
1167
+ <config_path>payment/novalnetPaypal/title</config_path>
1168
  <validate>required-entry</validate>
1169
  <sort_order>2</sort_order>
1170
  <show_in_default>1</show_in_default>
1172
  <show_in_store>1</show_in_store>
1173
  </title>
1174
  <order_status translate="label">
1175
+ <label>Order status for the pending payment</label>
1176
  <frontend_type>select</frontend_type>
 
1177
  <source_model>adminhtml/system_config_source_order_status</source_model>
1178
+ <config_path>payment/novalnetPaypal/order_status</config_path>
1179
  <sort_order>3</sort_order>
1180
  <show_in_default>1</show_in_default>
1181
  <show_in_website>1</show_in_website>
1182
  <show_in_store>1</show_in_store>
1183
  </order_status>
1184
  <order_status_after_payment translate="label">
1185
+ <label>Order completion status</label>
1186
  <frontend_type>select</frontend_type>
 
1187
  <source_model>adminhtml/system_config_source_order_status</source_model>
1188
+ <config_path>payment/novalnetPaypal/order_status_after_payment</config_path>
1189
  <sort_order>4</sort_order>
1190
  <show_in_default>1</show_in_default>
1191
  <show_in_website>1</show_in_website>
1192
  <show_in_store>1</show_in_store>
1193
  </order_status_after_payment>
1194
  <booking_reference translate="label">
1195
+ <label>Notification for the buyer</label>
1196
+ <comment>The entered text will be displayed on the checkout page</comment>
1197
  <frontend_type>text</frontend_type>
1198
+ <config_path>payment/novalnetPaypal/booking_reference</config_path>
1199
  <sort_order>5</sort_order>
1200
  <show_in_default>1</show_in_default>
1201
  <show_in_website>1</show_in_website>
1203
  </booking_reference>
1204
  <reference_one translate="label">
1205
  <label>Transaction reference 1</label>
1206
+ <comment>This reference will appear in your bank account statement</comment>
1207
  <frontend_type>text</frontend_type>
1208
+ <config_path>payment/novalnetPaypal/reference_one</config_path>
1209
  <sort_order>6</sort_order>
1210
  <show_in_default>1</show_in_default>
1211
  <show_in_website>1</show_in_website>
1213
  </reference_one>
1214
  <reference_two translate="label">
1215
  <label>Transaction reference 2</label>
1216
+ <comment>This reference will appear in your bank account statement</comment>
1217
  <frontend_type>text</frontend_type>
1218
+ <config_path>payment/novalnetPaypal/reference_two</config_path>
1219
  <sort_order>7</sort_order>
1220
  <show_in_default>1</show_in_default>
1221
  <show_in_website>1</show_in_website>
1222
  <show_in_store>1</show_in_store>
1223
  </reference_two>
1224
  <user_group_excluded translate="label">
 
1225
  <label>User Group Excluded</label>
1226
+ <comment>Excluded User Group description</comment>
1227
  <frontend_type>text</frontend_type>
1228
+ <config_path>payment/novalnetPaypal/user_group_excluded</config_path>
1229
  <sort_order>8</sort_order>
1230
  <show_in_default>1</show_in_default>
1231
  <show_in_website>1</show_in_website>
1232
  <show_in_store>1</show_in_store>
1233
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
1234
  <allowspecific translate="label">
1235
  <label>Payment from applicable countries</label>
1236
+ <frontend_type>select</frontend_type>
 
 
1237
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1238
+ <config_path>payment/novalnetPaypal/allowspecific</config_path>
1239
+ <sort_order>9</sort_order>
1240
  <show_in_default>1</show_in_default>
1241
  <show_in_website>1</show_in_website>
1242
  <show_in_store>1</show_in_store>
1244
  <specificcountry translate="label">
1245
  <label>Payment from Specific countries</label>
1246
  <frontend_type>multiselect</frontend_type>
 
 
1247
  <source_model>adminhtml/system_config_source_country</source_model>
1248
+ <config_path>payment/novalnetPaypal/specificcountry</config_path>
1249
+ <sort_order>10</sort_order>
1250
  <show_in_default>1</show_in_default>
1251
  <show_in_website>1</show_in_website>
1252
  <show_in_store>1</show_in_store>
1257
  <min_order_total translate="label">
1258
  <label>Novalnet Minimum Order Total</label>
1259
  <frontend_type>text</frontend_type>
1260
+ <config_path>payment/novalnetPaypal/min_order_total</config_path>
1261
  <validate>validate-number</validate>
1262
+ <sort_order>11</sort_order>
 
1263
  <show_in_default>1</show_in_default>
1264
  <show_in_website>1</show_in_website>
1265
  <show_in_store>1</show_in_store>
1267
  <max_order_total translate="label">
1268
  <label>Novalnet Maximum Order Total</label>
1269
  <frontend_type>text</frontend_type>
1270
+ <config_path>payment/novalnetPaypal/max_order_total</config_path>
1271
  <validate>validate-number</validate>
1272
+ <sort_order>12</sort_order>
 
1273
  <show_in_default>1</show_in_default>
1274
  <show_in_website>1</show_in_website>
1275
  <show_in_store>1</show_in_store>
1276
  </max_order_total>
1277
  <orderscount translate="label">
1278
  <label>Novalnet Minimum Orders Count</label>
1279
+ <comment>Novalnet Minimum Orders Count Desc</comment>
1280
  <frontend_type>text</frontend_type>
1281
+ <config_path>payment/novalnetPaypal/orderscount</config_path>
1282
  <validate>validate-digits</validate>
1283
+ <sort_order>13</sort_order>
 
 
1284
  <show_in_default>1</show_in_default>
1285
  <show_in_website>1</show_in_website>
1286
  <show_in_store>1</show_in_store>
1289
  <label>Novalnet Sort Order</label>
1290
  <comment>Sort order of display. Lowest is displayed first.</comment>
1291
  <frontend_type>text</frontend_type>
1292
+ <config_path>payment/novalnetPaypal/sort_order</config_path>
1293
  <validate>validate-digits</validate>
1294
+ <sort_order>14</sort_order>
 
1295
  <show_in_default>1</show_in_default>
1296
  <show_in_website>1</show_in_website>
1297
  <show_in_store>1</show_in_store>
1298
  </sort_order>
1299
  </fields>
1300
+ </novalnetPaypal>
1301
+ <!--}}} Novalnet Paypal-->
1302
+ <!--{{{ Novalnet Ideal-->
1303
+ <novalnetIdeal translate="label" module="novalnet_payment">
1304
+ <label>Novalnet iDEAL</label>
1305
  <frontend_type>text</frontend_type>
1306
+ <sort_order>7</sort_order>
1307
  <show_in_default>1</show_in_default>
1308
  <show_in_website>1</show_in_website>
1309
  <show_in_store>1</show_in_store>
1310
  <fields>
1311
  <active translate="label">
1312
+ <label>Enable module</label>
1313
  <frontend_type>select</frontend_type>
 
1314
  <source_model>adminhtml/system_config_source_yesno</source_model>
1315
+ <config_path>payment/novalnetIdeal/active</config_path>
1316
  <sort_order>1</sort_order>
1317
  <show_in_default>1</show_in_default>
1318
  <show_in_website>1</show_in_website>
1319
  <show_in_store>1</show_in_store>
1320
  </active>
1321
  <title translate="label">
1322
+ <label>Title</label>
1323
  <frontend_type>text</frontend_type>
1324
+ <config_path>payment/novalnetIdeal/title</config_path>
1325
  <validate>required-entry</validate>
1326
  <sort_order>2</sort_order>
1327
  <show_in_default>1</show_in_default>
1329
  <show_in_store>1</show_in_store>
1330
  </title>
1331
  <order_status translate="label">
1332
+ <label>Order status for the pending payment</label>
1333
  <frontend_type>select</frontend_type>
 
1334
  <source_model>adminhtml/system_config_source_order_status</source_model>
1335
+ <config_path>payment/novalnetIdeal/order_status</config_path>
1336
  <sort_order>3</sort_order>
1337
  <show_in_default>1</show_in_default>
1338
  <show_in_website>1</show_in_website>
1339
  <show_in_store>1</show_in_store>
1340
  </order_status>
1341
  <order_status_after_payment translate="label">
1342
+ <label>Order completion status</label>
1343
  <frontend_type>select</frontend_type>
 
1344
  <source_model>adminhtml/system_config_source_order_status</source_model>
1345
+ <config_path>payment/novalnetIdeal/order_status_after_payment</config_path>
1346
  <sort_order>4</sort_order>
1347
  <show_in_default>1</show_in_default>
1348
  <show_in_website>1</show_in_website>
1349
  <show_in_store>1</show_in_store>
1350
  </order_status_after_payment>
1351
  <booking_reference translate="label">
1352
+ <label>Notification for the buyer</label>
1353
+ <comment>The entered text will be displayed on the checkout page</comment>
1354
  <frontend_type>text</frontend_type>
1355
+ <config_path>payment/novalnetIdeal/booking_reference</config_path>
1356
  <sort_order>5</sort_order>
1357
  <show_in_default>1</show_in_default>
1358
  <show_in_website>1</show_in_website>
1360
  </booking_reference>
1361
  <reference_one translate="label">
1362
  <label>Transaction reference 1</label>
1363
+ <comment>This reference will appear in your bank account statement</comment>
1364
  <frontend_type>text</frontend_type>
1365
+ <config_path>payment/novalnetIdeal/reference_one</config_path>
1366
  <sort_order>6</sort_order>
1367
  <show_in_default>1</show_in_default>
1368
  <show_in_website>1</show_in_website>
1370
  </reference_one>
1371
  <reference_two translate="label">
1372
  <label>Transaction reference 2</label>
1373
+ <comment>This reference will appear in your bank account statement</comment>
1374
  <frontend_type>text</frontend_type>
1375
+ <config_path>payment/novalnetIdeal/reference_two</config_path>
1376
  <sort_order>7</sort_order>
1377
  <show_in_default>1</show_in_default>
1378
  <show_in_website>1</show_in_website>
1379
  <show_in_store>1</show_in_store>
1380
  </reference_two>
1381
  <user_group_excluded translate="label">
 
1382
  <label>User Group Excluded</label>
1383
+ <comment>Excluded User Group description</comment>
1384
  <frontend_type>text</frontend_type>
1385
+ <config_path>payment/novalnetIdeal/user_group_excluded</config_path>
1386
  <sort_order>8</sort_order>
1387
  <show_in_default>1</show_in_default>
1388
  <show_in_website>1</show_in_website>
1389
  <show_in_store>1</show_in_store>
1390
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
1391
  <allowspecific translate="label">
1392
  <label>Payment from applicable countries</label>
1393
+ <frontend_type>select</frontend_type>
1394
+ <config_path>payment/novalnetIdeal/allowspecific</config_path>
1395
+ <sort_order>9</sort_order>
1396
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1397
  <show_in_default>1</show_in_default>
1398
  <show_in_website>1</show_in_website>
1401
  <specificcountry translate="label">
1402
  <label>Payment from Specific countries</label>
1403
  <frontend_type>multiselect</frontend_type>
1404
+ <config_path>payment/novalnetIdeal/specificcountry</config_path>
1405
+ <sort_order>10</sort_order>
1406
  <source_model>adminhtml/system_config_source_country</source_model>
1407
  <show_in_default>1</show_in_default>
1408
  <show_in_website>1</show_in_website>
1411
  <allowspecific>1</allowspecific>
1412
  </depends>
1413
  </specificcountry>
 
 
1414
  <min_order_total translate="label">
1415
  <label>Novalnet Minimum Order Total</label>
1416
  <frontend_type>text</frontend_type>
1417
+ <config_path>payment/novalnetIdeal/min_order_total</config_path>
1418
  <validate>validate-number</validate>
1419
+ <sort_order>11</sort_order>
 
1420
  <show_in_default>1</show_in_default>
1421
  <show_in_website>1</show_in_website>
1422
  <show_in_store>1</show_in_store>
1424
  <max_order_total translate="label">
1425
  <label>Novalnet Maximum Order Total</label>
1426
  <frontend_type>text</frontend_type>
1427
+ <config_path>payment/novalnetIdeal/max_order_total</config_path>
1428
  <validate>validate-number</validate>
1429
+ <sort_order>12</sort_order>
 
1430
  <show_in_default>1</show_in_default>
1431
  <show_in_website>1</show_in_website>
1432
  <show_in_store>1</show_in_store>
1434
  <orderscount translate="label">
1435
  <label>Novalnet Minimum Orders Count</label>
1436
  <frontend_type>text</frontend_type>
1437
+ <config_path>payment/novalnetIdeal/orderscount</config_path>
1438
+ <sort_order>13</sort_order>
1439
  <validate>validate-digits</validate>
 
 
1440
  <comment>Novalnet Minimum Orders Count Desc</comment>
1441
  <show_in_default>1</show_in_default>
1442
  <show_in_website>1</show_in_website>
1446
  <label>Novalnet Sort Order</label>
1447
  <comment>Sort order of display. Lowest is displayed first.</comment>
1448
  <frontend_type>text</frontend_type>
1449
+ <config_path>payment/novalnetIdeal/sort_order</config_path>
1450
  <validate>validate-digits</validate>
1451
+ <sort_order>14</sort_order>
 
1452
  <show_in_default>1</show_in_default>
1453
  <show_in_website>1</show_in_website>
1454
  <show_in_store>1</show_in_store>
1455
  </sort_order>
1456
  </fields>
1457
+ </novalnetIdeal>
1458
+ <!--}}} Novalnet Ideal-->
1459
+ <!--{{{ Novalnet Eps-->
1460
+ <novalnetEps translate="label" module="novalnet_payment">
1461
+ <label>Novalnet Eps</label>
1462
  <frontend_type>text</frontend_type>
1463
+ <sort_order>8</sort_order>
1464
  <show_in_default>1</show_in_default>
1465
  <show_in_website>1</show_in_website>
1466
  <show_in_store>1</show_in_store>
1467
  <fields>
1468
  <active translate="label">
1469
+ <label>Enable module</label>
1470
  <frontend_type>select</frontend_type>
1471
+ <config_path>payment/novalnetEps/active</config_path>
1472
  <source_model>adminhtml/system_config_source_yesno</source_model>
1473
  <sort_order>1</sort_order>
1474
  <show_in_default>1</show_in_default>
1476
  <show_in_store>1</show_in_store>
1477
  </active>
1478
  <title translate="label">
1479
+ <label>Title</label>
1480
  <frontend_type>text</frontend_type>
1481
+ <config_path>payment/novalnetEps/title</config_path>
1482
  <validate>required-entry</validate>
1483
  <sort_order>2</sort_order>
1484
  <show_in_default>1</show_in_default>
1486
  <show_in_store>1</show_in_store>
1487
  </title>
1488
  <order_status translate="label">
1489
+ <label>Order status for the pending payment</label>
1490
  <frontend_type>select</frontend_type>
 
1491
  <source_model>adminhtml/system_config_source_order_status</source_model>
1492
+ <config_path>payment/novalnetEps/order_status</config_path>
1493
  <sort_order>3</sort_order>
1494
  <show_in_default>1</show_in_default>
1495
  <show_in_website>1</show_in_website>
1496
  <show_in_store>1</show_in_store>
1497
  </order_status>
1498
  <order_status_after_payment translate="label">
1499
+ <label>Order completion status</label>
1500
  <frontend_type>select</frontend_type>
 
1501
  <source_model>adminhtml/system_config_source_order_status</source_model>
1502
+ <config_path>payment/novalnetEps/order_status_after_payment</config_path>
1503
  <sort_order>4</sort_order>
1504
  <show_in_default>1</show_in_default>
1505
  <show_in_website>1</show_in_website>
1506
  <show_in_store>1</show_in_store>
1507
  </order_status_after_payment>
1508
  <booking_reference translate="label">
1509
+ <label>Notification for the buyer</label>
1510
+ <comment>The entered text will be displayed on the checkout page</comment>
1511
  <frontend_type>text</frontend_type>
1512
+ <config_path>payment/novalnetEps/booking_reference</config_path>
1513
  <sort_order>5</sort_order>
1514
  <show_in_default>1</show_in_default>
1515
  <show_in_website>1</show_in_website>
1517
  </booking_reference>
1518
  <reference_one translate="label">
1519
  <label>Transaction reference 1</label>
1520
+ <comment>This reference will appear in your bank account statement</comment>
1521
  <frontend_type>text</frontend_type>
1522
+ <config_path>payment/novalnetEps/reference_one</config_path>
1523
  <sort_order>6</sort_order>
1524
  <show_in_default>1</show_in_default>
1525
  <show_in_website>1</show_in_website>
1527
  </reference_one>
1528
  <reference_two translate="label">
1529
  <label>Transaction reference 2</label>
1530
+ <comment>This reference will appear in your bank account statement</comment>
1531
  <frontend_type>text</frontend_type>
1532
+ <config_path>payment/novalnetEps/reference_two</config_path>
1533
  <sort_order>7</sort_order>
1534
  <show_in_default>1</show_in_default>
1535
  <show_in_website>1</show_in_website>
1536
  <show_in_store>1</show_in_store>
1537
  </reference_two>
1538
  <user_group_excluded translate="label">
 
1539
  <label>User Group Excluded</label>
1540
+ <comment>Excluded User Group description</comment>
1541
  <frontend_type>text</frontend_type>
1542
+ <config_path>payment/novalnetEps/user_group_excluded</config_path>
1543
  <sort_order>8</sort_order>
1544
  <show_in_default>1</show_in_default>
1545
  <show_in_website>1</show_in_website>
1546
  <show_in_store>1</show_in_store>
1547
  </user_group_excluded>
 
 
 
 
 
 
 
 
 
 
1548
  <allowspecific translate="label">
1549
  <label>Payment from applicable countries</label>
1550
+ <frontend_type>select</frontend_type>
 
 
1551
  <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1552
+ <config_path>payment/novalnetEps/allowspecific</config_path>
1553
+ <sort_order>9</sort_order>
1554
  <show_in_default>1</show_in_default>
1555
  <show_in_website>1</show_in_website>
1556
  <show_in_store>1</show_in_store>
1558
  <specificcountry translate="label">
1559
  <label>Payment from Specific countries</label>
1560
  <frontend_type>multiselect</frontend_type>
 
 
1561
  <source_model>adminhtml/system_config_source_country</source_model>
1562
+ <config_path>payment/novalnetEps/specificcountry</config_path>
1563
+ <sort_order>10</sort_order>
1564
  <show_in_default>1</show_in_default>
1565
  <show_in_website>1</show_in_website>
1566
  <show_in_store>1</show_in_store>
1571
  <min_order_total translate="label">
1572
  <label>Novalnet Minimum Order Total</label>
1573
  <frontend_type>text</frontend_type>
1574
+ <config_path>payment/novalnetEps/min_order_total</config_path>
1575
  <validate>validate-number</validate>
1576
+ <sort_order>11</sort_order>
 
1577
  <show_in_default>1</show_in_default>
1578
  <show_in_website>1</show_in_website>
1579
  <show_in_store>1</show_in_store>
1581
  <max_order_total translate="label">
1582
  <label>Novalnet Maximum Order Total</label>
1583
  <frontend_type>text</frontend_type>
1584
+ <config_path>payment/novalnetEps/max_order_total</config_path>
1585
  <validate>validate-number</validate>
1586
+ <sort_order>12</sort_order>
 
1587
  <show_in_default>1</show_in_default>
1588
  <show_in_website>1</show_in_website>
1589
  <show_in_store>1</show_in_store>
1590
  </max_order_total>
1591
  <orderscount translate="label">
1592
  <label>Novalnet Minimum Orders Count</label>
1593
+ <comment>Novalnet Minimum Orders Count Desc</comment>
1594
  <frontend_type>text</frontend_type>
1595
+ <config_path>payment/novalnetEps/orderscount</config_path>
1596
  <validate>validate-digits</validate>
1597
+ <sort_order>13</sort_order>
 
 
1598
  <show_in_default>1</show_in_default>
1599
  <show_in_website>1</show_in_website>
1600
  <show_in_store>1</show_in_store>
1603
  <label>Novalnet Sort Order</label>
1604
  <comment>Sort order of display. Lowest is displayed first.</comment>
1605
  <frontend_type>text</frontend_type>
1606
+ <config_path>payment/novalnetEps/sort_order</config_path>
1607
  <validate>validate-digits</validate>
1608
+ <sort_order>14</sort_order>
 
1609
  <show_in_default>1</show_in_default>
1610
  <show_in_website>1</show_in_website>
1611
  <show_in_store>1</show_in_store>
1612
  </sort_order>
1613
  </fields>
1614
+ </novalnetEps>
1615
+ <!--}}} Novalnet Eps-->
1616
  </groups>
1617
  </novalnet_paymethods>
1618
+ <!-- Novalnet payment methods -->
1619
 
1620
  <!-- Fraud prevention -->
1621
  <fraud_prevent translate="label" module="novalnet_payment">
1622
  <label>Risk and Control</label>
1623
  <tab>novalnet</tab>
1624
  <frontend_type>text</frontend_type>
1625
+ <sort_order>3</sort_order>
1626
  <show_in_default>1</show_in_default>
1627
  <show_in_website>1</show_in_website>
1628
  <show_in_store>1</show_in_store>
1631
  <label>Novalnet Credit Card</label>
1632
  <comment>Enable the payment Method and activate the Risk and Control option</comment>
1633
  <frontend_type>text</frontend_type>
1634
+ <sort_order>1</sort_order>
1635
  <show_in_default>1</show_in_default>
1636
  <show_in_website>1</show_in_website>
1637
  <show_in_store>1</show_in_store>
1638
  <fields>
1639
  <callback translate="label">
1640
+ <label>Enable fraud prevention</label>
1641
+ <comment>Enable fraud prevention description</comment>
1642
  <frontend_type>select</frontend_type>
 
1643
  <source_model>novalnet_payment/novalnet_source_callbacktypes</source_model>
1644
+ <config_path>payment/novalnetCc/callback</config_path>
1645
  <sort_order>1</sort_order>
1646
  <show_in_default>1</show_in_default>
1647
  <show_in_website>1</show_in_website>
1648
  <show_in_store>1</show_in_store>
1649
  </callback>
1650
  <callback_minimum_amount>
1651
+ <label>Minimum Amount For Callback</label>
1652
+ <comment>Minimum Amount For Callback description</comment>
1653
  <frontend_type>text</frontend_type>
 
1654
  <config_path>payment/novalnetCc/callback_minimum_amount</config_path>
1655
+ <validate>validate-digits</validate>
1656
  <sort_order>2</sort_order>
1657
  <show_in_default>1</show_in_default>
1658
  <show_in_website>1</show_in_website>
1660
  </callback_minimum_amount>
1661
  </fields>
1662
  </novalnetCc>
1663
+ <novalnetInvoice translate="label" module="novalnet_payment">
1664
+ <label>Novalnet Invoice</label>
1665
  <comment>Enable the payment Method and activate the Risk and Control option</comment>
1666
  <frontend_type>text</frontend_type>
1667
+ <sort_order>2</sort_order>
1668
  <show_in_default>1</show_in_default>
1669
  <show_in_website>1</show_in_website>
1670
  <show_in_store>1</show_in_store>
1671
  <fields>
1672
  <callback translate="label">
1673
+ <label>Enable fraud prevention</label>
1674
+ <comment>Enable fraud prevention description</comment>
1675
  <frontend_type>select</frontend_type>
 
1676
  <source_model>novalnet_payment/novalnet_source_callbacktypes</source_model>
1677
+ <config_path>payment/novalnetInvoice/callback</config_path>
1678
  <sort_order>1</sort_order>
1679
  <show_in_default>1</show_in_default>
1680
  <show_in_website>1</show_in_website>
1681
  <show_in_store>1</show_in_store>
1682
  </callback>
1683
  <callback_minimum_amount>
1684
+ <label>Minimum Amount For Callback</label>
1685
+ <comment>Minimum Amount For Callback description</comment>
1686
  <frontend_type>text</frontend_type>
1687
+ <config_path>payment/novalnetInvoice/callback_minimum_amount</config_path>
1688
  <validate>validate-digits</validate>
 
1689
  <sort_order>2</sort_order>
1690
  <show_in_default>1</show_in_default>
1691
  <show_in_website>1</show_in_website>
1692
  <show_in_store>1</show_in_store>
1693
  </callback_minimum_amount>
1694
  </fields>
1695
+ </novalnetInvoice>
1696
+ <novalnetSepa translate="label" module="novalnet_payment">
1697
+ <label>Novalnet Direct Debit SEPA</label>
1698
  <comment>Enable the payment Method and activate the Risk and Control option</comment>
1699
  <frontend_type>text</frontend_type>
1700
+ <sort_order>3</sort_order>
1701
  <show_in_default>1</show_in_default>
1702
  <show_in_website>1</show_in_website>
1703
  <show_in_store>1</show_in_store>
1704
  <fields>
1705
  <callback translate="label">
1706
+ <label>Enable fraud prevention</label>
1707
+ <comment>Enable fraud prevention description</comment>
1708
  <frontend_type>select</frontend_type>
 
1709
  <source_model>novalnet_payment/novalnet_source_callbacktypes</source_model>
1710
+ <config_path>payment/novalnetSepa/callback</config_path>
1711
  <sort_order>1</sort_order>
1712
  <show_in_default>1</show_in_default>
1713
  <show_in_website>1</show_in_website>
1714
  <show_in_store>1</show_in_store>
1715
  </callback>
1716
  <callback_minimum_amount>
1717
+ <label>Minimum Amount For Callback</label>
1718
+ <comment>Minimum Amount For Callback description</comment>
1719
  <frontend_type>text</frontend_type>
1720
+ <config_path>payment/novalnetSepa/callback_minimum_amount</config_path>
1721
  <validate>validate-digits</validate>
 
1722
  <sort_order>2</sort_order>
1723
  <show_in_default>1</show_in_default>
1724
  <show_in_website>1</show_in_website>
1725
  <show_in_store>1</show_in_store>
1726
  </callback_minimum_amount>
 
1727
  </fields>
1728
+ </novalnetSepa>
1729
  </groups>
1730
  </fraud_prevent>
1731
  <!-- Fraud prevention -->
app/code/community/Novalnet/Payment/sql/novalnet_setup/{mysql4-install-5.0.4.php → mysql4-install-10.0.0.php} RENAMED
@@ -27,13 +27,15 @@
27
  $tableOrderLog = $this->getTable('novalnet_payment/order_log');
28
  $tableTransactionStatus = $this->getTable('novalnet_payment/transaction_status');
29
  $tableCallback = $this->getTable('novalnet_payment/callback');
 
 
 
30
  $tableAffAccountDetail = $this->getTable('novalnet_payment/aff_account_detail');
31
  $tableAffUserDetail = $this->getTable('novalnet_payment/aff_user_detail');
32
 
33
  /** magento tables */
34
  $tableOrderPayment = $this->getTable('sales/order_payment');
35
  $tableConfigData = $this->getTable('core/config_data');
36
-
37
  $magentoVersion = Mage::getVersion();
38
 
39
  $installer = $this;
@@ -57,8 +59,9 @@ $installer->run("
57
  `transaction_id` VARCHAR(50) NOT NULL,
58
  `additional_data` TEXT NOT NULL DEFAULT '',
59
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
60
- PRIMARY KEY (`nn_log_id`)
61
- ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
62
  ");
63
 
64
  #-----------------------------------------------------------------
@@ -79,8 +82,9 @@ $installer->run("
79
  `shop_url` VARCHAR(255) NOT NULL DEFAULT '',
80
  `additional_data` TEXT NOT NULL DEFAULT '',
81
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
82
- PRIMARY KEY (`nn_txn_id`)
83
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
84
  ");
85
 
86
  #-----------------------------------------------------------------
@@ -95,8 +99,52 @@ $installer->run("
95
  `callback_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
96
  `callback_tid` VARCHAR(50) NOT NULL,
97
  `callback_log` TEXT NOT NULL DEFAULT '',
98
- PRIMARY KEY (`id`)
99
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  ");
101
 
102
  #-----------------------------------------------------------------
@@ -116,8 +164,9 @@ $installer->run("
116
  PRIMARY KEY (`id`),
117
  KEY `vendor_id` (`vendor_id`),
118
  KEY `product_id` (`product_id`),
119
- KEY `aff_id` (`aff_id`)
120
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
121
  ");
122
 
123
  #-----------------------------------------------------------------
@@ -132,31 +181,31 @@ $installer->run("
132
  PRIMARY KEY (`id`),
133
  KEY `aff_id` (`aff_id`),
134
  KEY `customer_no` (`customer_no`),
135
- KEY `aff_order_no` (`aff_order_no`)
136
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
137
  ");
138
 
139
  $methodFields = array();
140
- $methodData = array(
141
- 'sofortueberweisung' => 'novalnetSofortueberweisung',
142
- 'novalnetsofortueberweisung' => 'novalnetSofortueberweisung',
143
- 'novalnetpaypal' => 'novalnetPaypal',
144
- 'novalnetCcpci' => 'novalnetCc',
145
- 'novalnet_secure' => 'novalnetCc',
146
- 'novalnetSecure' => 'novalnetCc',
147
- 'novalnetElvatpci' => 'novalnetSepa',
148
- 'novalnetElvdepci' => 'novalnetSepa',
149
- 'novalnetElvaustria' => 'novalnetSepa',
150
- 'novalnetElvgerman' => 'novalnetSepa'
151
- );
 
152
 
153
  foreach ($methodData as $variableId => $value) {
154
  $methodFields['method'] = $value;
155
  $installer->getConnection()->update(
156
- $tableOrderPayment,
157
- $methodFields,
158
- array('method = ?' => $variableId)
159
- );
160
  }
161
 
162
  if (version_compare($magentoVersion, '1.6', '<')) {
27
  $tableOrderLog = $this->getTable('novalnet_payment/order_log');
28
  $tableTransactionStatus = $this->getTable('novalnet_payment/transaction_status');
29
  $tableCallback = $this->getTable('novalnet_payment/callback');
30
+ $tableSeparefill = $this->getTable('novalnet_payment/separefill');
31
+ $tableAmountchanged = $this->getTable('novalnet_payment/amountchanged');
32
+ $tableRecurring = $this->getTable('novalnet_payment/recurring');
33
  $tableAffAccountDetail = $this->getTable('novalnet_payment/aff_account_detail');
34
  $tableAffUserDetail = $this->getTable('novalnet_payment/aff_user_detail');
35
 
36
  /** magento tables */
37
  $tableOrderPayment = $this->getTable('sales/order_payment');
38
  $tableConfigData = $this->getTable('core/config_data');
 
39
  $magentoVersion = Mage::getVersion();
40
 
41
  $installer = $this;
59
  `transaction_id` VARCHAR(50) NOT NULL,
60
  `additional_data` TEXT NOT NULL DEFAULT '',
61
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
62
+ PRIMARY KEY (`nn_log_id`),
63
+ INDEX `NOVALNET_ORDER_LOG` (`nn_log_id` ASC)
64
+ );
65
  ");
66
 
67
  #-----------------------------------------------------------------
82
  `shop_url` VARCHAR(255) NOT NULL DEFAULT '',
83
  `additional_data` TEXT NOT NULL DEFAULT '',
84
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
85
+ PRIMARY KEY (`nn_txn_id`),
86
+ INDEX `NOVALNET_TRANSACTION_LOG` (`nn_txn_id` ASC)
87
+ );
88
  ");
89
 
90
  #-----------------------------------------------------------------
99
  `callback_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
100
  `callback_tid` VARCHAR(50) NOT NULL,
101
  `callback_log` TEXT NOT NULL DEFAULT '',
102
+ PRIMARY KEY (`id`),
103
+ INDEX `NOVALNET_CALLBACK` (`order_id` ASC)
104
+ );
105
+ ");
106
+
107
+ #-----------------------------------------------------------------
108
+ #-- Create Table novalnet_order_separefill
109
+ #-----------------------------------------------------------------
110
+ $installer->run("
111
+ CREATE TABLE IF NOT EXISTS `{$tableSeparefill}` (
112
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
113
+ `customer_id` VARCHAR(50) NOT NULL DEFAULT '',
114
+ `pan_hash` VARCHAR(50) NOT NULL,
115
+ `sepa_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
116
+ PRIMARY KEY (`id`),
117
+ INDEX `NOVALNET_SEPA_REFILL` (`customer_id` ASC)
118
+ );
119
+ ");
120
+ #-----------------------------------------------------------------
121
+ #-- Create Table novalnet_order_amountchanged
122
+ #-----------------------------------------------------------------
123
+ $installer->run("
124
+ CREATE TABLE IF NOT EXISTS `{$tableAmountchanged}` (
125
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
126
+ `order_id` VARCHAR(50) NOT NULL DEFAULT '',
127
+ `amount_changed` VARCHAR(50) NOT NULL,
128
+ `amount_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
129
+ PRIMARY KEY (`id`),
130
+ INDEX `NOVALNET_AMOUNT_CHANGED` (`order_id` ASC)
131
+ );
132
+ ");
133
+
134
+ #-----------------------------------------------------------------
135
+ #-- Create Table novalnet_order_recurring
136
+ #-----------------------------------------------------------------
137
+ $installer->run("
138
+ CREATE TABLE IF NOT EXISTS `{$tableRecurring}` (
139
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
140
+ `profile_id` VARCHAR(50) NOT NULL DEFAULT '',
141
+ `signup_tid` VARCHAR(50) NOT NULL DEFAULT '',
142
+ `billingcycle` VARCHAR(50) NOT NULL,
143
+ `callbackcycle` VARCHAR(50) NOT NULL,
144
+ `cycle_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
145
+ PRIMARY KEY (`id`),
146
+ INDEX `NOVALNET_RECURRING` (`profile_id` ASC)
147
+ );
148
  ");
149
 
150
  #-----------------------------------------------------------------
164
  PRIMARY KEY (`id`),
165
  KEY `vendor_id` (`vendor_id`),
166
  KEY `product_id` (`product_id`),
167
+ KEY `aff_id` (`aff_id`),
168
+ INDEX `NOVALNET_AFFILIATE` (`aff_id` ASC)
169
+ );
170
  ");
171
 
172
  #-----------------------------------------------------------------
181
  PRIMARY KEY (`id`),
182
  KEY `aff_id` (`aff_id`),
183
  KEY `customer_no` (`customer_no`),
184
+ KEY `aff_order_no` (`aff_order_no`),
185
+ INDEX `NOVALNET_AFFILIATE_USER` (`customer_no` ASC)
186
+ );
187
  ");
188
 
189
  $methodFields = array();
190
+ $methodData = array(
191
+ 'sofortueberweisung' => 'novalnetSofortueberweisung',
192
+ 'novalnetsofortueberweisung' => 'novalnetSofortueberweisung',
193
+ 'novalnetpaypal' => 'novalnetPaypal',
194
+ 'novalnetCcpci' => 'novalnetCc',
195
+ 'novalnet_secure' => 'novalnetCc',
196
+ 'novalnetSecure' => 'novalnetCc',
197
+ 'novalnetElvatpci' => 'novalnetSepa',
198
+ 'novalnetElvdepci' => 'novalnetSepa',
199
+ 'novalnetElvaustria' => 'novalnetSepa',
200
+ 'novalnetElvgerman' => 'novalnetSepa',
201
+ 'novalnetSofortueberweisung' => 'novalnetBanktransfer'
202
+ );
203
 
204
  foreach ($methodData as $variableId => $value) {
205
  $methodFields['method'] = $value;
206
  $installer->getConnection()->update(
207
+ $tableOrderPayment, $methodFields, array('method = ?' => $variableId)
208
+ );
 
 
209
  }
210
 
211
  if (version_compare($magentoVersion, '1.6', '<')) {
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-1.4.0-5.0.0.php CHANGED
@@ -23,16 +23,13 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- /** novalnet tables */
27
  $tableOrderLog = $this->getTable('novalnet_payment/order_log');
28
  $tableTransactionStatus = $this->getTable('novalnet_payment/transaction_status');
29
  $tableCallback = $this->getTable('novalnet_payment/callback');
30
 
31
  /** magento tables */
32
  $tableOrderPayment = $this->getTable('sales/order_payment');
33
- $tableConfigData = $this->getTable('core/config_data');
34
-
35
- $magentoVersion = Mage::getVersion();
36
 
37
  $installer = $this;
38
 
@@ -47,16 +44,17 @@ $installer->run("
47
  `request_data` TEXT NOT NULL DEFAULT '',
48
  `response_data` TEXT NOT NULL DEFAULT '',
49
  `order_id` VARCHAR(50) NOT NULL DEFAULT '',
50
- `customer_id` VARCHAR(10) NOT NULL DEFAULT '',
51
- `status` VARCHAR(20) NOT NULL DEFAULT '',
52
  `failed_reason` TEXT NOT NULL DEFAULT '',
53
  `store_id` int(11) UNSIGNED NOT NULL,
54
  `shop_url` VARCHAR(255) NOT NULL DEFAULT '',
55
- `transaction_id` VARCHAR(50) NOT NULL,
56
- `additional_data` TEXT NOT NULL DEFAULT '',
57
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
58
- PRIMARY KEY (`nn_log_id`)
59
- ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
60
  ");
61
 
62
  #-----------------------------------------------------------------
@@ -65,20 +63,21 @@ $installer->run("
65
  $installer->run("
66
  CREATE TABLE IF NOT EXISTS `{$tableTransactionStatus}` (
67
  `nn_txn_id` int(11) UNSIGNED NOT NULL auto_increment,
68
- `transaction_no` VARCHAR(50) NOT NULL,
69
  `order_id` VARCHAR(50) NOT NULL DEFAULT '',
70
- `transaction_status` VARCHAR(20) NOT NULL DEFAULT 0,
71
  `nc_no` VARCHAR(11) NOT NULL,
72
- `customer_id` VARCHAR(10) NOT NULL DEFAULT '',
73
  `payment_name` VARCHAR(50) NOT NULL DEFAULT '',
74
- `amount` decimal(12,4) NOT NULL,
75
  `remote_ip` VARCHAR(20) NOT NULL,
76
  `store_id` int(11) UNSIGNED NOT NULL,
77
  `shop_url` VARCHAR(255) NOT NULL DEFAULT '',
78
- `additional_data` TEXT NOT NULL DEFAULT '',
79
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
80
- PRIMARY KEY (`nn_txn_id`)
81
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
82
  ");
83
 
84
  #-----------------------------------------------------------------
@@ -93,55 +92,25 @@ $installer->run("
93
  `callback_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
94
  `callback_tid` VARCHAR(50) NOT NULL,
95
  `callback_log` TEXT NOT NULL DEFAULT '',
96
- PRIMARY KEY (`id`)
97
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
98
  ");
99
 
100
  $methodFields = array();
101
- $methodData = array(
102
- 'sofortueberweisung' => 'novalnetSofortueberweisung',
103
- 'novalnetpaypal' => 'novalnetPaypal',
104
- 'novalnetCcpci' => 'novalnetCc',
105
- 'novalnet_secure' => 'novalnetCc',
106
- 'novalnetElvatpci' => 'novalnetSepa',
107
- 'novalnetElvdepci' => 'novalnetSepa'
108
- );
109
 
110
  foreach ($methodData as $variableId => $value) {
111
  $methodFields['method'] = $value;
112
  $installer->getConnection()->update(
113
- $tableOrderPayment,
114
- $methodFields,
115
- array('method = ?' => $variableId)
116
- );
117
- }
118
-
119
- if (version_compare($magentoVersion, '1.6', '<')) {
120
- $nnPaypalFields = array();
121
- $pathData = array(
122
- 'payment/novalnetpaypal/active' => 'payment/novalnetPaypal/active',
123
- 'payment/novalnetpaypal/title' => 'payment/novalnetPaypal/title',
124
- 'payment/novalnetpaypal/order_status' => 'payment/novalnetPaypal/order_status',
125
- 'payment/novalnetpaypal/booking_reference' => 'payment/novalnetPaypal/booking_reference',
126
- 'payment/novalnetpaypal/order_status_after_payment' => 'payment/novalnetPaypal/order_status_after_payment',
127
- 'payment/novalnetpaypal/user_group_excluded' => 'payment/novalnetPaypal/user_group_excluded',
128
- 'payment/novalnetpaypal/gateway_timeout' => 'payment/novalnetPaypal/gateway_timeout',
129
- 'payment/novalnetpaypal/allowspecific' => 'payment/novalnetPaypal/allowspecific',
130
- 'payment/novalnetpaypal/min_order_total' => 'payment/novalnetPaypal/min_order_total',
131
- 'payment/novalnetpaypal/max_order_total' => 'payment/novalnetPaypal/max_order_total',
132
- 'payment/novalnetpaypal/orderscount' => 'payment/novalnetPaypal/orderscount',
133
- 'payment/novalnetpaypal/sort_order' => 'payment/novalnetPaypal/sort_order'
134
- );
135
-
136
-
137
- foreach ($pathData as $variableId => $value) {
138
- $nnPaypalFields['path'] = $value;
139
- $installer->getConnection()->update(
140
- $tableConfigData,
141
- $nnPaypalFields,
142
- array('path = ?' => $variableId)
143
- );
144
- }
145
  }
146
-
147
  $installer->endSetup();
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ /** Novalnet tables */
27
  $tableOrderLog = $this->getTable('novalnet_payment/order_log');
28
  $tableTransactionStatus = $this->getTable('novalnet_payment/transaction_status');
29
  $tableCallback = $this->getTable('novalnet_payment/callback');
30
 
31
  /** magento tables */
32
  $tableOrderPayment = $this->getTable('sales/order_payment');
 
 
 
33
 
34
  $installer = $this;
35
 
44
  `request_data` TEXT NOT NULL DEFAULT '',
45
  `response_data` TEXT NOT NULL DEFAULT '',
46
  `order_id` VARCHAR(50) NOT NULL DEFAULT '',
47
+ `customer_id` VARCHAR(10) NOT NULL DEFAULT '',
48
+ `status` VARCHAR(20) NOT NULL DEFAULT '',
49
  `failed_reason` TEXT NOT NULL DEFAULT '',
50
  `store_id` int(11) UNSIGNED NOT NULL,
51
  `shop_url` VARCHAR(255) NOT NULL DEFAULT '',
52
+ `transaction_id` VARCHAR(50) NOT NULL,
53
+ `additional_data` TEXT NOT NULL DEFAULT '',
54
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
55
+ PRIMARY KEY (`nn_log_id`),
56
+ INDEX `NOVALNET_ORDER_LOG` (`nn_log_id` ASC)
57
+ );
58
  ");
59
 
60
  #-----------------------------------------------------------------
63
  $installer->run("
64
  CREATE TABLE IF NOT EXISTS `{$tableTransactionStatus}` (
65
  `nn_txn_id` int(11) UNSIGNED NOT NULL auto_increment,
66
+ `transaction_no` VARCHAR(50) NOT NULL,
67
  `order_id` VARCHAR(50) NOT NULL DEFAULT '',
68
+ `transaction_status` VARCHAR(20) NOT NULL DEFAULT 0,
69
  `nc_no` VARCHAR(11) NOT NULL,
70
+ `customer_id` VARCHAR(10) NOT NULL DEFAULT '',
71
  `payment_name` VARCHAR(50) NOT NULL DEFAULT '',
72
+ `amount` decimal(12,4) NOT NULL,
73
  `remote_ip` VARCHAR(20) NOT NULL,
74
  `store_id` int(11) UNSIGNED NOT NULL,
75
  `shop_url` VARCHAR(255) NOT NULL DEFAULT '',
76
+ `additional_data` TEXT NOT NULL DEFAULT '',
77
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
78
+ PRIMARY KEY (`nn_txn_id`),
79
+ INDEX `NOVALNET_TRANSACTION_STATUS` (`nn_txn_id` ASC)
80
+ );
81
  ");
82
 
83
  #-----------------------------------------------------------------
92
  `callback_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
93
  `callback_tid` VARCHAR(50) NOT NULL,
94
  `callback_log` TEXT NOT NULL DEFAULT '',
95
+ PRIMARY KEY (`id`),
96
+ INDEX `NOVALNET_CALLBACK` (`order_id` ASC)
97
+ );
98
  ");
99
 
100
  $methodFields = array();
101
+ $methodData = array(
102
+ 'sofortueberweisung' => 'novalnetSofortueberweisung',
103
+ 'novalnetpaypal' => 'novalnetPaypal',
104
+ 'novalnetCcpci' => 'novalnetCc',
105
+ 'novalnet_secure' => 'novalnetCc',
106
+ 'novalnetElvatpci' => 'novalnetSepa',
107
+ 'novalnetElvdepci' => 'novalnetSepa'
108
+ );
109
 
110
  foreach ($methodData as $variableId => $value) {
111
  $methodFields['method'] = $value;
112
  $installer->getConnection()->update(
113
+ $tableOrderPayment, $methodFields, array('method = ?' => $variableId)
114
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
 
116
  $installer->endSetup();
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.0-5.0.1.php CHANGED
@@ -31,18 +31,16 @@ $installer = $this;
31
  $installer->startSetup();
32
 
33
  $methodFields = array();
34
- $methodData = array(
35
- 'novalnetsofortueberweisung' => 'novalnetSofortueberweisung',
36
- 'novalnetpaypal' => 'novalnetPaypal',
37
- 'novalnetideal' => 'novalnetIdeal'
38
- );
39
 
40
  foreach ($methodData as $variableId => $value) {
41
  $methodFields['method'] = $value;
42
  $installer->getConnection()->update(
43
- $tableOrderPayment,
44
- $methodFields,
45
- array('method = ?' => $variableId)
46
- );
47
  }
48
  $installer->endSetup();
31
  $installer->startSetup();
32
 
33
  $methodFields = array();
34
+ $methodData = array(
35
+ 'novalnetsofortueberweisung' => 'novalnetSofortueberweisung',
36
+ 'novalnetpaypal' => 'novalnetPaypal',
37
+ 'novalnetideal' => 'novalnetIdeal'
38
+ );
39
 
40
  foreach ($methodData as $variableId => $value) {
41
  $methodFields['method'] = $value;
42
  $installer->getConnection()->update(
43
+ $tableOrderPayment, $methodFields, array('method = ?' => $variableId)
44
+ );
 
 
45
  }
46
  $installer->endSetup();
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.1-5.0.2.php CHANGED
@@ -23,7 +23,7 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- /** novalnet table */
27
  $tableCallback = $this->getTable('novalnet_payment/callback');
28
 
29
  /** magento table */
@@ -45,29 +45,28 @@ $installer->run("
45
  `callback_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
46
  `callback_tid` VARCHAR(50) NOT NULL,
47
  `callback_log` TEXT NOT NULL DEFAULT '',
48
- PRIMARY KEY (`id`)
49
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
50
  ");
51
 
52
  $methodFields = array();
53
- $methodData = array(
54
- 'sofortueberweisung' => 'novalnetSofortueberweisung',
55
- 'novalnetsofortueberweisung' => 'novalnetSofortueberweisung',
56
- 'novalnetpaypal' => 'novalnetPaypal',
57
- 'novalnetideal' => 'novalnetIdeal',
58
- 'novalnetCcpci' => 'novalnetCc',
59
- 'novalnet_secure' => 'novalnetCc',
60
- 'novalnetSecure' => 'novalnetCc',
61
- 'novalnetElvatpci' => 'novalnetSepa',
62
- 'novalnetElvdepci' => 'novalnetSepa'
63
- );
64
 
65
  foreach ($methodData as $variableId => $value) {
66
  $methodFields['method'] = $value;
67
  $installer->getConnection()->update(
68
- $tableOrderPayment,
69
- $methodFields,
70
- array('method = ?' => $variableId)
71
- );
72
  }
73
  $installer->endSetup();
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ /** Novalnet table */
27
  $tableCallback = $this->getTable('novalnet_payment/callback');
28
 
29
  /** magento table */
45
  `callback_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
46
  `callback_tid` VARCHAR(50) NOT NULL,
47
  `callback_log` TEXT NOT NULL DEFAULT '',
48
+ PRIMARY KEY (`id`),
49
+ INDEX `NOVALNET_CALLBACK` (`order_id` ASC)
50
+ );
51
  ");
52
 
53
  $methodFields = array();
54
+ $methodData = array(
55
+ 'sofortueberweisung' => 'novalnetSofortueberweisung',
56
+ 'novalnetsofortueberweisung' => 'novalnetSofortueberweisung',
57
+ 'novalnetpaypal' => 'novalnetPaypal',
58
+ 'novalnetideal' => 'novalnetIdeal',
59
+ 'novalnetCcpci' => 'novalnetCc',
60
+ 'novalnet_secure' => 'novalnetCc',
61
+ 'novalnetSecure' => 'novalnetCc',
62
+ 'novalnetElvatpci' => 'novalnetSepa',
63
+ 'novalnetElvdepci' => 'novalnetSepa'
64
+ );
65
 
66
  foreach ($methodData as $variableId => $value) {
67
  $methodFields['method'] = $value;
68
  $installer->getConnection()->update(
69
+ $tableOrderPayment, $methodFields, array('method = ?' => $variableId)
70
+ );
 
 
71
  }
72
  $installer->endSetup();
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.2-10.0.0.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /** magento table */
27
+ $tableOrderPayment = $this->getTable('sales/order_payment');
28
+
29
+ /** Novalnet tables */
30
+ $tableSeparefill = $this->getTable('novalnet_payment/separefill');
31
+ $tableAmountchanged = $this->getTable('novalnet_payment/amountchanged');
32
+ $tableRecurring = $this->getTable('novalnet_payment/recurring');
33
+ $tableAffAccountDetail = $this->getTable('novalnet_payment/aff_account_detail');
34
+ $tableAffUserDetail = $this->getTable('novalnet_payment/aff_user_detail');
35
+
36
+ $installer = $this;
37
+
38
+ $installer->startSetup();
39
+
40
+ $methodFields = array();
41
+ $methodData = array(
42
+ 'novalnetElvaustria' => 'novalnetSepa',
43
+ 'novalnetElvgerman' => 'novalnetSepa',
44
+ 'novalnetSofortueberweisung' => 'novalnetBanktransfer'
45
+ );
46
+
47
+ foreach ($methodData as $variableId => $value) {
48
+ $methodFields['method'] = $value;
49
+ $installer->getConnection()->update(
50
+ $tableOrderPayment, $methodFields, array('method = ?' => $variableId)
51
+ );
52
+ }
53
+ #-----------------------------------------------------------------
54
+ #-- Create Table novalnet_order_separefill
55
+ #-----------------------------------------------------------------
56
+ $installer->run("
57
+ CREATE TABLE IF NOT EXISTS `{$tableSeparefill}` (
58
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
59
+ `customer_id` VARCHAR(50) NOT NULL DEFAULT '',
60
+ `pan_hash` VARCHAR(50) NOT NULL,
61
+ `sepa_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
62
+ PRIMARY KEY (`id`),
63
+ INDEX `NOVALNET_SEPA_REFILL` (`customer_id` ASC)
64
+ );
65
+ ");
66
+ #-----------------------------------------------------------------
67
+ #-- Create Table novalnet_order_amountchanged
68
+ #-----------------------------------------------------------------
69
+ $installer->run("
70
+ CREATE TABLE IF NOT EXISTS `{$tableAmountchanged}` (
71
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
72
+ `order_id` VARCHAR(50) NOT NULL DEFAULT '',
73
+ `amount_changed` VARCHAR(50) NOT NULL,
74
+ `amount_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
75
+ PRIMARY KEY (`id`),
76
+ INDEX `NOVALNET_AMOUNT_CHANGED` (`order_id` ASC)
77
+ );
78
+ ");
79
+
80
+ #-----------------------------------------------------------------
81
+ #-- Create Table novalnet_order_recurring
82
+ #-----------------------------------------------------------------
83
+ $installer->run("
84
+ CREATE TABLE IF NOT EXISTS `{$tableRecurring}` (
85
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
86
+ `profile_id` VARCHAR(50) NOT NULL DEFAULT '',
87
+ `signup_tid` VARCHAR(50) NOT NULL DEFAULT '',
88
+ `billingcycle` VARCHAR(50) NOT NULL,
89
+ `callbackcycle` VARCHAR(50) NOT NULL,
90
+ `cycle_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
91
+ PRIMARY KEY (`id`),
92
+ INDEX `NOVALNET_RECURRING` (`profile_id` ASC)
93
+ );
94
+ ");
95
+
96
+ #-----------------------------------------------------------------
97
+ #-- Create Table novalnet_affiliate_account_info
98
+ #-----------------------------------------------------------------
99
+ $installer->run("
100
+ CREATE TABLE IF NOT EXISTS `{$tableAffAccountDetail}` (
101
+ `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
102
+ `vendor_id` int(11) unsigned NOT NULL,
103
+ `vendor_authcode` varchar(40) NOT NULL,
104
+ `product_id` int(11) unsigned NOT NULL,
105
+ `product_url` varchar(200) NOT NULL,
106
+ `activation_date` datetime NOT NULL,
107
+ `aff_id` int(11) unsigned DEFAULT NULL,
108
+ `aff_authcode` varchar(40) DEFAULT NULL,
109
+ `aff_accesskey` varchar(40) NOT NULL,
110
+ PRIMARY KEY (`id`),
111
+ KEY `vendor_id` (`vendor_id`),
112
+ KEY `product_id` (`product_id`),
113
+ KEY `aff_id` (`aff_id`),
114
+ INDEX `NOVALNET_AFFILIATE` (`aff_id` ASC)
115
+ );
116
+ ");
117
+
118
+ #-----------------------------------------------------------------
119
+ #-- Create Table novalnet_aff_user_detail
120
+ #-----------------------------------------------------------------
121
+ $installer->run("
122
+ CREATE TABLE IF NOT EXISTS `{$tableAffUserDetail}` (
123
+ `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
124
+ `aff_id` int(11) unsigned NULL,
125
+ `customer_no` varchar(40) NULL,
126
+ `aff_order_no` varchar(40) NULL,
127
+ PRIMARY KEY (`id`),
128
+ KEY `aff_id` (`aff_id`),
129
+ KEY `customer_no` (`customer_no`),
130
+ KEY `aff_order_no` (`aff_order_no`),
131
+ INDEX `NOVALNET_AFFILIATE_USER` (`customer_no` ASC)
132
+ );
133
+ ");
134
+ $installer->endSetup();
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.3-10.0.0.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /** magento table */
27
+ $tableOrderPayment = $this->getTable('sales/order_payment');
28
+
29
+ /** Novalnet tables */
30
+ $tableSeparefill = $this->getTable('novalnet_payment/separefill');
31
+ $tableAmountchanged = $this->getTable('novalnet_payment/amountchanged');
32
+ $tableRecurring = $this->getTable('novalnet_payment/recurring');
33
+ $tableAffAccountDetail = $this->getTable('novalnet_payment/aff_account_detail');
34
+ $tableAffUserDetail = $this->getTable('novalnet_payment/aff_user_detail');
35
+
36
+ $installer = $this;
37
+
38
+ $installer->startSetup();
39
+
40
+ $paymentMethod = array(
41
+ 'method' => 'novalnetBanktransfer',
42
+ );
43
+ $installer->getConnection()->update(
44
+ $tableOrderPayment, $paymentMethod, array('method = ?' => 'novalnetSofortueberweisung')
45
+ );
46
+
47
+ #-----------------------------------------------------------------
48
+ #-- Create Table novalnet_order_separefill
49
+ #-----------------------------------------------------------------
50
+ $installer->run("
51
+ CREATE TABLE IF NOT EXISTS `{$tableSeparefill}` (
52
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
53
+ `customer_id` VARCHAR(50) NOT NULL DEFAULT '',
54
+ `pan_hash` VARCHAR(50) NOT NULL,
55
+ `sepa_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
56
+ PRIMARY KEY (`id`),
57
+ INDEX `NOVALNET_SEPA_REFILL` (`customer_id` ASC)
58
+ );
59
+ ");
60
+ #-----------------------------------------------------------------
61
+ #-- Create Table novalnet_order_amountchanged
62
+ #-----------------------------------------------------------------
63
+ $installer->run("
64
+ CREATE TABLE IF NOT EXISTS `{$tableAmountchanged}` (
65
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
66
+ `order_id` VARCHAR(50) NOT NULL DEFAULT '',
67
+ `amount_changed` VARCHAR(50) NOT NULL,
68
+ `amount_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
69
+ PRIMARY KEY (`id`),
70
+ INDEX `NOVALNET_AMOUNT_CHANGED` (`order_id` ASC)
71
+ );
72
+ ");
73
+
74
+ #-----------------------------------------------------------------
75
+ #-- Create Table novalnet_order_recurring
76
+ #-----------------------------------------------------------------
77
+ $installer->run("
78
+ CREATE TABLE IF NOT EXISTS `{$tableRecurring}` (
79
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
80
+ `profile_id` VARCHAR(50) NOT NULL DEFAULT '',
81
+ `signup_tid` VARCHAR(50) NOT NULL DEFAULT '',
82
+ `billingcycle` VARCHAR(50) NOT NULL,
83
+ `callbackcycle` VARCHAR(50) NOT NULL,
84
+ `cycle_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
85
+ PRIMARY KEY (`id`),
86
+ INDEX `NOVALNET_RECURRING` (`profile_id` ASC)
87
+ );
88
+ ");
89
+
90
+ #-----------------------------------------------------------------
91
+ #-- Create Table novalnet_affiliate_account_info
92
+ #-----------------------------------------------------------------
93
+ $installer->run("
94
+ CREATE TABLE IF NOT EXISTS `{$tableAffAccountDetail}` (
95
+ `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
96
+ `vendor_id` int(11) unsigned NOT NULL,
97
+ `vendor_authcode` varchar(40) NOT NULL,
98
+ `product_id` int(11) unsigned NOT NULL,
99
+ `product_url` varchar(200) NOT NULL,
100
+ `activation_date` datetime NOT NULL,
101
+ `aff_id` int(11) unsigned DEFAULT NULL,
102
+ `aff_authcode` varchar(40) DEFAULT NULL,
103
+ `aff_accesskey` varchar(40) NOT NULL,
104
+ PRIMARY KEY (`id`),
105
+ KEY `vendor_id` (`vendor_id`),
106
+ KEY `product_id` (`product_id`),
107
+ KEY `aff_id` (`aff_id`),
108
+ INDEX `NOVALNET_AFFILIATE` (`aff_id` ASC)
109
+ );
110
+ ");
111
+
112
+ #-----------------------------------------------------------------
113
+ #-- Create Table novalnet_aff_user_detail
114
+ #-----------------------------------------------------------------
115
+ $installer->run("
116
+ CREATE TABLE IF NOT EXISTS `{$tableAffUserDetail}` (
117
+ `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
118
+ `aff_id` int(11) unsigned NULL,
119
+ `customer_no` varchar(40) NULL,
120
+ `aff_order_no` varchar(40) NULL,
121
+ PRIMARY KEY (`id`),
122
+ KEY `aff_id` (`aff_id`),
123
+ KEY `customer_no` (`customer_no`),
124
+ KEY `aff_order_no` (`aff_order_no`),
125
+ INDEX `NOVALNET_AFFILIATE_USER` (`customer_no` ASC)
126
+ );
127
+ ");
128
+ $installer->endSetup();
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.3-5.0.4.php CHANGED
@@ -48,8 +48,9 @@ $installer->run("
48
  PRIMARY KEY (`id`),
49
  KEY `vendor_id` (`vendor_id`),
50
  KEY `product_id` (`product_id`),
51
- KEY `aff_id` (`aff_id`)
52
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
53
  ");
54
 
55
  #-----------------------------------------------------------------
@@ -64,8 +65,9 @@ $installer->run("
64
  PRIMARY KEY (`id`),
65
  KEY `aff_id` (`aff_id`),
66
  KEY `customer_no` (`customer_no`),
67
- KEY `aff_order_no` (`aff_order_no`)
68
- ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 
69
  ");
70
 
71
  $installer->endSetup();
48
  PRIMARY KEY (`id`),
49
  KEY `vendor_id` (`vendor_id`),
50
  KEY `product_id` (`product_id`),
51
+ KEY `aff_id` (`aff_id`),
52
+ INDEX `NOVALNET_AFFILIATE` (`aff_id` ASC)
53
+ );
54
  ");
55
 
56
  #-----------------------------------------------------------------
65
  PRIMARY KEY (`id`),
66
  KEY `aff_id` (`aff_id`),
67
  KEY `customer_no` (`customer_no`),
68
+ KEY `aff_order_no` (`aff_order_no`),
69
+ INDEX `NOVALNET_AFFILIATE_USER` (`customer_no` ASC)
70
+ );
71
  ");
72
 
73
  $installer->endSetup();
app/code/community/Novalnet/Payment/sql/novalnet_setup/mysql4-upgrade-5.0.4-10.0.0.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ /** magento table */
27
+ $tableOrderPayment = $this->getTable('sales/order_payment');
28
+
29
+ /** Novalnet tables */
30
+ $tableSeparefill = $this->getTable('novalnet_payment/separefill');
31
+ $tableAmountchanged = $this->getTable('novalnet_payment/amountchanged');
32
+ $tableRecurring = $this->getTable('novalnet_payment/recurring');
33
+
34
+ $installer = $this;
35
+
36
+ $installer->startSetup();
37
+
38
+ $paymentMethod = array(
39
+ 'method' => 'novalnetBanktransfer',
40
+ );
41
+ $installer->getConnection()->update(
42
+ $tableOrderPayment, $paymentMethod, array('method = ?' => 'novalnetSofortueberweisung')
43
+ );
44
+
45
+ #-----------------------------------------------------------------
46
+ #-- Create Table novalnet_order_separefill
47
+ #-----------------------------------------------------------------
48
+ $installer->run("
49
+ CREATE TABLE IF NOT EXISTS `{$tableSeparefill}` (
50
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
51
+ `customer_id` VARCHAR(50) NOT NULL DEFAULT '',
52
+ `pan_hash` VARCHAR(50) NOT NULL,
53
+ `sepa_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
54
+ PRIMARY KEY (`id`),
55
+ INDEX `NOVALNET_SEPA_REFILL` (`customer_id` ASC)
56
+ );
57
+ ");
58
+ #-----------------------------------------------------------------
59
+ #-- Create Table novalnet_order_amountchanged
60
+ #-----------------------------------------------------------------
61
+ $installer->run("
62
+ CREATE TABLE IF NOT EXISTS `{$tableAmountchanged}` (
63
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
64
+ `order_id` VARCHAR(50) NOT NULL DEFAULT '',
65
+ `amount_changed` VARCHAR(50) NOT NULL,
66
+ `amount_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
67
+ PRIMARY KEY (`id`),
68
+ INDEX `NOVALNET_AMOUNT_CHANGED` (`order_id` ASC)
69
+ );
70
+ ");
71
+
72
+ #-----------------------------------------------------------------
73
+ #-- Create Table novalnet_order_recurring
74
+ #-----------------------------------------------------------------
75
+ $installer->run("
76
+ CREATE TABLE IF NOT EXISTS `{$tableRecurring}` (
77
+ `id` int(11) UNSIGNED NOT NULL auto_increment,
78
+ `profile_id` VARCHAR(50) NOT NULL DEFAULT '',
79
+ `signup_tid` VARCHAR(50) NOT NULL DEFAULT '',
80
+ `billingcycle` VARCHAR(50) NOT NULL,
81
+ `callbackcycle` VARCHAR(50) NOT NULL,
82
+ `cycle_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
83
+ PRIMARY KEY (`id`),
84
+ INDEX `NOVALNET_RECURRING` (`profile_id` ASC)
85
+ );
86
+ ");
87
+
88
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/novalnet/configuration.xml CHANGED
@@ -1,7 +1,36 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <layout>
3
  <adminhtml_sales_order_create_index>
4
  <reference name="head">
 
 
 
5
  <action method="addJs">
6
  <script>novalnet/novalnetcc.js</script>
7
  </action>
@@ -11,12 +40,28 @@
11
  </reference>
12
  </adminhtml_sales_order_create_index>
13
 
 
 
 
 
 
 
 
 
 
 
14
  <novalnet_payment_adminhtml_sales_order_index>
15
  <reference name="content">
16
  <block type="novalnet_payment/adminhtml_sales_order" name="novalnet_payment_sales_order" />
17
  </reference>
18
  </novalnet_payment_adminhtml_sales_order_index>
19
 
 
 
 
 
 
 
20
  <!--
21
  Sales Order View
22
  -->
@@ -37,8 +82,21 @@
37
  <block>novalnet_payment/adminhtml_sales_order_view_tab_transactionOverview</block>
38
  </action>
39
  </reference>
 
 
 
 
 
40
  </adminhtml_sales_order_view>
41
 
 
 
 
 
 
 
 
 
42
  <!--
43
  Novalnet transaction
44
  -->
@@ -59,7 +117,7 @@
59
  </novalnet_payment_adminhtml_transaction_view>
60
 
61
  <!--
62
- Novalnet transaction overview / order log
63
  -->
64
  <novalnet_payment_adminhtml_transactionoverview_index>
65
  <reference name="content">
@@ -68,7 +126,7 @@
68
  </novalnet_payment_adminhtml_transactionoverview_index>
69
 
70
  <!--
71
- Novalnet transaction overview / order log
72
  -->
73
  <novalnet_payment_adminhtml_transactionoverview_view>
74
  <reference name="content">
@@ -85,6 +143,7 @@
85
  name="novalnet.config.wizard.page.switcher"
86
  before="-"
87
  template="novalnet/payment/configuration/store_switcher.phtml" />
 
88
  </reference>
89
  </novalnet_payment_adminhtml_configuration_wizard_page_index>
90
 
@@ -92,7 +151,7 @@
92
  <reference name="content">
93
  <block type="novalnet_payment/adminhtml_configuration_wizard_page_view"
94
  name="novalnet.config.wizard.page.view"
95
- template="novalnet/payment/configuration/container.phtml" />
96
  </reference>
97
  </novalnet_payment_adminhtml_configuration_wizard_page_view>
98
 
@@ -107,13 +166,34 @@
107
  </reference>
108
  </novalnet_payment_adminhtml_configuration_wizard_page_generalglobal>
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  <!--
111
- Novalnet information index overview / order log
112
  -->
113
- <novalnet_payment_adminhtml_information_index>
114
  <reference name="content">
115
- <block type="novalnet_payment/adminhtml_information"
116
- name="novalnet_payment_information" />
117
  </reference>
118
- </novalnet_payment_adminhtml_information_index>
119
  </layout>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * Part of the payment module of Novalnet AG
17
+ * https://www.novalnet.de
18
+ * If you have found this script useful a small
19
+ * recommendation as well as a comment on merchant form
20
+ * would be greatly appreciated.
21
+ *
22
+ * @category Novalnet
23
+ * @package Novalnet_Payment
24
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ -->
28
  <layout>
29
  <adminhtml_sales_order_create_index>
30
  <reference name="head">
31
+ <action method="addJs">
32
+ <script>novalnet/novalnetJquery.js</script>
33
+ </action>
34
  <action method="addJs">
35
  <script>novalnet/novalnetcc.js</script>
36
  </action>
40
  </reference>
41
  </adminhtml_sales_order_create_index>
42
 
43
+ <adminhtml_sales_recurring_profile_view>
44
+ <reference name="sales.recurring.profile.view">
45
+ <block type="novalnet_payment/sales_adminhtml_recurring_profile_view" name="sales.recurring.profile.view" template="novalnet/widget/view/container.phtml">
46
+ <action method="setDestElementId">
47
+ <value>sales_recurring_profile_view</value>
48
+ </action>
49
+ </block>
50
+ </reference>
51
+ </adminhtml_sales_recurring_profile_view>
52
+
53
  <novalnet_payment_adminhtml_sales_order_index>
54
  <reference name="content">
55
  <block type="novalnet_payment/adminhtml_sales_order" name="novalnet_payment_sales_order" />
56
  </reference>
57
  </novalnet_payment_adminhtml_sales_order_index>
58
 
59
+ <novalnet_payment_adminhtml_sales_recurring_profile_index>
60
+ <reference name="content">
61
+ <block type="novalnet_payment/adminhtml_recurring_profile" name="novalnet_payment_adminhtml_recurring_profile" />
62
+ </reference>
63
+ </novalnet_payment_adminhtml_sales_recurring_profile_index>
64
+
65
  <!--
66
  Sales Order View
67
  -->
82
  <block>novalnet_payment/adminhtml_sales_order_view_tab_transactionOverview</block>
83
  </action>
84
  </reference>
85
+ <reference name="order_tab_info">
86
+ <action method="setTemplate">
87
+ <template>novalnet/sales/order/view/tab/info.phtml</template>
88
+ </action>
89
+ </reference>
90
  </adminhtml_sales_order_view>
91
 
92
+ <adminhtml_sales_order_creditmemo_new>
93
+ <reference name="order_info">
94
+ <action method="setTemplate">
95
+ <template>novalnet/sales/order/view/info.phtml</template>
96
+ </action>
97
+ </reference>
98
+ </adminhtml_sales_order_creditmemo_new>
99
+
100
  <!--
101
  Novalnet transaction
102
  -->
117
  </novalnet_payment_adminhtml_transaction_view>
118
 
119
  <!--
120
+ Novalnet transaction overview
121
  -->
122
  <novalnet_payment_adminhtml_transactionoverview_index>
123
  <reference name="content">
126
  </novalnet_payment_adminhtml_transactionoverview_index>
127
 
128
  <!--
129
+ Novalnet transaction overview view form
130
  -->
131
  <novalnet_payment_adminhtml_transactionoverview_view>
132
  <reference name="content">
143
  name="novalnet.config.wizard.page.switcher"
144
  before="-"
145
  template="novalnet/payment/configuration/store_switcher.phtml" />
146
+
147
  </reference>
148
  </novalnet_payment_adminhtml_configuration_wizard_page_index>
149
 
151
  <reference name="content">
152
  <block type="novalnet_payment/adminhtml_configuration_wizard_page_view"
153
  name="novalnet.config.wizard.page.view"
154
+ template="novalnet/payment/configuration/viewcontainer.phtml" />
155
  </reference>
156
  </novalnet_payment_adminhtml_configuration_wizard_page_view>
157
 
166
  </reference>
167
  </novalnet_payment_adminhtml_configuration_wizard_page_generalglobal>
168
 
169
+ <novalnet_payment_adminhtml_configuration_wizard_page_save>
170
+ <reference name="content">
171
+ <block type="novalnet_payment/adminhtml_configuration_wizard_page_save"
172
+ name="novalnet.config.wizard.page.save" template="novalnet/payment/configuration/paymentcontainer.phtml">
173
+ <block type="novalnet_payment/adminhtml_configuration_wizard_config_payment_form"
174
+ name="form" >
175
+ </block>
176
+ </block>
177
+ </reference>
178
+ </novalnet_payment_adminhtml_configuration_wizard_page_save>
179
+
180
+ <!--
181
+ Novalnet information index overview
182
+ -->
183
+ <novalnet_payment_adminhtml_information_module_index>
184
+ <reference name="content">
185
+ <block type="novalnet_payment/adminhtml_information_module"
186
+ name="novalnet_payment_information_module" />
187
+ </reference>
188
+ </novalnet_payment_adminhtml_information_module_index>
189
+
190
  <!--
191
+ Novalnet merchant administration
192
  -->
193
+ <novalnet_payment_adminhtml_information_novalnetmerchantadmin_index>
194
  <reference name="content">
195
+ <block type="novalnet_payment/adminhtml_information_novalnetmerchantadmin"
196
+ name="novalnet_payment_information_novalnetmerchantadmin" />
197
  </reference>
198
+ </novalnet_payment_adminhtml_information_novalnetmerchantadmin_index>
199
  </layout>
app/design/adminhtml/default/default/template/novalnet/information/{iframe.phtml → module.phtml} RENAMED
@@ -23,8 +23,8 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
26
  ?>
27
- <?php $url = $this->getNovalnetUrl(); ?>
28
  <div style="width:100%;">
29
  <iframe src="<?php echo $url ?>" width="100%" frameborder="0" border="0"
30
  style="min-height:1300px; height: 100%; overflow: hidden;">
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $url = $this->getNovalnetUrl();
27
  ?>
 
28
  <div style="width:100%;">
29
  <iframe src="<?php echo $url ?>" width="100%" frameborder="0" border="0"
30
  style="min-height:1300px; height: 100%; overflow: hidden;">
app/design/{frontend/base/default/template/novalnet/payment/method/pdf/Sofortueberweisung.phtml → adminhtml/default/default/template/novalnet/information/novalnetmerchantadmin.phtml} RENAMED
@@ -1,29 +1,32 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
- * would be greatly appreciated.
20
- *
21
- * @category Novalnet
22
- * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- ?>
27
- <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
28
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
29
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $this->getInfo()->getLastTransId()) ?>{{pdf_row_separator}}
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $url = $this->getNovalnetAdminUrl();
27
+ ?>
28
+ <div style="width:100%;">
29
+ <iframe src="<?php echo $url ?>" width="100%" frameborder="0" border="0"
30
+ style="min-height:900px; height: 100%; overflow: hidden;">
31
+ </iframe>
32
+ </div>
app/design/adminhtml/default/default/template/novalnet/payment/configuration/paymentcontainer.phtml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->getFormInitScripts() ?>
28
+ <div class="content-header">
29
+ <?php echo $this->getHeaderHtml() ?>
30
+ </div>
31
+ <?php echo $this->getFormHtml() ?>
32
+ <div class="content-header">
33
+ <p class="form-buttons"><?php echo $this->getButtonsHtml('header') ?></p>
34
+ </div>
35
+ <script type="text/javascript">
36
+ saveForm = new varienForm('save_form', '<?php echo $this->getValidationUrl() ?>');
37
+ </script>
38
+ <?php echo $this->getFormScripts() ?>
app/design/adminhtml/default/default/template/novalnet/payment/configuration/{container.phtml → viewcontainer.phtml} RENAMED
@@ -31,7 +31,9 @@
31
  </tr>
32
  </table>
33
  </div>
 
34
  <?php echo $this->getViewHtml() ?>
 
35
  <div class="content-header" id="novalnet_wizard_form_buttons">
36
  <table cellspacing="0">
37
  <tr>
31
  </tr>
32
  </table>
33
  </div>
34
+
35
  <?php echo $this->getViewHtml() ?>
36
+
37
  <div class="content-header" id="novalnet_wizard_form_buttons">
38
  <table cellspacing="0">
39
  <tr>
app/design/adminhtml/default/default/template/novalnet/payment/method/form/Cc.phtml CHANGED
@@ -26,18 +26,17 @@
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
- $refillValues = $assignDatahelper->_getCheckout()->getData($code);
30
- $ccRefill = $this->getMethod()->getConfigData('cc_refill');
31
  $billingaddres = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getBillingAddress();
32
-
33
  ?>
34
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
35
  <!--{{{ Payment Logo -->
36
  <div>
37
  <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;float:none;">
38
  <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
39
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $typeCode . "_Logo.png"; ?>
40
- <img style="height:20px;" src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
41
  <?php endforeach; ?>
42
  </a>
43
  </div>
@@ -46,7 +45,7 @@ $billingaddres = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getB
46
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
47
  <div class="nnccloader" id='cc_loading' style='display:none;'></div>
48
  <li>
49
- <?php echo $this->__('The amount will be booked immediately from your credit card.'); ?>
50
  </li>
51
  <?php if ($this->getUserInfo()): ?>
52
  <li>
@@ -62,61 +61,64 @@ $billingaddres = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getB
62
  <?php endif ?>
63
  <li>
64
  <div class="input-box">
65
- <label for="<?php echo $code ?>_cc_type"><?php echo $this->__('NN CC type') ?><span class="required">*</span></label><br />
66
- <select id="<?php echo $code ?>_cc_type" onchange="ccHashCall();" class="required-entry validate-cc-type-select">
67
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
68
- <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
69
- <option value="<?php echo $typeCode ?>"><?php echo $typeName ?></option>
70
- <?php endforeach; ?>
71
  </select>
72
  </div>
73
  </li>
74
  <li>
75
  <div class="input-box">
76
  <label for="<?php echo $code ?>_cc_owner"><?php echo $this->__('NN CC holder') ?><span class="required">*</span></label><br/>
77
- <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_cc_owner" autocomplete="off" onchange="ccHashCall();" value="<?php $billingaddres->getFirstname().' '.$billingaddres->getLastname()?>" />
78
  </div>
79
  </li>
80
- <li>
81
- <div class="input-box">
82
  <label for="<?php echo $code ?>_cc_number"><?php echo $this->__('NN CC number') ?><span class="required">*</span></label><br/>
83
- <input type="text" id="<?php echo $code ?>_cc_number" title="<?php echo $this->__('Credit Card Number') ?>" class="required-entry input-text validate-cc-number validate-cc-type" autocomplete="off" onchange="ccHashCall();" onkeypress="return isNumberKey(event, true);" value="" />
84
  </div>
85
  </li>
86
  <li>
87
  <div class="input-box">
88
- <label for="<?php echo $code ?>_expiration"><?php echo $this->__('NN Expiration Date') ?><span class="required">*</span></label><br />
89
- <select id="<?php echo $code ?>_expiration" style="width:140px;" onchange="ccHashCall();" class="required-entry">
90
- <option value=""><?php echo $this->__('Month'); ?></option>
91
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
92
- <option value="<?php echo $k ?>"><?php echo $v ?></option>
93
- <?php endforeach; ?>
94
- </select>
95
- <select id="<?php echo $code ?>_expiration_yr" style="width:103px;" onchange="ccHashCall();" class="required-entry">
96
- <option value=""><?php echo $this->__('Year'); ?></option>
97
- <?php foreach ($this->getCcYears() as $k => $v): ?>
98
- <option value="<?php echo $k ?>"><?php echo $v ?></option>
99
- <?php endforeach; ?>
100
- </select>
101
  </div>
102
  </li>
103
  <li>
104
- <div class="input-box">
105
  <label for="<?php echo $code ?>_cc_cid"><?php echo $this->__('NN CVC') ?><span class="required">*</span></label><br />
106
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Card Verification Number') ?>" onchange="ccHashCall();" onkeypress="return isNumberKey(event);" class="required-entry input-text validate-cc-cvn" id="<?php echo $code ?>_cc_cid" name="payment[nn_cc_cid]" style="width:3em;" autocomplete="off" />
107
  </div>
108
  </li>
109
  </ul>
 
110
  <input type="hidden" id="original_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>" />
111
  <input type="hidden" id="original_vendor_authcode" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>" />
 
 
 
112
  <input type="hidden" name="novalnet_cc_hash" id="novalnet_cc_hash" value="" />
113
- <input type="hidden" name="novalnet_cc_pan_hash" id="novalnet_cc_pan_hash" value="<?php echo $ccRefill ? $refillValues->getCcPanHash() : ''; ?>" />
114
- <input type="hidden" name="novalnet_cc_unique_id" id="novalnet_cc_unique_id" value="<?php echo $ccRefill ? $refillValues->getCcUniqueId() : ''; ?>" />
115
  <input type="hidden" id="nn_cc_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
116
- <input type="hidden" id="nn_cc_validate_error_message" value="<?php echo $this->__('Please enter valid credit card details') . '!'; ?>" />
117
-
118
  </fieldset>
119
-
120
  <style>
121
  .nnccloader {
122
  position: fixed;
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
+ $ccRefill = $this->getMethod()->_getConfigData('auto_refill', true);
30
+ // get quote billing address
31
  $billingaddres = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getBillingAddress();
 
32
  ?>
33
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
34
  <!--{{{ Payment Logo -->
35
  <div>
36
  <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;float:none;">
37
  <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
38
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $typeCode . ".png"; ?>
39
+ <img style="height:20px;display:inline;" src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
40
  <?php endforeach; ?>
41
  </a>
42
  </div>
45
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
46
  <div class="nnccloader" id='cc_loading' style='display:none;'></div>
47
  <li>
48
+ <?php echo $this->__('The amount will be debited from your credit card once the order is submitted'); ?>
49
  </li>
50
  <?php if ($this->getUserInfo()): ?>
51
  <li>
61
  <?php endif ?>
62
  <li>
63
  <div class="input-box">
64
+ <label for="<?php echo $code ?>_cc_type"><?php echo $this->__('NN CC type') ?><span class="required">*</span></label><br />
65
+ <select id="<?php echo $code ?>_cc_type" onchange="cchashcall()" class="required-entry validate-cc-type-select">
66
+ <option value=""><?php echo $this->__('NN Select') ?></option>
67
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
68
+ <option value="<?php echo $_typeCode ?>"><?php echo $_typeName ?></option>
69
+ <?php endforeach; ?>
70
  </select>
71
  </div>
72
  </li>
73
  <li>
74
  <div class="input-box">
75
  <label for="<?php echo $code ?>_cc_owner"><?php echo $this->__('NN CC holder') ?><span class="required">*</span></label><br/>
76
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_cc_owner" autocomplete="off" onchange="cchashcall()" value="<?php echo $billingaddres->getFirstname() . ' ' . $billingaddres->getLastname(); ?>" />
77
  </div>
78
  </li>
79
+ <li>
80
+ <div class="input-box">
81
  <label for="<?php echo $code ?>_cc_number"><?php echo $this->__('NN CC number') ?><span class="required">*</span></label><br/>
82
+ <input type="text" id="<?php echo $code ?>_cc_number" title="<?php echo $this->__('Credit Card Number') ?>" class="required-entry input-text validate-cc-number validate-cc-type" autocomplete="off" onchange="cchashcall()" onkeypress="return isNumberKey(event,true)" value="" />
83
  </div>
84
  </li>
85
  <li>
86
  <div class="input-box">
87
+ <label for="<?php echo $code ?>_expiration"><?php echo $this->__('NN Expiration Date') ?><span class="required">*</span></label><br />
88
+ <select id="<?php echo $code ?>_expiration" style="width:140px;" onchange="cchashcall()" class="month validate-cc-exp required-entry">
89
+ <option value=""><?php echo $this->__('Month'); ?></option>
90
+ <?php foreach ($this->getCcMonths() as $k => $v): ?>
91
+ <option value="<?php echo $k ?>"><?php echo $v ?></option>
92
+ <?php endforeach; ?>
93
+ </select>
94
+ <select id="<?php echo $code ?>_expiration_yr" style="width:103px;" onchange="cchashcall()" class="required-entry">
95
+ <option value=""><?php echo $this->__('Year'); ?></option>
96
+ <?php foreach ($this->getCcYears() as $k => $v): ?>
97
+ <option value="<?php echo $k ?>"><?php echo $v ?></option>
98
+ <?php endforeach; ?>
99
+ </select>
100
  </div>
101
  </li>
102
  <li>
103
+ <div class="input-box">
104
  <label for="<?php echo $code ?>_cc_cid"><?php echo $this->__('NN CVC') ?><span class="required">*</span></label><br />
105
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" onkeypress="return isNumberKey(event, false)" class="required-entry input-text validate-cc-cvn" id="<?php echo $code ?>_cc_cid" name="payment[nn_cc_cid]" style="width:3em;" autocomplete="off" />
106
  </div>
107
  </li>
108
  </ul>
109
+
110
  <input type="hidden" id="original_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>" />
111
  <input type="hidden" id="original_vendor_authcode" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>" />
112
+ <input type="hidden" id="novalnet_cc_pan_hash" value="<?php
113
+ echo $ccRefill ? $assignDatahelper->getCheckout()->getCcPanHash() : '';
114
+ ?>" />
115
  <input type="hidden" name="novalnet_cc_hash" id="novalnet_cc_hash" value="" />
116
+ <input type="hidden" name="novalnet_cc_unique_id" id="novalnet_cc_unique_id" value="<?php echo $ccRefill ? $assignDatahelper->getCheckout()->getCcUniqueId() : '';
117
+ ?>" />
118
  <input type="hidden" id="nn_cc_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
119
+ <input type="hidden" id="nn_cc_validate_error_message" value="<?php echo $this->__('Your credit card details are invalid') . '!'; ?>" />
120
+ <!--}}} Novalnet Cc Form -->
121
  </fieldset>
 
122
  <style>
123
  .nnccloader {
124
  position: fixed;
app/design/adminhtml/default/default/template/novalnet/payment/method/form/Invoice.phtml CHANGED
@@ -23,24 +23,22 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $code = $this->getMethodCode();
29
  $helper = Mage::helper('novalnet_payment');
30
  ?>
31
  <fieldset class="form-list">
32
  <!-- PAYMENT LOGO -->
33
  <div>
34
- <A HREF="<?php echo $helper->getNovalnetUrl() ?>" TARGET="_new" style="text-decoration:none;">
35
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "kauf-auf-rechnung.png"; ?>
36
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
37
- </A>
38
  </div>
39
  <!-- PAYMENT LOGO -->
40
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
41
  <!--{{{ PAYMENT DESCRIPTION -->
42
  <li>
43
- <?php echo $this->__('The Bank details will be emailed to you soon after the completion of checkout process') ?>
44
  </li>
45
  <?php if ($this->getUserInfo()): ?>
46
  <li>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
29
  <fieldset class="form-list">
30
  <!-- PAYMENT LOGO -->
31
  <div>
32
+ <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
33
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "invoice.png"; ?>
34
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
35
+ </a>
36
  </div>
37
  <!-- PAYMENT LOGO -->
38
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
39
  <!--{{{ PAYMENT DESCRIPTION -->
40
  <li>
41
+ <?php echo $this->__('Invoice/Prepayment payment description') ?>
42
  </li>
43
  <?php if ($this->getUserInfo()): ?>
44
  <li>
app/design/adminhtml/default/default/template/novalnet/payment/method/form/Prepayment.phtml CHANGED
@@ -23,8 +23,6 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $code = $this->getMethodCode();
29
  $helper = Mage::helper('novalnet_payment');
30
  ?>
@@ -32,7 +30,7 @@ $helper = Mage::helper('novalnet_payment');
32
  <!-- PAYMENT LOGO -->
33
  <div>
34
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
35
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "vorauskasse.png"; ?>
36
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
37
  </a>
38
  </div>
@@ -40,7 +38,7 @@ $helper = Mage::helper('novalnet_payment');
40
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
41
  <!--{{{ PAYMENT DESCRIPTION -->
42
  <li>
43
- <?php echo $this->__('The Bank details will be emailed to you soon after the completion of checkout process') ?>
44
  </li>
45
  <?php if ($this->getUserInfo()): ?>
46
  <li>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
30
  <!-- PAYMENT LOGO -->
31
  <div>
32
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
33
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "prepayment.png"; ?>
34
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
35
  </a>
36
  </div>
38
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
39
  <!--{{{ PAYMENT DESCRIPTION -->
40
  <li>
41
+ <?php echo $this->__('Invoice/Prepayment payment description') ?>
42
  </li>
43
  <?php if ($this->getUserInfo()): ?>
44
  <li>
app/design/adminhtml/default/default/template/novalnet/payment/method/form/Sepa.phtml CHANGED
@@ -25,30 +25,29 @@
25
  */
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
- $sepaRefill = $this->getMethod()->getConfigData('sepa_refill');
29
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
30
- $refillValues = $assignDatahelper->_getCheckout()->getData($code);
 
 
31
  $refillMethod = ($sepaRefill && $refillValues != '' && $code == $refillValues->getMethod());
32
-
33
  $billingaddres = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getBillingAddress();
34
- $billingCountry = $billingaddres->getcountryId() ? strtoupper($billingaddres->getcountryId()) : 'DE';
35
- $accountHolder = $refillMethod ? $refillValues->getAccountHolder() : '';
36
- $refillName = ($sepaRefill && $accountHolder) ? $accountHolder : $billingaddres->getFirstname() . ' ' . $billingaddres->getLastname();
37
- $dataStreet = $billingaddres->getStreet();
38
- $dataCity = $billingaddres->getCity();
39
- $dataCompany = $billingaddres->getCompany();
40
- $dataPostcode = $billingaddres->getPostcode();
41
- $dataemail = $billingaddres->getEmail();
42
- foreach ($dataStreet as $dataStreetValue) {
43
- $quoteaddress = $dataStreetValue;
44
  }
45
  ?>
46
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
47
  <!--{{{ Payment Logo -->
48
  <div>
49
- <a HREF="<?php echo $helper->getNovalnetUrl(); ?>" TARGET="_new" style="text-decoration:none;">
50
  <?php
51
- $image = "sepa_logo.png";
52
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
53
  ?>
54
  <img src="<?php echo $imgpath; ?>" alt="<?php echo $this->getMethod()->getConfigData('title'); ?>" title="<?php echo $this->getMethod()->getConfigData('title'); ?>" />
@@ -59,7 +58,7 @@ foreach ($dataStreet as $dataStreetValue) {
59
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
60
  <div class="nnsepaloader" id='sepa_loading' style='display:none;'></div>
61
  <li>
62
- <?php echo $this->__('Your account will be debited upon delivery of goods.'); ?>
63
  </li>
64
  <?php if ($this->getUserInfo()): ?>
65
  <li>
@@ -67,76 +66,80 @@ foreach ($dataStreet as $dataStreetValue) {
67
  </li>
68
  <?php endif ?>
69
  <?php if (Mage::helper('novalnet_payment')->getModel('novalnetSepa')->_getConfigData('live_mode', true) == 0): ?>
70
- <li>
71
- <div style="font-weight:bold;color:red;font-size:12px;">
72
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
73
- </div>
74
- </li>
75
  <?php endif ?>
 
76
  <li class="fields">
77
  <div class="field">
78
- <label style="float:none;" for="<?php echo $code ?>_account_holder"><?php echo $this->__('NN Account Holder') ?><span class="required">*</span></label><br/>
79
  <div class="input-box">
80
- <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_account_holder" name="payment[account_holder]" autocomplete="off" onchange="unsetHashRelatedElements()" value="<?php echo $sepaRefill ? $refillName : ''; ?>" />
81
  </div>
82
  </div>
83
  </li>
84
  <li class="fields">
85
- <div class="field">
86
  <label style="float:none;" for="<?php echo $code ?>_bank_country"><?php echo $this->__('NN Country') ?><span class="required">*</span></label><br />
87
  <div class="input-box">
88
- <?php
89
- $_countries = Mage::getResourceModel('directory/country_collection')
90
- ->loadData()
91
- ->toOptionArray(false)
92
- ?>
93
- <?php if (count($_countries) > 0): ?>
94
- <select id="<?php echo $code ?>_bank_country" onchange="unsetHashRelatedElements()" class="required-entry">
95
- <?php
96
- foreach ($_countries as $_country):
97
- if (in_array($billingCountry, $_country)) {
98
- ?>
99
- <option selected value="<?php echo $_country['value'] ?>"><?php echo $_country['label'] ?>
100
- </option>
101
  <?php } else { ?>
102
- <option value="<?php echo $_country['value'] ?>">
103
- <?php echo $_country['label'] ?>
104
- </option>
105
- <?php } ?>
106
- <?php endforeach; ?>
107
- </select><br/>
108
- <?php endif; ?>
109
- </div>
110
  </div>
111
  </li>
112
  <li class="fields">
113
  <div class="field">
114
- <label style="float:none;" for="<?php echo $code ?>_account_number"><?php echo $this->__('IBAN or Account Number') ?><span class="required">*</span></label><br/>
115
  <div class="input-box">
116
- <input type="text" id="<?php echo $code ?>_account_number" onchange="unsetHashRelatedElements()" title="<?php echo $this->__('IBAN or Account Number') ?>" class="required-entry input-text" autocomplete="off" value="" />
117
  </div>
118
  </div>
119
  </li>
 
120
  <li class="fields">
121
  <div class="field">
122
- <label style="float:none;" for="<?php echo $code ?>_bank_code"><?php echo $this->__('BIC or Bank Code') ?><span class="required">*</span></label><br/>
123
  <div class="input-box">
124
- <input type="text" id="<?php echo $code ?>_bank_code" title="<?php echo $this->__('BIC or Bank Code') ?>" class="input-text" autocomplete="off" onchange="unsetHashRelatedElements()" value="" />
125
  </div>
126
  </div>
127
  </li>
 
128
  <li class="fields">
129
  <div class="field">
130
  <div class="input-box">
131
- <input type="checkbox" id="<?php echo $code ?>_mandate_confirm" title="<?php echo $this->__('confirm') ?>" class="required-entry" onclick="sepaIbanBicCall(this)"/>
132
- <label style="float:none;" for="<?php echo $code ?>_mandate_confirm"><?php echo $this->__('NN Confirm') ?></label><br/>
133
- </div>
134
  </div>
135
  </li>
136
  <!-- Mandate overlay START-->
137
  <li>
138
  <div class="bgCover">&nbsp;</div>
139
- <div id='sepa_mandate_overlay_block_first' style='display:none;' class='nnsepaloader'></div>
 
140
  <div id='sepa_mandate_overlay_block' style='display:none;' class='overlay_window_block'>
141
  <div class='nn_header'>
142
  <h1><?php echo $this->__('SEPA Direct Debit Mandate Confirmation') ?></h1>
@@ -155,6 +158,7 @@ foreach ($dataStreet as $dataStreetValue) {
155
  </tr>
156
  </table><br/>
157
  <?php echo $this->__('SEPA Confirm paragraph') ?>
 
158
  <br/> <br/>
159
  <?php echo $this->__('SEPA Confirm note') ?>
160
  <br/> <br/>
@@ -162,63 +166,71 @@ foreach ($dataStreet as $dataStreetValue) {
162
  <tr>
163
  <td><?php echo $this->__('Name of the payee') ?></td><td>:</td><td><span id='sepa_overlay_enduserfullname_span'>&nbsp;</span></td>
164
  </tr>
165
- <?php if ($dataCompany): ?>
 
 
 
 
166
  <tr>
167
- <td><?php echo $this->__('Company') ?></td><td>:</td><td><?php echo $dataCompany; ?></td>
168
  </tr>
169
- <?php endif; ?>
170
- <?php if ($quoteaddress): ?>
171
  <tr>
172
- <td><?php echo $this->__('Address') ?></td><td>:</td><td><?php echo $quoteaddress; ?></td>
173
  </tr>
174
- <?php endif; ?>
175
- <?php if ($dataPostcode && $dataCity): ?>
176
  <tr>
177
- <td><?php echo $this->__('Zip Code And City') ?></td><td>:</td><td><?php echo $dataPostcode; ?><span id='sepa_overlay_enduserzipcode_span'>&nbsp;</span> <?php echo $dataCity; ?></td>
178
  </tr>
179
- <?php endif; ?>
180
- <?php if ($dataPostcode): ?>
181
  <tr>
182
  <td><?php echo $this->__('Country') ?></td><td>:</td><td><span id='sepa_overlay_endusercountry_span'>&nbsp;</span></td>
183
  </tr>
184
- <?php endif; ?>
185
- <?php if ($dataemail): ?>
186
  <tr>
187
- <td><?php echo $this->__('Email') ?></td><td>:</td><td><?php echo $dataemail; ?></td>
188
  </tr>
189
- <?php endif; ?>
190
  <tr id='nn_sepa_overlay_iban_tr'>
191
  <td><?php echo $this->__('IBAN') ?></td><td>:</td><td><span id='sepa_overlay_iban_span'>&nbsp;</span></td>
192
  </tr>
193
  <tr id='nn_sepa_overlay_bic_tr'>
194
  <td><?php echo $this->__('BIC') ?></td><td>:</td><td><span id='sepa_overlay_bic_span'>&nbsp;</span></td>
195
  </tr>
 
196
  </table>
197
  <br/>
198
- <?php echo $dataCity; ?>, <span id='sepa_overlay_mandatedate_span'>&nbsp;</span>, <span id='sepa_overlay_enduserfullname_span1'>&nbsp;</span>
199
  </p>
200
  </div>
201
  <div class='nn_footer'>
202
- <input style="width: 30%" type='button' id='mandate_confirm_btn' name='mandate_confirm_btn' onclick="mandateConfirmButtonSubmit()" value=<?php echo $this->__('conirm_mandate') ?> class='mandate_confirm_btn' />
203
- <input style="width: 30%" type='button' id='mandate_cancel_btn' name='mandate_cancel_btn' onclick="mandateCancelButtonSubmit()" value=<?php echo $this->__('NN cancel') ?> class='mandate_confirm_btn' />
204
  <img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>logo.png' width=120 alt='Novalnet AG' style='float:right;' />
205
  </div>
206
  </div>
207
  </li>
208
  <!-- Mandate overlay END-->
209
  </ul>
 
 
 
 
 
 
 
 
 
 
 
210
  <input type="hidden" id="nn_sepa_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
211
- <input type="hidden" id="nn_sepa_validate_error_message" value="<?php echo $this->__('Please enter valid account details') . '!'; ?>" />
212
- <input type="hidden" id="process_vendor_id" name="process_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>"/>
213
- <input type="hidden" id="auth_code" name="auth_code" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>"/>
214
- <input type="hidden" id="sepa_payment_id" value="37" name="sepa_payment_id">
215
- <input type="hidden" id="result_sepa_hash" value="<?php echo $sepaRefill ? $refillValues->getSepaHash() : ''; ?>" name="result_sepa_hash">
216
- <input type="hidden" id="result_mandate_date" value="" name="result_mandate_date">
217
- <input type="hidden" id="result_mandate_ref" value="" name="result_mandate_ref">
218
- <input type="hidden" id="result_mandate_unique" value="" name="result_mandate_unique">
219
- <input type="hidden" id="nnsepa_iban_confirmed" value="0" name="nnsepa_iban_confirmed">
220
- <input type="hidden" id="sepaiban" value="" name="sepaiban">
221
- <input type="hidden" id="sepabic" value="" name="sepabic">
222
  </fieldset>
223
  <style>
224
  .nnsepaloader {
25
  */
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
 
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
+ $sepaRefill = $this->getMethod()->_getConfigData('auto_refill', true);
30
+ $sepaPaymentRefill = $this->getMethod()->getConfigData('sepa_payment_refill');
31
+ $refillValues = $assignDatahelper->getCheckout()->getRefilldatavalues();
32
  $refillMethod = ($sepaRefill && $refillValues != '' && $code == $refillValues->getMethod());
33
+ // get quote billing address
34
  $billingaddres = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getBillingAddress();
35
+ $street = $billingaddres->getStreet();
36
+ $customerlogin = Mage::getSingleton('customer/session')->isLoggedIn();
37
+ $panhash = '';
38
+
39
+ if ($sepaPaymentRefill && $customerlogin) {
40
+ $panhash = Mage::getModel('novalnet_payment/separefill')->getSepaPanHash($helper);
41
+ } else if ($sepaRefill) {
42
+ $panhash = $assignDatahelper->getCheckout()->getSepaHash();
 
 
43
  }
44
  ?>
45
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
46
  <!--{{{ Payment Logo -->
47
  <div>
48
+ <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;">
49
  <?php
50
+ $image = "sepa.png";
51
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
52
  ?>
53
  <img src="<?php echo $imgpath; ?>" alt="<?php echo $this->getMethod()->getConfigData('title'); ?>" title="<?php echo $this->getMethod()->getConfigData('title'); ?>" />
58
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
59
  <div class="nnsepaloader" id='sepa_loading' style='display:none;'></div>
60
  <li>
61
+ <?php echo $this->__('Your account will be debited upon the order submission'); ?>
62
  </li>
63
  <?php if ($this->getUserInfo()): ?>
64
  <li>
66
  </li>
67
  <?php endif ?>
68
  <?php if (Mage::helper('novalnet_payment')->getModel('novalnetSepa')->_getConfigData('live_mode', true) == 0): ?>
69
+ <li>
70
+ <div style="font-weight:bold;color:red;font-size:12px;">
71
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
72
+ </div>
73
+ </li>
74
  <?php endif ?>
75
+
76
  <li class="fields">
77
  <div class="field">
78
+ <label style="float:none;" for="<?php echo $code ?>_account_holder"><?php echo $this->__('Account Holder') ?><span class="required">*</span></label><br/>
79
  <div class="input-box">
80
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_account_holder" onkeypress="return ibanbicValidate(event)" onchange="unsetHashRelatedElements();" name="payment[account_holder]" autocomplete="off" value="<?php echo $billingaddres->getFirstname() . ' ' . $billingaddres->getLastname(); ?>" />
81
  </div>
82
  </div>
83
  </li>
84
  <li class="fields">
85
+ <div class="field">
86
  <label style="float:none;" for="<?php echo $code ?>_bank_country"><?php echo $this->__('NN Country') ?><span class="required">*</span></label><br />
87
  <div class="input-box">
88
+ <?php
89
+ $_countries = Mage::getResourceModel('directory/country_collection')
90
+ ->loadData()
91
+ ->toOptionArray(false)
92
+ ?>
93
+ <?php if (count($_countries) > 0): ?>
94
+ <select id="<?php echo $code ?>_bank_country" onchange="unsetHashRelatedElements()" class="required-entry">
95
+ <?php
96
+ foreach ($_countries as $_country):
97
+ if (in_array($billingaddres->getCountryId(), $_country)) {
98
+ ?>
99
+ <option selected value="<?php echo $_country['value'] ?>"><?php echo $_country['label'] ?>
100
+ </option>
101
  <?php } else { ?>
102
+ <option value="<?php echo $_country['value'] ?>">
103
+ <?php echo $_country['label'] ?>
104
+ </option>
105
+ <?php } ?>
106
+ <?php endforeach; ?>
107
+ </select><br/>
108
+ <?php endif; ?>
109
+ </div>
110
  </div>
111
  </li>
112
  <li class="fields">
113
  <div class="field">
114
+ <label style="float:none;" for="<?php echo $code ?>_account_number"><?php echo $this->__('IBAN or Account number') ?><span class="required">*</span></label><br/>
115
  <div class="input-box">
116
+ <input type="text" id="<?php echo $code ?>_account_number" onkeypress="return ibanbicValidate(event)" onchange="unsetHashRelatedElements();" title="<?php echo $this->__('IBAN or Account number') ?>" class="required-entry input-text" autocomplete="off" value="" />
117
  </div>
118
  </div>
119
  </li>
120
+
121
  <li class="fields">
122
  <div class="field">
123
+ <label style="float:none;" for="<?php echo $code ?>_bank_code"><?php echo $this->__('BIC or Bank code') ?><span class="required">*</span></label><br/>
124
  <div class="input-box">
125
+ <input type="text" id="<?php echo $code ?>_bank_code" title="<?php echo $this->__('BIC or Bank code') ?>" class="input-text" autocomplete="off" onkeypress="return ibanbicValidate(event)" onchange="unsetHashRelatedElements()" value="" />
126
  </div>
127
  </div>
128
  </li>
129
+
130
  <li class="fields">
131
  <div class="field">
132
  <div class="input-box">
133
+ <input type="checkbox" id="<?php echo $code ?>_mandate_confirm" title="<?php echo $this->__('confirm') ?>" class="required-entry" onclick="generate_sepa_iban_bic(this, '<?php echo $this->__('Your account details are invalid') ?>', '<?php echo $this->__('Basic parameter not valid') ?>')"/>
134
+ <label style="float:none;" ><?php echo $this->__('NN Confirm') ?><span class="required"></span></label><br/>
135
+ </div>
136
  </div>
137
  </li>
138
  <!-- Mandate overlay START-->
139
  <li>
140
  <div class="bgCover">&nbsp;</div>
141
+ <div id='sepa_mandate_overlay_block_first' style='display:none;' class='nnsepaloader'>
142
+ </div>
143
  <div id='sepa_mandate_overlay_block' style='display:none;' class='overlay_window_block'>
144
  <div class='nn_header'>
145
  <h1><?php echo $this->__('SEPA Direct Debit Mandate Confirmation') ?></h1>
158
  </tr>
159
  </table><br/>
160
  <?php echo $this->__('SEPA Confirm paragraph') ?>
161
+
162
  <br/> <br/>
163
  <?php echo $this->__('SEPA Confirm note') ?>
164
  <br/> <br/>
166
  <tr>
167
  <td><?php echo $this->__('Name of the payee') ?></td><td>:</td><td><span id='sepa_overlay_enduserfullname_span'>&nbsp;</span></td>
168
  </tr>
169
+ <?php if($billingaddres->getCompany()) { ?>
170
+ <tr>
171
+ <td><?php echo $this->__('Company name') ?></td><td>:</td><td><?php echo $billingaddres->getCompany(); ?></td>
172
+ </tr>
173
+ <?php } ?>
174
  <tr>
175
+ <td><?php echo $this->__('NN Address') ?></td><td>:</td><td><?php echo $street[0]; ?></td>
176
  </tr>
177
+ <?php if(isset($street[1]) && $street[1]) { ?>
 
178
  <tr>
179
+ <td><?php echo $this->__('NN Street') ?></td><td>:</td><td><?php echo $street[1]; ?></td>
180
  </tr>
181
+ <?php }?>
 
182
  <tr>
183
+ <td><?php echo $this->__('Zip Code And City') ?></td><td>:</td><td><?php echo $billingaddres->getPostcode(); ?><span id='sepa_overlay_enduserzipcode_span'>&nbsp;</span> <?php echo $billingaddres->getCity(); ?></td>
184
  </tr>
 
 
185
  <tr>
186
  <td><?php echo $this->__('Country') ?></td><td>:</td><td><span id='sepa_overlay_endusercountry_span'>&nbsp;</span></td>
187
  </tr>
188
+ <?php if($billingaddres->getEmail()) { ?>
 
189
  <tr>
190
+ <td><?php echo $this->__('Email') ?></td><td>:</td><td><?php echo $billingaddres->getEmail(); ?></td>
191
  </tr>
192
+ <?php } ?>
193
  <tr id='nn_sepa_overlay_iban_tr'>
194
  <td><?php echo $this->__('IBAN') ?></td><td>:</td><td><span id='sepa_overlay_iban_span'>&nbsp;</span></td>
195
  </tr>
196
  <tr id='nn_sepa_overlay_bic_tr'>
197
  <td><?php echo $this->__('BIC') ?></td><td>:</td><td><span id='sepa_overlay_bic_span'>&nbsp;</span></td>
198
  </tr>
199
+
200
  </table>
201
  <br/>
202
+ <?php echo $billingaddres->getCity(); ?>, <span id='sepa_overlay_mandatedate_span'>&nbsp;</span>, <span id='sepa_overlay_enduserfullname_span1'>&nbsp;</span>
203
  </p>
204
  </div>
205
  <div class='nn_footer'>
206
+ <input style="width: 30%" type='button' id='mandate_confirm_btn' name='mandate_confirm_btn' onclick="mandate_confirm_btn_submit()" value=<?php echo $this->__('conirm_mandate') ?> class='mandate_confirm_btn' />
207
+ <input style="width: 30%" type='button' id='mandate_cancel_btn' name='mandate_cancel_btn' onclick="mandate_cancel_btn_submit()" value=<?php echo $this->__('cancel') ?> class='mandate_confirm_btn' />
208
  <img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>logo.png' width=120 alt='Novalnet AG' style='float:right;' />
209
  </div>
210
  </div>
211
  </li>
212
  <!-- Mandate overlay END-->
213
  </ul>
214
+
215
+ <input type="hidden" id="process_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>"/>
216
+ <input type="hidden" id="auth_code" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>"/>
217
+ <input id="sepaiban" type="hidden" value="">
218
+ <input id="sepabic" type="hidden" value="">
219
+ <input id="sepa_payment_id" type="hidden" value="37">
220
+ <input id="novalnet_sepa_owner" type="hidden" value="">
221
+ <input id="result_mandate_date" type="hidden" value="">
222
+ <input id="result_mandate_ref" type="hidden" value="">
223
+ <input id="result_mandate_unique" type="hidden" value="" name="result_mandate_unique">
224
+ <input id="nnsepa_iban_confirmed" type="hidden" value="0" name="nnsepa_iban_confirmed">
225
  <input type="hidden" id="nn_sepa_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
226
+ <input type="hidden" id="nn_sepa_validate_error_message" value="<?php echo $this->__('Your account details are invalid') . '!'; ?>" />
227
+ <input id="result_sepa_hash" type="hidden" value="<?php
228
+ if (($sepaPaymentRefill || $sepaRefill) && $panhash != '') {
229
+ echo $panhash;
230
+ } else {
231
+ $panhash = '';
232
+ }
233
+ ?>" name="result_sepa_hash">
 
 
 
234
  </fieldset>
235
  <style>
236
  .nnsepaloader {
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Banktransfer.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
+ ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
+ <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Cc.phtml CHANGED
@@ -23,11 +23,13 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $_info = $this->getInfo();
29
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
30
  $helper = Mage::helper('novalnet_payment');
 
 
 
31
  if ($_info):
32
  ?>
33
  <?php
@@ -35,8 +37,11 @@ if ($this->getAdditionalData('NnTestOrder'))
35
  echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
36
  ?>
37
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
38
- <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br />' ?>
39
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>
 
 
 
40
  <?php if ($this->getAdditionalData('refunded_tid')):
41
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
42
  if ($this->getAdditionalData('fullRefund') == true):
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
  if ($_info):
34
  ?>
35
  <?php
37
  echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
38
  ?>
39
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
40
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
41
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>
42
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>
43
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
44
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
45
  <?php if ($this->getAdditionalData('refunded_tid')):
46
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
47
  if ($this->getAdditionalData('fullRefund') == true):
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Eps.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
+ ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
+ <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Ideal.phtml CHANGED
@@ -13,30 +13,40 @@
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
- *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $_info = $this->getInfo();
 
 
 
29
  if ($_info):
 
 
 
 
30
  ?>
31
- <?php
32
- if ($this->getAdditionalData('NnTestOrder'))
33
- echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
34
- ?>
35
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
36
- <?php if ($_info->getLastTransId() != "") echo $this->__('Novalnet Transaction ID: %s', $this->htmlEscape($_info->getLastTransId())) . '<br /><br />' ?>
37
- <?php if ($this->getAdditionalData('NnComments')) { ?>
38
- <?php echo $this->getAdditionalData('NnComments') ?><br />
39
- <?php } ?>
 
 
 
 
 
40
  <?php else: ?>
41
- <?php echo $this->__('Error in getting payment method'); ?>
42
  <?php endif; ?>
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
+ *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
  if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
  ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
  <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
  <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Invoice.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,13 +20,17 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($_info): ?>
32
  <?php
@@ -35,7 +39,10 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
35
  ?>
36
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
38
- <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('Transaction deactivated successfully') . '<br>' ?>
 
 
 
39
  <?php if ($this->getAdditionalData('refunded_tid')):
40
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
  if ($this->getAdditionalData('fullRefund') == true):
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($_info): ?>
36
  <?php
39
  ?>
40
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
41
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
42
+ <?php if ($nextCycleDate) echo '<br>' . $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br><br>' ?>
43
+ <?php if ($this->getAdditionalData('captureTid')) echo '<br>' . $this->__('The transaction has been confirmed on %s', $captureTime) . '<br><br>' ?>
44
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
45
+ <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('The transaction has been canceled on ') . $currentTime . '<br>' ?>
46
  <?php if ($this->getAdditionalData('refunded_tid')):
47
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
48
  if ($this->getAdditionalData('fullRefund') == true):
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Paypal.phtml CHANGED
@@ -13,28 +13,40 @@
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
- *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
 
 
 
27
  if ($_info):
 
 
 
 
28
  ?>
29
- <?php
30
- if ($this->getAdditionalData('NnTestOrder'))
31
- echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
32
- ?>
33
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
34
- <?php if ($_info->getLastTransId() != "") echo $this->__('Novalnet Transaction ID: %s', $this->htmlEscape($_info->getLastTransId())) . '<br /><br />' ?>
35
- <?php if ($this->getAdditionalData('NnComments')) { ?>
36
- <?php echo $this->getAdditionalData('NnComments') ?><br />
37
- <?php } ?>
 
 
 
 
 
38
  <?php else: ?>
39
- <?php echo $this->__('Error in getting payment method'); ?>
40
  <?php endif; ?>
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
+ *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
  if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
  ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
  <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
  <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Prepayment.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,13 +20,17 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($_info): ?>
32
  <?php
@@ -35,7 +39,10 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
35
  ?>
36
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
38
- <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('Transaction deactivated successfully') . '<br>' ?>
 
 
 
39
  <?php if ($this->getAdditionalData('refunded_tid')):
40
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
  if ($this->getAdditionalData('fullRefund') == true):
@@ -46,7 +53,7 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
46
  endforeach;
47
  endif;
48
  ?>
49
- <?php if (!preg_match("/invoice|creditmemo|shipment|callback_novalnet2magento/i", $currentUrl)): ?>
50
  <?php
51
  if (strlen($this->getAdditionalData('NnNote'))):
52
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
@@ -96,3 +103,4 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
96
  <?php else: ?>
97
  <?php echo $this->__('Error in getting payment method') ?>
98
  <?php endif; ?>
 
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($_info): ?>
36
  <?php
39
  ?>
40
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
41
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
42
+ <?php if ($nextCycleDate) echo '<br>' . $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br><br>' ?>
43
+ <?php if ($this->getAdditionalData('captureTid')) echo '<br>' . $this->__('The transaction has been confirmed on %s', $captureTime) . '<br><br>' ?>
44
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
45
+ <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('The transaction has been canceled on ') . $currentTime . '<br>' ?>
46
  <?php if ($this->getAdditionalData('refunded_tid')):
47
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
48
  if ($this->getAdditionalData('fullRefund') == true):
53
  endforeach;
54
  endif;
55
  ?>
56
+ <?php if (!preg_match("/creditmemo|callback_novalnet2magento/i", $currentUrl)): ?>
57
  <?php
58
  if (strlen($this->getAdditionalData('NnNote'))):
59
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
103
  <?php else: ?>
104
  <?php echo $this->__('Error in getting payment method') ?>
105
  <?php endif; ?>
106
+
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Sepa.phtml CHANGED
@@ -23,11 +23,13 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $_info = $this->getInfo();
29
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
30
  $helper = Mage::helper('novalnet_payment');
 
 
 
31
  if ($_info):
32
  ?>
33
  <?php
@@ -36,7 +38,10 @@ if ($this->getAdditionalData('NnTestOrder'))
36
  ?>
37
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
38
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
39
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>
 
 
 
40
  <?php if ($this->getAdditionalData('refunded_tid')):
41
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
42
  if ($this->getAdditionalData('fullRefund') == true):
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
  if ($_info):
34
  ?>
35
  <?php
38
  ?>
39
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
40
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
41
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>
42
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>
43
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
44
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
45
  <?php if ($this->getAdditionalData('refunded_tid')):
46
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
47
  if ($this->getAdditionalData('fullRefund') == true):
app/design/adminhtml/default/default/template/novalnet/payment/method/info/Sofortueberweisung.phtml DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
- * would be greatly appreciated.
20
- *
21
- * @category Novalnet
22
- * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- $_info = $this->getInfo();
27
- if ($_info):
28
- ?>
29
- <?php
30
- if ($this->getAdditionalData('NnTestOrder'))
31
- echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
32
- ?>
33
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
34
- <?php if ($_info->getLastTransId() != "") echo $this->__('Novalnet Transaction ID: %s', $this->htmlEscape($_info->getLastTransId())) . '<br /><br />' ?>
35
- <?php if ($this->getAdditionalData('NnComments')) { ?>
36
- <?php echo $this->getAdditionalData('NnComments') ?><br />
37
- <?php } ?>
38
- <?php else: ?>
39
- <?php echo $this->__('Error in getting payment method'); ?>
40
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Banktransfer.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Cc.phtml CHANGED
@@ -25,19 +25,37 @@
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
28
  $helper = Mage::helper('novalnet_payment');
 
 
 
 
29
  ?>
30
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
31
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
32
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
33
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>{{pdf_row_separator}}
 
 
 
34
  <?php if ($this->getAdditionalData('refunded_tid')):
35
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
36
  if ($this->getAdditionalData('fullRefund') == true):
37
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
 
 
 
38
  else:
39
  echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
 
 
 
40
  endif;
41
  endforeach;
42
  endif;
43
- ?>{{pdf_row_separator}}
 
 
 
 
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
+ if ($_info):
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
45
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
46
+ ?>
47
+ {{pdf_row_separator}}
48
+ <?php
49
  else:
50
  echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
51
+ ?>
52
+ {{pdf_row_separator}}
53
+ <?php
54
  endif;
55
  endforeach;
56
  endif;
57
+ ?>
58
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
59
+ <?php else: ?>
60
+ <?php echo $this->__('Error in getting payment method') ?>
61
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Eps.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Ideal.phtml CHANGED
@@ -23,7 +23,27 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
 
 
26
  ?>
27
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
28
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
29
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $this->getInfo()->getLastTransId()) ?>{{pdf_row_separator}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
  ?>
32
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Invoice.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,18 +20,25 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
32
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
33
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
34
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') ?>{{pdf_row_separator}}
 
 
 
35
  <?php if ($this->getAdditionalData('refunded_tid')):
36
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
37
  if ($this->getAdditionalData('fullRefund') == true):
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
37
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Paypal.phtml CHANGED
@@ -23,12 +23,27 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
 
 
26
  ?>
27
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
28
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
29
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $this->getInfo()->getLastTransId()) ?>{{pdf_row_separator}}
30
- <?php
31
- if (strlen($this->getAdditionalData('NnComments'))) {
32
- echo $this->getAdditionalData('NnComments');
33
- }
34
- ?>{{pdf_row_separator}}
 
 
 
 
 
 
 
 
 
 
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
  ?>
32
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Prepayment.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,18 +20,25 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
32
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
33
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
34
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') ?>{{pdf_row_separator}}
 
 
 
35
  <?php if ($this->getAdditionalData('refunded_tid')):
36
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
37
  if ($this->getAdditionalData('fullRefund') == true):
@@ -42,7 +49,7 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
42
  endforeach;
43
  endif;
44
  ?>{{pdf_row_separator}}
45
- <?php if (!preg_match("/invoice|creditmemo|shipment|callback_novalnet2magento/i", $currentUrl)): ?>
46
  <?php
47
  if (strlen($this->getAdditionalData('NnNote'))):
48
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
37
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
49
  endforeach;
50
  endif;
51
  ?>{{pdf_row_separator}}
52
+ <?php if (!preg_match("/creditmemo|callback_novalnet2magento/i", $currentUrl)): ?>
53
  <?php
54
  if (strlen($this->getAdditionalData('NnNote'))):
55
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
app/design/adminhtml/default/default/template/novalnet/payment/method/pdf/Sepa.phtml CHANGED
@@ -25,21 +25,42 @@
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
28
  $helper = Mage::helper('novalnet_payment');
 
 
 
 
29
  ?>
30
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
31
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
32
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
33
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>{{pdf_row_separator}}
 
 
 
34
  <?php if ($this->getAdditionalData('refunded_tid')):
35
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
36
  if ($this->getAdditionalData('fullRefund') == true):
37
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
 
 
 
38
  elseif(preg_match("/refund/i", $value['reftid'])):
39
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('amount refunded is %s', $value['refamount']) . '<br><br>';
 
 
 
40
  else:
41
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('refund amount %s', $value['refamount']) . ', ' . $this->__('New Tid: %s', $value['reftid']) . ' ' . $this->__('for the balance amount.') . '<br><br>';
 
 
 
42
  endif;
43
  endforeach;
44
  endif;
45
- ?>{{pdf_row_separator}}
 
 
 
 
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
+ if ($_info):
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) $this->__('The transaction has been canceled on ') . $currentTime . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
45
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
46
+ ?>
47
+ {{pdf_row_separator}}
48
+ <?php
49
  elseif(preg_match("/refund/i", $value['reftid'])):
50
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('amount refunded is %s', $value['refamount']) . '<br><br>';
51
+ ?>
52
+ {{pdf_row_separator}}
53
+ <?php
54
  else:
55
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('refund amount %s', $value['refamount']) . ', ' . $this->__('New Tid: %s', $value['reftid']) . ' ' . $this->__('for the balance amount.') . '<br><br>';
56
+ ?>
57
+ {{pdf_row_separator}}
58
+ <?php
59
  endif;
60
  endforeach;
61
  endif;
62
+ ?>
63
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
64
+ <?php else: ?>
65
+ <?php echo $this->__('Error in getting payment method') ?>
66
+ <?php endif; ?>
app/design/adminhtml/default/default/template/novalnet/sales/order/view/info.phtml ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_order = $this->getOrder();
27
+ $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
28
+ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
29
+ ?>
30
+ <div class="box-left">
31
+ <!--Order Information-->
32
+ <div class="entry-edit">
33
+ <?php if ($_order->getEmailSent()):
34
+ $_email = Mage::helper('sales')->__('the order confirmation email was sent');
35
+ else:
36
+ $_email = Mage::helper('sales')->__('the order confirmation email is not sent');
37
+ endif; ?>
38
+ <div class="entry-edit-head">
39
+ <?php if ($this->getNoUseOrderLink()): ?>
40
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?> (<?php echo $_email ?>)</h4>
41
+ <?php else: ?>
42
+ <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
43
+ <strong>(<?php echo $_email ?>)</strong>
44
+ <?php endif; ?>
45
+ </div>
46
+ <div class="fieldset">
47
+ <table cellspacing="0" class="form-list">
48
+ <tr>
49
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
50
+ <td class="value"><strong><?php echo $orderAdminDate ?></strong></td>
51
+ </tr>
52
+ <?php if ($orderAdminDate != $orderStoreDate):?>
53
+ <tr>
54
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtStoreDate()->getTimezone()) ?></label></td>
55
+ <td class="value"><strong><?php echo $orderStoreDate ?></strong></td>
56
+ </tr>
57
+ <?php endif;?>
58
+ <tr>
59
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
60
+ <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
61
+ </tr>
62
+ <tr>
63
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
64
+ <td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
65
+ </tr>
66
+ <?php if($_order->getRelationChildId()): ?>
67
+ <tr>
68
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td>
69
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
70
+ <?php echo $_order->getRelationChildRealId() ?>
71
+ </a></td>
72
+ </tr>
73
+ <?php endif; ?>
74
+ <?php if($_order->getRelationParentId()): ?>
75
+ <tr>
76
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td>
77
+ <td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
78
+ <?php echo $_order->getRelationParentRealId() ?>
79
+ </a></td>
80
+ </tr>
81
+ <?php endif; ?>
82
+ <?php if($_order->getRemoteIp()): ?>
83
+ <tr>
84
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
85
+ <td class="value"><strong><?php echo $_order->getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $_order->getXForwardedFor() . ')':''; ?></strong></td>
86
+ </tr>
87
+ <?php endif; ?>
88
+ <?php if($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
89
+ <tr>
90
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
91
+ <td class="value"><strong><?php echo $_order->getBaseToGlobalRate() ?></strong></td>
92
+ </tr>
93
+ <?php endif; ?>
94
+ <?php if($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
95
+ <tr>
96
+ <td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
97
+ <td class="value"><strong><?php echo $_order->getBaseToOrderRate() ?></strong></td>
98
+ </tr>
99
+ <?php endif; ?>
100
+ </table>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ <div class="box-right">
105
+ <!--Account Information-->
106
+ <div class="entry-edit">
107
+ <div class="entry-edit-head">
108
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
109
+ <div class="tools"><?php echo $this->getAccountEditLink()?></div>
110
+ </div>
111
+ <div class="fieldset">
112
+ <div class="hor-scroll">
113
+ <table cellspacing="0" class="form-list">
114
+ <tr>
115
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
116
+ <td class="value">
117
+ <?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
118
+ <a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong></a>
119
+ <?php else: ?>
120
+ <strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong>
121
+ <?php endif; ?>
122
+ </td>
123
+ </tr>
124
+ <tr>
125
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
126
+ <td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
127
+ </tr>
128
+ <?php if ($_groupName = $this->getCustomerGroupName()) : ?>
129
+ <tr>
130
+ <td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
131
+ <td class="value"><strong><?php echo $_groupName ?></strong></td>
132
+ </tr>
133
+ <?php endif; ?>
134
+ <?php foreach ($this->getCustomerAccountData() as $data):?>
135
+ <tr>
136
+ <td class="label"><label><?php echo $data['label'] ?></label></td>
137
+ <td class="value"><strong><?php echo $data['value'] ?></strong></td>
138
+ </tr>
139
+ <?php endforeach;?>
140
+ </table>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ <div class="clear"></div>
146
+
147
+ <div class="box-left">
148
+ <!--Billing Address-->
149
+ <div class="entry-edit">
150
+ <div class="entry-edit-head">
151
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
152
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div>
153
+ </div>
154
+ <fieldset>
155
+ <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
156
+ </fieldset>
157
+ </div>
158
+ </div>
159
+ <?php if (!$this->getOrder()->getIsVirtual()): ?>
160
+ <div class="box-right">
161
+ <!--Shipping Address-->
162
+ <div class="entry-edit">
163
+ <div class="entry-edit-head">
164
+ <h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
165
+ <div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div>
166
+ </div>
167
+ <fieldset>
168
+ <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
169
+ </fieldset>
170
+ </div>
171
+ </div>
172
+ <div class="clear"></div>
173
+ <?php endif; ?>
174
+ <div class="clear"></div>
175
+ <?php
176
+ $orderDate = strtotime(date('Y-m-d',strtotime($_order->getCreatedAt())));
177
+ if (strtotime(date('Y-m-d')) > $orderDate):
178
+ ?>
179
+ <div class="box-left">
180
+ <div class="entry-edit">
181
+ <div class="entry-edit-head">
182
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Refund reference') ?></h4>
183
+ </div>
184
+ <fieldset>
185
+ <table>
186
+ <tr id="novalnet_refund_ref">
187
+ <td style='width:200px;'><?php echo $this->__('Refund reference') ?> :</td>
188
+ <td>
189
+ <input type='text' name='nn_refund_ref' id='nn_refund_ref' value=''/>
190
+ </td>
191
+ </tr>
192
+ </table>
193
+ </fieldset>
194
+ </div>
195
+ </div>
196
+ <div class="clear"></div>
197
+ <?php endif; ?>
198
+ <div class="clear"></div>
199
+ <?php
200
+ $payment = $_order->getPayment();
201
+ $paymentname = $payment->getMethodInstance()->getCode();
202
+ $getpayment = array(
203
+ Novalnet_Payment_Model_Config::NN_PREPAYMENT,
204
+ Novalnet_Payment_Model_Config::NN_INVOICE,
205
+ Novalnet_Payment_Model_Config::NN_IDEAL,
206
+ Novalnet_Payment_Model_Config::NN_SOFORT
207
+ );
208
+ if (in_array($paymentname, $getpayment)):
209
+ $firstName = $_order->getBillingAddress()->getData('firstname');
210
+ $lastName = $_order->getBillingAddress()->getData('lastname');
211
+ ?>
212
+ <div class="box-left">
213
+ <!--Shipping Address-->
214
+ <div class="entry-edit">
215
+ <div class="entry-edit-head">
216
+ <h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Refund payment type') ?></h4>
217
+ </div>
218
+ <fieldset>
219
+ <table>
220
+ <tr>
221
+ <td>
222
+ <input type='radio' name='refund_payment_type' id='refund_payment_type_none' value='NONE' checked onclick="refund_payment_type_element_handle('none');"/> <?php echo Mage::helper('sales')->__('None'); ?>
223
+ <input type='radio' name='refund_payment_type' id='refund_payment_type_sepa' value='SEPA' onclick="refund_payment_type_element_handle();"/> <?php echo Mage::helper('sales')->__('Novalnet Direct Debit SEPA'); ?>
224
+ </td>
225
+ </tr>
226
+ </table>
227
+ <table style='width:500px;'>
228
+ <tr id="direct_debit_sepa_tabletr_accountholder">
229
+ <td style='width:200px;'><?php echo $this->__('Account holder') ?> :</td>
230
+ <td>
231
+ <input type='text' name='refund_payment_type_accountholder' id='refund_payment_type_accountholder' value='<?php echo $firstName.' '.$lastName ?>' />
232
+ </td>
233
+ </tr>
234
+ <tr id="direct_debit_sepa_tabletr_iban">
235
+ <td style='width:200px;'><?php echo $this->__('IBAN') ?> :</td>
236
+ <td>
237
+ <input type='text' name='refund_payment_type_iban' id='refund_payment_type_iban' value='' />
238
+ </td>
239
+ </tr>
240
+ <tr id="direct_debit_sepa_tabletr_bic">
241
+ <td style='width:200px;'><?php echo $this->__('BIC') ?> :</td>
242
+ <td>
243
+ <input type='text' name='refund_payment_type_bic' id='refund_payment_type_bic' value='' />
244
+ </td>
245
+ </tr>
246
+ </table>
247
+ <script type='text/javascript'>
248
+
249
+ function refund_payment_type_element_handle()
250
+ {
251
+ document.getElementById('refund_payment_type_iban').value="";
252
+ document.getElementById('refund_payment_type_bic').value="";
253
+
254
+ document.getElementById('direct_debit_sepa_tabletr_accountholder').style.display="none";
255
+ document.getElementById('direct_debit_sepa_tabletr_iban').style.display="none";
256
+ document.getElementById('direct_debit_sepa_tabletr_bic').style.display="none";
257
+
258
+ if (document.getElementById('refund_payment_type_sepa') && document.getElementById('refund_payment_type_sepa').checked) {
259
+ document.getElementById('direct_debit_sepa_tabletr_accountholder').style.display="block";
260
+ document.getElementById('direct_debit_sepa_tabletr_iban').style.display="block";
261
+ document.getElementById('direct_debit_sepa_tabletr_bic').style.display="block";
262
+ }
263
+
264
+ }
265
+ refund_payment_type_element_handle();
266
+ </script>
267
+ </fieldset>
268
+ </div>
269
+ </div>
270
+ <?php endif; ?>
271
+ <?php if (!$this->getOrder()->getIsVirtual()): ?>
272
+ <div class="clear"></div>
273
+ <?php endif;?>
app/design/adminhtml/default/default/template/novalnet/sales/order/view/tab/info.phtml ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_order = $this->getOrder();
27
+ $grandTotal = $_order->getBaseGrandTotal();
28
+ $payment = $_order->getPayment();
29
+ $paymentname = $payment->getMethodInstance()->getCode();
30
+ $paymentObj = $payment->getMethodInstance();
31
+ $data = unserialize($payment->getAdditionalData());
32
+ $parentTid = isset($data['NnTid']) ? $data['NnTid'] : '';
33
+ $sepaparentTid = isset($data['NnSepaParentTid']) ? $data['NnSepaParentTid'] : '';
34
+ ?>
35
+ <div>
36
+ <div id="order-messages">
37
+ <?php echo $this->getChildHtml('order_messages') ?>
38
+ </div>
39
+ <?php echo $this->getChildHtml('order_info') ?>
40
+ <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
41
+ <?php if ($_order->getIsVirtual()): ?>
42
+ <div class="box-right">
43
+ <?php else: ?>
44
+ <div class="box-left">
45
+ <?php endif; ?>
46
+ <!--Payment Method-->
47
+ <div class="entry-edit">
48
+ <div class="entry-edit-head">
49
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
50
+ </div>
51
+ <fieldset>
52
+ <?php echo $this->getPaymentHtml() ?>
53
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
54
+ </fieldset>
55
+ </div>
56
+ <?php
57
+ $sepapayment = array(
58
+ Novalnet_Payment_Model_Config::NN_SEPA,
59
+ );
60
+ $invoicepayment = array(
61
+ Novalnet_Payment_Model_Config::NN_PREPAYMENT,
62
+ Novalnet_Payment_Model_Config::NN_INVOICE
63
+ );
64
+
65
+ //$paymentname
66
+ $helper = Mage::helper('novalnet_payment');
67
+ $checkTidExist = $sepaparentTid ? $sepaparentTid : $parentTid;
68
+ if ($checkTidExist == '') {
69
+ $checkTidExist = $payment->getLastTransId();
70
+ }
71
+ if (preg_match("/refund/i", $checkTidExist)) {
72
+ $checkTidExist = str_replace("-refund",'',$checkTidExist);
73
+ }
74
+
75
+ $getTransactionStatus = $helper->loadTransactionStatus($checkTidExist);
76
+ $status = $getTransactionStatus->getTransactionStatus();
77
+ $invoice = $_order->getInvoiceCollection()->getFirstItem();
78
+ $paid = $invoice->getState();
79
+
80
+ $amount = $helper->getAmountCollection($_order->getId(), 1, 0);
81
+ $amount = !$amount ? $amount : $grandTotal;
82
+ $amount = $helper->getFormatedAmount($amount);
83
+
84
+ if (in_array($paymentname, array_merge($sepapayment,$invoicepayment))) {
85
+ $statusCall = $paymentObj->doNovalnetStatusCall($checkTidExist,$payment);
86
+ }
87
+
88
+ $amount = '';
89
+ $date = '';
90
+
91
+ if ($status == 99 && $getTransactionStatus->getTransactionStatus() && in_array($paymentname, $sepapayment)
92
+ && $_order->canInvoice()) {
93
+ $amount = $statusCall->getAmount();
94
+ ?>
95
+ <div class="entry-edit">
96
+ <div class="entry-edit-head">
97
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Change the amount') ?></h4>
98
+ </div>
99
+ <fieldset>
100
+ <br />
101
+ <div><?php echo $this->__('Novalnet transaction amount') ?>:&nbsp;<input class="validate-date required-entry" type="text" id="amount_changed" name="amount_changed" value="<?php echo $amount; ?>" onkeypress="return novalnetAllowNumeric(event)"; style="width:4em" /> &nbsp;&nbsp;
102
+ <button type="button" title="<?php echo $this->__('Amount Changed button') ?>" class="button" onclick="amount_changed('<?php
103
+ echo Mage::helper('adminhtml')->getUrl('*/*/amountupdate', array(
104
+ 'order_id' => $_order->getId()))
105
+ ?>', 2,'<?php echo $this->__('Enter the valid amount'); ?>');"><span><span><?php echo $this->__('Amount Changed button') ?></span></span></button><br /><br />
106
+
107
+ </div>
108
+ <br />
109
+ </fieldset>
110
+ </div>
111
+ <?php
112
+ } else if ($status == 100 && in_array($paymentname, $invoicepayment)
113
+ && ($paid == 1 || $paid == '')) {
114
+ $amount = $statusCall->getAmount();
115
+ $date = $statusCall->getInvoiceDueDate();
116
+ ?>
117
+ <div class="entry-edit">
118
+ <div class="entry-edit-head">
119
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Novalnet Amount Changed') ?></h4>
120
+ </div>
121
+ <fieldset>
122
+ <table>
123
+ <tr><td><span style='width:50%;'><?php echo $this->__('Novalnet transaction amount') ?>:&nbsp;</span></td>
124
+ <td><input class="validate-date required-entry" type="text" id="amount_changed" name="amount_changed" value="<?php echo $amount; ?>" onkeypress="return novalnetAllowNumeric(event)"; style="width:6em" /></td></tr>
125
+
126
+ <tr><td><?php echo $this->__('Invoice Due Date') ?>:</td><td><input class="validate-date" type="text" id="invoice_duedate" name="invoice_duedate" value="<?php echo $date; ?>" style="width:6em" /></td>
127
+ </tr>
128
+
129
+ <tr><td colspan=2>
130
+ <button type="button" title="<?php echo $this->__('Amount Changed button') ?>" class="button" onclick="amount_changed('<?php
131
+ echo Mage::helper('adminhtml')->getUrl('*/*/amountupdate', array(
132
+ 'order_id' => $_order->getId()))
133
+ ?>', '<?php echo $paid; ?>','<?php echo $this->__('Enter the valid amount'); ?>','<?php echo $this->__('Enter the amount or invoice duedate'); ?>','<?php echo $this->__('Invoice duedate is invalid'); ?>');"><span><span><?php echo $this->__('Amount Changed button') ?></span></span></button></td></tr>
134
+ </table>
135
+ </fieldset>
136
+ </div>
137
+ <?php } ?>
138
+ <?php
139
+ $countofCollection = $helper->getAmountCollection($_order->getId(), NULL, NULL);
140
+ if ($countofCollection > 0) {
141
+ ?>
142
+ <div class="entry-edit">
143
+ <div class="entry-edit-head">
144
+ <h4 class="icon-head head-products"><?php echo $helper->__('Updated Amount') ?></h4>
145
+ </div>
146
+ <fieldset>
147
+ <div>
148
+ <?php
149
+ $updateCollection = explode('<br>', $helper->getAmountCollection($_order->getId(), 1, 1));
150
+ echo $this->__('The transaction amount %s has been updated successfully on %s', '('.$updateCollection[0] . ' ' . $_order->getOrderCurrencyCode() . ')', $updateCollection[1]);
151
+ ?>
152
+ </div>
153
+ <br />
154
+ </fieldset>
155
+ </div>
156
+ <?php } ?>
157
+ </div>
158
+ <?php if (!$_order->getIsVirtual()): ?>
159
+ <div class="box-right">
160
+ <!--Shipping Method-->
161
+ <div class="entry-edit">
162
+ <div class="entry-edit-head">
163
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
164
+ </div>
165
+ <fieldset>
166
+ <?php if ($_order->getTracksCollection()->count()) : ?>
167
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>', 'trackorder', 'width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
168
+ <br/>
169
+ <?php endif; ?>
170
+ <?php if ($_order->getShippingDescription()): ?>
171
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
172
+
173
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
174
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
175
+ <?php else: ?>
176
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
177
+ <?php endif; ?>
178
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
179
+
180
+ <?php echo $_excl; ?>
181
+ <?php
182
+ if ($this->helper('tax')->displayShippingBothPrices()
183
+ && $_incl != $_excl):
184
+ ?>
185
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
186
+ <?php endif; ?>
187
+ <?php else: ?>
188
+ <?php echo $this->helper('sales')->__('No shipping information available'); ?>
189
+ <?php endif; ?>
190
+ </fieldset>
191
+ </div>
192
+ </div>
193
+ <?php endif; ?>
194
+ <div class="clear"></div>
195
+ <?php echo $this->getGiftOptionsHtml() ?>
196
+ <div class="clear"></div>
197
+ <div class="entry-edit">
198
+ <div class="entry-edit-head">
199
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
200
+ </div>
201
+ </div>
202
+ <?php echo $this->getItemsHtml() ?>
203
+ <div class="clear"></div>
204
+
205
+ <div class="box-left">
206
+ <div class="entry-edit">
207
+ <div class="entry-edit-head">
208
+ <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
209
+ </div>
210
+ <fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
211
+ </div>
212
+ </div>
213
+ <div class="box-right entry-edit">
214
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
215
+ <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
216
+ </div>
217
+ <div class="clear"></div>
218
+ </div>
219
+
220
+ <?php echo $this->getChildHtml('popup_window'); ?>
221
+ <script type="text/javascript">
222
+ //<![CDATA[
223
+ /**
224
+ * Retrieve gift options tooltip content
225
+ */
226
+ function getGiftOptionsTooltipContent(itemId) {
227
+ var contentLines = [];
228
+ var headerLine = null;
229
+ var contentLine = null;
230
+
231
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function(element) {
232
+ if (element.down(0)) {
233
+ headerLine = element.down(0).innerHTML;
234
+ contentLine = element.down(0).next().innerHTML;
235
+ if (contentLine.length > 30) {
236
+ contentLine = contentLine.slice(0, 30) + '...';
237
+ }
238
+ contentLines.push(headerLine + ' ' + contentLine);
239
+ }
240
+ });
241
+ return contentLines.join('<br/>');
242
+ }
243
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
244
+
245
+ function novalnetAllowNumeric(evt) {
246
+
247
+ var charCode = (evt.which) ? evt.which : evt.keyCode
248
+
249
+ if((charCode == 35 || charCode == 36 ||charCode == 37
250
+ || charCode == 39) && evt.shiftKey == false) {
251
+ return true;
252
+ }
253
+ else if((evt.ctrlKey == true && charCode == 114)|| charCode == 116) {
254
+ return true;
255
+ }
256
+ else if(charCode > 31 && (charCode < 48 || charCode > 57)) {
257
+ return false;
258
+ }else{
259
+ return true;
260
+ }
261
+ }
262
+
263
+ function reformatDate(dateStr)
264
+ {
265
+ dArr = dateStr.split("-"); // ex input "2010-01-18"
266
+ return dArr[2]+ "." +dArr[1]+ "." +dArr[0]; //ex out: "18/01/10"
267
+ }
268
+
269
+ function amount_changed(url, one,lang,lang1,lang2) {
270
+
271
+ var amountchanged = document.getElementById('amount_changed').value;
272
+ var paymentcode = '<?php echo $paymentname; ?>';
273
+
274
+ if (one == 1 || paymentcode == 'novalnetPrepayment') {
275
+ var invoice_duedate = document.getElementById('invoice_duedate').value;
276
+ invoicedate = invoice_duedate.length;
277
+ }
278
+
279
+
280
+ if ((one == 1 || paymentcode == 'novalnetPrepayment') && invoice_duedate == '' && amountchanged == '') {
281
+ alert(lang1);
282
+ return false;
283
+ }
284
+ //return false;
285
+ if (amountchanged == '' || amountchanged <= 0 || isNaN(amountchanged)) {
286
+ alert(lang);
287
+ return false;
288
+ }
289
+ if ((one == 1 || paymentcode == 'novalnetPrepayment') && invoice_duedate != '' && !invoice_duedate.match(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
290
+ Translator.add('Invoice duedate is invalid', '<?php echo $this->__('Invoice duedate is invalid'); ?>');
291
+ alert(Translator.translate(lang2));
292
+ return false;
293
+ } else if ((one == 1 || paymentcode == 'novalnetPrepayment') && invoicedate > 10) {
294
+ alert(Translator.translate(lang2));
295
+ return false;
296
+ }
297
+
298
+ if (invoice_duedate == undefined) {
299
+ invoice_duedate = '';
300
+ }
301
+ <?php
302
+ $currencySymbol = Mage::app()->getLocale()->currency($_order->getOrderCurrencyCode())->getSymbol();
303
+ ?>
304
+ var nconfirm = '<?php echo (!in_array($paymentname, $invoicepayment)) ? $this->__('Are you sure you want to change the order amount?') : $this->__('Are you sure you want to change the order amount or due date?'); ?>';
305
+ if (confirm(nconfirm) == true) {
306
+ window.location.href = url + "amount_change/" + amountchanged + "/invoice_duedate/" + invoice_duedate;
307
+ } else {
308
+ return false;
309
+ }
310
+ }
311
+
312
+ //]]>
313
+ </script>
314
+ <script type="text/javascript">// <![CDATA[
315
+ if (document.getElementById('invoice_duedate') != undefined) {
316
+ Calendar.setup({
317
+ inputField: 'invoice_duedate',
318
+ ifFormat: '%Y-%m-%d',
319
+ button: 'date_to_trig',
320
+ align: 'Bl',
321
+ singleClick: true
322
+ });
323
+ }
324
+ // ]]></script>
app/design/adminhtml/default/default/template/novalnet/sales/order/{transactionoverview.phtml → view/tab/transactionoverview.phtml} RENAMED
@@ -23,8 +23,6 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $transactioOverviewCollection = $this->getTransactionOverview();
29
  $i = 1;
30
  foreach ($transactioOverviewCollection as $transactioOverviewId => $data) {
@@ -87,8 +85,10 @@ foreach ($transactioOverviewCollection as $transactioOverviewId => $data) {
87
  </div>
88
  </div>
89
  </div>
90
- <?php endif;
91
- $i++; ?>
 
 
92
 
93
  <!-- Novalnet API Data -->
94
  <div class="box-left" style="clear:both;">
@@ -109,11 +109,13 @@ foreach ($transactioOverviewCollection as $transactioOverviewId => $data) {
109
  if ($getrequestData) {
110
  ?>
111
  <div style="height:250px;overflow:scroll;width:470px;">
112
- <strong> <?php echo "<pre>";
113
- print_r($getrequestData);
114
- echo "</pre>"; ?> </strong>
 
 
115
  </div>
116
- <?php } ?>
117
  </td>
118
  </tr>
119
  </table>
@@ -125,7 +127,7 @@ foreach ($transactioOverviewCollection as $transactioOverviewId => $data) {
125
  <div class="entry-edit">
126
  <div class="entry-edit-head">
127
  <h4 class="icon-head head-payment-method" style="float:none;">
128
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Response Data') ?>
129
  <span style="float:right;"><?php echo 'TID : ' . $data->getTransactionId() ?></span>
130
  </h4>
131
  </div>
@@ -135,19 +137,21 @@ foreach ($transactioOverviewCollection as $transactioOverviewId => $data) {
135
  <td class="label">
136
  <label><?php echo $this->helper('novalnet_payment')->__('Response Data') ?></label><br>
137
  <?php
138
- $getresponseData = unserialize($data->getResponseData());
139
  if ($getresponseData) {
140
  ?>
141
  <div style="height:250px;overflow:scroll;width:470px;">
142
- <strong> <?php echo "<pre>";
143
- print_r($getresponseData);
144
- echo "</pre>"; ?> </strong>
 
 
145
  </div>
146
- <?php } ?>
147
  </td>
148
  </tr>
149
  </table>
150
  </div>
151
  </div>
152
  </div>
153
- <?php } ?>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $transactioOverviewCollection = $this->getTransactionOverview();
27
  $i = 1;
28
  foreach ($transactioOverviewCollection as $transactioOverviewId => $data) {
85
  </div>
86
  </div>
87
  </div>
88
+ <?php
89
+ endif;
90
+ $i++;
91
+ ?>
92
 
93
  <!-- Novalnet API Data -->
94
  <div class="box-left" style="clear:both;">
109
  if ($getrequestData) {
110
  ?>
111
  <div style="height:250px;overflow:scroll;width:470px;">
112
+ <strong> <?php
113
+ echo "<pre>";
114
+ print_r($getrequestData);
115
+ echo "</pre>";
116
+ ?> </strong>
117
  </div>
118
+ <?php } ?>
119
  </td>
120
  </tr>
121
  </table>
127
  <div class="entry-edit">
128
  <div class="entry-edit-head">
129
  <h4 class="icon-head head-payment-method" style="float:none;">
130
+ <?php echo Mage::helper('novalnet_payment')->__('Novalnet Response Data') ?>
131
  <span style="float:right;"><?php echo 'TID : ' . $data->getTransactionId() ?></span>
132
  </h4>
133
  </div>
137
  <td class="label">
138
  <label><?php echo $this->helper('novalnet_payment')->__('Response Data') ?></label><br>
139
  <?php
140
+ $getresponseData = unserialize(base64_decode($data->getResponseData()));
141
  if ($getresponseData) {
142
  ?>
143
  <div style="height:250px;overflow:scroll;width:470px;">
144
+ <strong> <?php
145
+ echo "<pre>";
146
+ print_r($getresponseData);
147
+ echo "</pre>";
148
+ ?> </strong>
149
  </div>
150
+ <?php } ?>
151
  </td>
152
  </tr>
153
  </table>
154
  </div>
155
  </div>
156
  </div>
157
+ <?php } ?>
app/design/adminhtml/default/default/template/novalnet/transaction/overview/view/form.phtml CHANGED
@@ -23,8 +23,8 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
26
  ?>
27
- <?php $data = $this->getNovalnetTransactionOverview(); ?>
28
  <div class="content-header">
29
  <table cellspacing="0">
30
  <tr>
@@ -36,7 +36,6 @@
36
  </table>
37
  </div>
38
  <input type="hidden" name="order_id" value="<?php echo $data->getOrderId() ?>"/>
39
-
40
  <div class="box-left">
41
  <!--Novalnet Order Information-->
42
  <div class="entry-edit">
@@ -59,15 +58,16 @@
59
  </td>
60
  <td class="label">
61
  <?php
62
- $orderViewId = Mage::getModel('sales/order')->loadByIncrementId($data->getOrderId())->getId();
63
- $orderViewUrl = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $orderViewId));
 
64
  ?>
65
  <strong><a href="<?php echo $orderViewUrl ?>"><?php echo $data->getOrderId() ?></a></strong>
66
  </td>
67
  </tr>
68
  <tr>
69
  <td class="label">
70
- <label><?php echo $this->helper('novalnet_payment')->__('Tranaction-ID') ?></label>
71
  </td>
72
  <td class="label">
73
  <strong><?php echo $data->getTransactionId() ?></strong>
@@ -148,11 +148,12 @@
148
  <td class="label">
149
  <label><?php echo $this->helper('novalnet_payment')->__('Request Data') ?></label><br>
150
  <div style="height:250px;overflow:scroll;width:600px;"><strong><?php
151
-
152
- $getrequestData = unserialize($data->getRequestData());
153
- echo "<pre>";print_r($getrequestData);echo "</pre>";
154
-
155
- ?></strong></div>
 
156
  </td>
157
  </tr>
158
  </table>
@@ -171,11 +172,12 @@
171
  <td class="label">
172
  <label><?php echo $this->helper('novalnet_payment')->__('Response Data') ?></label><br>
173
  <div style="height:250px;overflow:scroll;width:600px;"><strong><?php
174
-
175
- $getresponseData = unserialize($data->getResponseData());
176
- echo "<pre>";print_r($getresponseData);echo "</pre>";
177
-
178
- ?></strong></div>
 
179
  </td>
180
  </tr>
181
  </table>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $data = $this->getNovalnetTransactionOverview();
27
  ?>
 
28
  <div class="content-header">
29
  <table cellspacing="0">
30
  <tr>
36
  </table>
37
  </div>
38
  <input type="hidden" name="order_id" value="<?php echo $data->getOrderId() ?>"/>
 
39
  <div class="box-left">
40
  <!--Novalnet Order Information-->
41
  <div class="entry-edit">
58
  </td>
59
  <td class="label">
60
  <?php
61
+ $orderViewId = Mage::getModel('sales/order')->loadByIncrementId($data->getOrderId())->getId();
62
+ $orderViewUrl = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array(
63
+ 'order_id' => $orderViewId));
64
  ?>
65
  <strong><a href="<?php echo $orderViewUrl ?>"><?php echo $data->getOrderId() ?></a></strong>
66
  </td>
67
  </tr>
68
  <tr>
69
  <td class="label">
70
+ <label><?php echo $this->helper('novalnet_payment')->__('Transaction-ID') ?></label>
71
  </td>
72
  <td class="label">
73
  <strong><?php echo $data->getTransactionId() ?></strong>
148
  <td class="label">
149
  <label><?php echo $this->helper('novalnet_payment')->__('Request Data') ?></label><br>
150
  <div style="height:250px;overflow:scroll;width:600px;"><strong><?php
151
+ $getrequestData = unserialize($data->getRequestData());
152
+ echo "<pre>";
153
+ print_r($getrequestData);
154
+ echo "</pre>";
155
+ ?></strong>
156
+ </div>
157
  </td>
158
  </tr>
159
  </table>
172
  <td class="label">
173
  <label><?php echo $this->helper('novalnet_payment')->__('Response Data') ?></label><br>
174
  <div style="height:250px;overflow:scroll;width:600px;"><strong><?php
175
+ $getresponseData = unserialize(base64_decode($data->getResponseData()));
176
+ echo "<pre>";
177
+ print_r($getresponseData);
178
+ echo "</pre>";
179
+ ?></strong>
180
+ </div>
181
  </td>
182
  </tr>
183
  </table>
app/design/adminhtml/default/default/template/novalnet/transaction/view/form.phtml CHANGED
@@ -23,8 +23,9 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
26
  ?>
27
- <?php $data = $this->getNovalnetTransactionStatus(); ?>
28
  <div class="content-header">
29
  <table cellspacing="0">
30
  <tr>
@@ -55,7 +56,7 @@
55
  </tr>
56
  <tr>
57
  <td class="label">
58
- <label><?php echo $this->helper('novalnet_payment')->__('Order-ID') ?></label>
59
  </td>
60
  <td class="label">
61
  <?php
@@ -68,7 +69,7 @@
68
  </tr>
69
  <tr>
70
  <td class="label">
71
- <label><?php echo $this->helper('novalnet_payment')->__('Transaction-ID') ?></label>
72
  </td>
73
  <td class="label">
74
  <strong><?php echo $data->getTransactionNo() ?></strong>
@@ -82,7 +83,7 @@
82
  <strong>
83
  <?php
84
  if ($data->getTransactionStatus() == 100) {
85
- echo $this->helper('novalnet_payment')->__('successful');
86
  } elseif ($data->getTransactionStatus() == 103) {
87
  echo $this->helper('novalnet_payment')->__('Transaction deactivate');
88
  } elseif (in_array($data->getTransactionStatus(), array(
@@ -90,8 +91,6 @@
90
  echo $this->helper('novalnet_payment')->__('TID on hold');
91
  } elseif ($data->getTransactionStatus() == 90) {
92
  echo $this->helper('novalnet_payment')->__('PayPal Payment Pending');
93
- } elseif ($data->getTransactionStatus() == 18) {
94
- echo $this->helper('novalnet_payment')->__('Not yet performed payment call');
95
  }
96
  ?>
97
  </strong>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $data = $this->getNovalnetTransactionStatus();
27
  ?>
28
+
29
  <div class="content-header">
30
  <table cellspacing="0">
31
  <tr>
56
  </tr>
57
  <tr>
58
  <td class="label">
59
+ <label><?php echo $this->helper('novalnet_payment')->__('Order ID') ?></label>
60
  </td>
61
  <td class="label">
62
  <?php
69
  </tr>
70
  <tr>
71
  <td class="label">
72
+ <label><?php echo $this->helper('novalnet_payment')->__('Transaction ID') ?></label>
73
  </td>
74
  <td class="label">
75
  <strong><?php echo $data->getTransactionNo() ?></strong>
83
  <strong>
84
  <?php
85
  if ($data->getTransactionStatus() == 100) {
86
+ echo $this->helper('novalnet_payment')->__('Successful');
87
  } elseif ($data->getTransactionStatus() == 103) {
88
  echo $this->helper('novalnet_payment')->__('Transaction deactivate');
89
  } elseif (in_array($data->getTransactionStatus(), array(
91
  echo $this->helper('novalnet_payment')->__('TID on hold');
92
  } elseif ($data->getTransactionStatus() == 90) {
93
  echo $this->helper('novalnet_payment')->__('PayPal Payment Pending');
 
 
94
  }
95
  ?>
96
  </strong>
app/design/adminhtml/default/default/template/novalnet/widget/view/container.phtml ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td><h3><?php echo $this->getHeaderText() ?></h3></td>
31
+ <td class="form-buttons">
32
+ <div id="recurring_buttons_view"><?php echo $this->getButtonsHtml() ?></div>
33
+ <div id="recurring_cancel_button_view" style="display:none;"><?php echo $this->_getCancelButtonWithReasons(); ?></div>
34
+ </td>
35
+ </tr>
36
+ </table>
37
+ </div>
38
+ <?php echo $this->getViewHtml() ?>
39
+ <?php /* @var $this Mage_Sales_Block_Recurring_Profile_View */ ?>
40
+
41
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
42
+
43
+ <!-- info tabs -->
44
+ <?php $infoTabs = $this->getChildGroup('info_tabs'); ?>
45
+
46
+ <dl class="order-info">
47
+ <dt><?php echo $this->__('About This Profile:') ?></dt>
48
+ <dd>
49
+ <ul id="order-info-tabs">
50
+ <?php foreach ($infoTabs as $block): ?>
51
+ <?php if ($this->getObjectData($block, 'is_view_current')): ?>
52
+ <li class="current"><strong><?php echo $this->escapeHtml($this->getObjectData($block, 'view_label')) ?></strong></li>
53
+ <?php else: ?>
54
+ <li><a href="<?php echo $this->escapeHtml($this->getObjectData($block, 'view_url')) ?>"><?php echo $this->escapeHtml($this->getObjectData($block, 'view_label')) ?></a></li>
55
+ <?php endif; ?>
56
+ <?php endforeach; ?>
57
+ </ul>
58
+ </dd>
59
+ </dl>
60
+
61
+ <div class="buttons-set">
62
+ <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->__('Back to Recurring Profiles') ?></a></p>
63
+ </div>
64
+ </div>
65
+ <script type="text/javascript">
66
+ function cancelviewstatus(current_id, change_id)
67
+ {
68
+ document.getElementById(current_id).style.display = 'none';
69
+ document.getElementById(change_id).style.display = 'block';
70
+ }
71
+
72
+ function cancel_action(message, url, cancelReason)
73
+ {
74
+ var reason = parseInt(document.getElementById('reason-subscribe').value);
75
+ var resontext = document.getElementById('reason-subscribe');
76
+ var resontextval = resontext.options[resontext.selectedIndex].innerHTML;
77
+
78
+ if (reason) {
79
+ if (confirm(message)) {
80
+ window.location.href = url + "?reason=" + resontextval;
81
+ }
82
+ } else {
83
+ alert(cancelReason);
84
+ }
85
+ return false;
86
+ }
87
+ </script>
app/design/frontend/base/default/layout/novalnet.xml CHANGED
@@ -1,7 +1,36 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <layout version="0.1.0">
3
  <checkout_onepage_index>
4
  <reference name="head">
 
 
 
5
  <action method="addJs">
6
  <script>novalnet/novalnetcc.js</script>
7
  </action>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * Part of the payment module of Novalnet AG
17
+ * https://www.novalnet.de
18
+ * If you have found this script useful a small
19
+ * recommendation as well as a comment on merchant form
20
+ * would be greatly appreciated.
21
+ *
22
+ * @category Novalnet
23
+ * @package Novalnet_Payment
24
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ -->
28
  <layout version="0.1.0">
29
  <checkout_onepage_index>
30
  <reference name="head">
31
+ <action method="addJs">
32
+ <script>novalnet/novalnetJquery.js</script>
33
+ </action>
34
  <action method="addJs">
35
  <script>novalnet/novalnetcc.js</script>
36
  </action>
app/design/frontend/{default/default/template/novalnet/payment/method/form/Sofortueberweisung.phtml → base/default/template/novalnet/payment/method/form/Banktransfer.phtml} RENAMED
@@ -23,9 +23,6 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <a name="<?php echo $this->getMethodCode() ?>"></a>
28
- <?php
29
  $_code = $this->getMethodCode();
30
  $helper = Mage::helper('novalnet_payment');
31
  ?>
@@ -34,33 +31,30 @@ $helper = Mage::helper('novalnet_payment');
34
  <div>
35
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
36
  <?php
37
- $image = "sofort_Logo.png";
38
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
39
  ?>
40
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
41
  </a>
42
  </div>
43
  <!--}}} Payment Logo -->
44
- <!--{{{ Payment Description -->
45
- <div>
46
- <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
 
 
 
47
  <li>
48
- <?php echo $this->__('You will be redirected to Novalnet AG website when you place an order.') ?>
49
  </li>
50
- <?php if ($this->getUserInfo()): ?>
51
- <li>
52
- <?php echo $this->getUserInfo() ?>
53
- </li>
54
- <?php endif; ?>
55
- <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
56
- <li>
57
- <div style="font-weight:bold;color:red;font-size:12px;">
58
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
59
- </div>
60
- </li>
61
- <?php endif ?>
62
- </ul>
63
- </div>
64
- <!--}}} Payment Description -->
65
- <div class="clear"></div>
66
  </fieldset>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
26
  $_code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
31
  <div>
32
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
33
  <?php
34
+ $image = "banktransfer.png";
35
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
36
  ?>
37
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
38
  </a>
39
  </div>
40
  <!--}}} Payment Logo -->
41
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
42
+ <!--{{{ Payment Description -->
43
+ <li>
44
+ <?php echo $this->__('redirect payment description') ?>
45
+ </li>
46
+ <?php if ($this->getUserInfo()): ?>
47
  <li>
48
+ <?php echo $this->getUserInfo() ?>
49
  </li>
50
+ <?php endif; ?>
51
+ <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
52
+ <li>
53
+ <div style="font-weight:bold;color:red;font-size:12px;">
54
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
55
+ </div>
56
+ </li>
57
+ <?php endif ?>
58
+ <!--{{{ Payment Description -->
59
+ </ul>
 
 
 
 
 
 
60
  </fieldset>
app/design/frontend/base/default/template/novalnet/payment/method/form/Cc.phtml CHANGED
@@ -26,29 +26,31 @@
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
- $refillValues = $assignDatahelper->_getCheckout()->getData($code);
30
- $ccRefill = $this->getMethod()->getConfigData('cc_refill');
31
  $creditCardSecure = $this->getMethod()->getConfigData('active_cc3d');
32
- $refillMethod = ($refillValues != '' && $code == $refillValues->getMethod());
33
-
34
- $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
 
 
35
  ?>
36
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
37
  <!--{{{ Payment Logo -->
38
  <div>
39
  <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;float:none;">
40
  <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
41
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $typeCode . "_Logo.png"; ?>
42
- <img style="height:20px;" src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
43
  <?php endforeach; ?>
44
  </a>
45
  </div>
46
  <!--}}} Payment Logo -->
47
  <!--{{{ Novalnet Cc Form -->
48
- <ul id="payment_form_<?php echo $code ?>" style="display:none">
 
49
  <div class="nnccloader" id='cc_loading' style='display:none;'></div>
50
  <li>
51
- <?php echo $this->__('The amount will be booked immediately from your credit card.'); ?>
52
  </li>
53
  <?php if ($this->getUserInfo()): ?>
54
  <li>
@@ -64,13 +66,13 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
64
  <?php endif ?>
65
  <li class="fields">
66
  <div class="field">
67
- <label style="float:none;" for="<?php echo $code ?>_cc_type"><?php echo $this->__('NN CC type') ?><span class="required">*</span></label><br />
68
- <div class="input-box">
69
- <select id="<?php echo $code ?>_cc_type" onchange="ccHashCall();" class="required-entry validate-cc-type-select">
70
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
71
- <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
72
- <option value="<?php echo $typeCode ?>"><?php echo $typeName ?></option>
73
- <?php endforeach; ?>
74
  </select>
75
  </div>
76
  </div>
@@ -78,47 +80,48 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
78
  <li class="fields">
79
  <div class="field">
80
  <label style="float:none;" for="<?php echo $code ?>_cc_owner"><?php echo $this->__('NN CC holder') ?><span class="required">*</span></label><br/>
81
- <div class="input-box">
82
- <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_cc_owner" autocomplete="off" onchange="ccHashCall();" value="<?php echo $billingaddres->getFirstname().' '.$billingaddres->getLastname() ?>" /></div>
83
  </div>
84
  </li>
85
- <li class="fields">
86
- <div class="field">
87
  <label style="float:none;" for="<?php echo $code ?>_cc_number"><?php echo $this->__('NN CC number') ?><span class="required">*</span></label><br/>
88
- <div class="input-box">
89
- <input type="text" id="<?php echo $code ?>_cc_number" title="<?php echo $this->__('Credit Card Number') ?>" class="required-entry input-text validate-cc-number validate-cc-type" autocomplete="off" onchange="ccHashCall();" onkeypress="return isNumberKey(event, true);" value="" /> </div>
 
90
  </div>
91
  </li>
92
  <li class="fields">
93
- <div class="field">
94
  <label style="float:none;" for="<?php echo $code ?>_expiration"><?php echo $this->__('NN Expiration Date') ?><span class="required">*</span></label><br />
95
- <div class="input-box">
96
- <div class="v-fix">
97
- <select id="<?php echo $code ?>_expiration" style="width:140px;" onchange="ccHashCall();" class="required-entry">
98
- <option value=""><?php echo $this->__('Month'); ?></option>
99
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
100
- <option value="<?php echo $k ?>"><?php echo $v ?></option>
101
- <?php endforeach; ?>
102
- </select>
103
- </div>
104
  <div class="v-fix" style="padding-left:5px;">
105
- <select id="<?php echo $code ?>_expiration_yr" style="width:103px;" onchange="ccHashCall();" class="required-entry">
106
- <option value=""><?php echo $this->__('Year'); ?></option>
107
- <?php foreach ($this->getCcYears() as $k => $v): ?>
108
  <option value="<?php echo $k ?>"><?php echo $v ?></option>
109
- <?php endforeach; ?>
110
- </select>
 
111
  </div>
112
  </div>
113
- </div>
114
  </li>
115
  <li class="fields">
116
  <div class="field">
117
- <label style="float:none;" for="<?php echo $code ?>_cc_cid"><?php echo $this->__('NN CVC') ?><span class="required">*</span></label><br />
118
  <div class="input-box">
119
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Card Verification Number') ?>" onkeypress="return isNumberKey(event);" class="required-entry input-text validate-cc-cvn" id="<?php echo $code ?>_cc_cid" name="payment[nn_cc_cid]" style="width:3em;" autocomplete="off" /></div>
120
  &nbsp;
121
- <a href="#"><img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>cvc_hint.png' border="0" style="margin-top:0px;" alt="CCV/CVC?" id="nn_cc_hint"></a>
122
  <img src="<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>creditcard_cvc.jpg" style="display:none;float:left;" border="0" id="nn_cvc_hover"/>
123
  </div>
124
  </div>
@@ -130,20 +133,18 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
130
  if ($this->getCallbackConfigData() != 3):
131
  ?>
132
  <li>
133
- <div class="input-box">
134
  <label style="float:none;" for="<?php echo $code ?>_callback_tel">
135
- <?php
136
- if ($this->getCallbackConfigData() == 2):
137
- ?>
138
- <?php echo $this->__('Mobile phone number'); ?>
139
- <?php else: ?>
140
- <?php echo $this->__('Ihre Telefon- / Mobil- Nummer'); ?>
141
- <?php endif; ?>
142
- <span class="required">*</span></label><br/>
143
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" value="<?php
144
- echo $ccRefill ? $helper->_getCheckout()->getData($code)->getNnCallbackTelNovalnetCc()
145
- : '';
146
- ?>"/>
147
  </div>
148
  </li>
149
  <li>
@@ -151,10 +152,10 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
151
  <?php echo $this->__('Note for pin by sms and callback') ?>
152
  </div>
153
  <div class="input-box">
154
- <label style="float:none;" for="<?php echo $code ?>_callback_pin"><?php echo $this->__('PIN') ?><span class="required">*</span></label><br/>
155
- <input onkeydown="document.getElementById('<?php echo $code ?>_new_callback_pin').checked = false;" size="4" type="text" id="<?php echo $code ?>_callback_pin" name="payment[callback_pin]" title="<?php echo $this->__('Callback') ?>" class="input-text" /><br/>
156
- <input id="<?php echo $code ?>_new_callback_pin" type="checkbox" name="payment[new_callback_pin]" value="1">
157
- <label style="float:none;" for="<?php echo $code ?>_new_callback_pin"><?php echo $this->__('Forgot PIN? [New PIN Request]') ?></label>
158
  </div>
159
  </li>
160
  <!--}}} PIN by Callback-->
@@ -164,28 +165,29 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
164
  ?>
165
  <li>
166
  <div class="input-box">
167
- <label style="float:none;" for="<?php echo $code ?>_callback_email"><?php echo $this->__('E-mail Address') ?><span class="required">*</span></label><br/>
168
- <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_email" name="payment[callback_email]" title="<?php echo $this->__('Callback Email') ?>" class="input-text validate-email required-entry" value="<?php
169
- echo $ccRefill ? $helper->_getCheckout()->getData($code)->getNnCallbackEmailNovalnetCc()
170
- : '';
171
- ?>"/>
172
  </div>
173
- </li>
174
  <?php endif ?>
175
  <!--}}} Reply by Email-->
176
  <?php endif ?>
177
  <!--}}} CallbackType-->
178
  </ul>
 
179
  <input type="hidden" id="original_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>" />
180
  <input type="hidden" id="original_vendor_authcode" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>" />
 
 
 
181
  <input type="hidden" name="novalnet_cc_hash" id="novalnet_cc_hash" value="" />
182
- <input type="hidden" name="novalnet_cc_pan_hash" id="novalnet_cc_pan_hash" value="<?php echo $ccRefill ? $refillValues->getCcPanHash() : ''; ?>" />
183
- <input type="hidden" name="novalnet_cc_unique_id" id="novalnet_cc_unique_id" value="<?php echo $ccRefill ? $refillValues->getCcUniqueId() : ''; ?>" />
184
  <input type="hidden" id="nn_cc_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
185
- <input type="hidden" id="nn_cc_validate_error_message" value="<?php echo $this->__('Please enter valid credit card details') . '!'; ?>" />
186
-
187
  </fieldset>
188
-
189
  <style>
190
  .nnccloader {
191
  position: fixed;
@@ -197,7 +199,6 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
197
  background: url('<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>novalnet-loading-icon.gif') 50% 50% no-repeat;
198
  }
199
  </style>
200
-
201
  <script type="text/javascript">
202
  jQuery('#nn_cc_hint').hover(function(){
203
  jQuery('#nn_cvc_hover').show();
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
+ $refillValues = $assignDatahelper->getCheckout()->getRefilldatavalues();
 
30
  $creditCardSecure = $this->getMethod()->getConfigData('active_cc3d');
31
+ $ccRefill = $this->getMethod()->_getConfigData('auto_refill', true);
32
+ // get quote billing address
33
+ $billingaddress = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
34
+ $telephoneNumber = ($this->getCallbackConfigData() == 1 && $billingaddress->getTelephone())
35
+ ? $billingaddress->getTelephone() : '' ;
36
  ?>
37
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
38
  <!--{{{ Payment Logo -->
39
  <div>
40
  <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;float:none;">
41
  <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
42
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $typeCode . ".png"; ?>
43
+ <img style="height:20px;display:inline;" src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
44
  <?php endforeach; ?>
45
  </a>
46
  </div>
47
  <!--}}} Payment Logo -->
48
  <!--{{{ Novalnet Cc Form -->
49
+
50
+ <ul id="payment_form_<?php echo $code ?>" style="display:none;">
51
  <div class="nnccloader" id='cc_loading' style='display:none;'></div>
52
  <li>
53
+ <?php echo $this->__('The amount will be debited from your credit card once the order is submitted'); ?>
54
  </li>
55
  <?php if ($this->getUserInfo()): ?>
56
  <li>
66
  <?php endif ?>
67
  <li class="fields">
68
  <div class="field">
69
+ <label style="float:none;" for="<?php echo $code ?>_cc_type"><?php echo $this->__('NN CC type') ?><span class="required">*</span></label><br />
70
+ <div class="input-box">
71
+ <select id="<?php echo $code ?>_cc_type" onchange="cchashcall()" class="required-entry validate-cc-type-select">
72
+ <option value=""><?php echo $this->__('NN Select') ?></option>
73
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
74
+ <option value="<?php echo $_typeCode ?>"><?php echo $_typeName ?></option>
75
+ <?php endforeach; ?>
76
  </select>
77
  </div>
78
  </div>
80
  <li class="fields">
81
  <div class="field">
82
  <label style="float:none;" for="<?php echo $code ?>_cc_owner"><?php echo $this->__('NN CC holder') ?><span class="required">*</span></label><br/>
83
+ <div class="input-box">
84
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_cc_owner" autocomplete="off" onchange="cchashcall()" value="<?php echo $billingaddress->getFirstname() . ' ' . $billingaddress->getLastname(); ?>" /></div>
85
  </div>
86
  </li>
87
+ <li class="fields">
88
+ <div class="field">
89
  <label style="float:none;" for="<?php echo $code ?>_cc_number"><?php echo $this->__('NN CC number') ?><span class="required">*</span></label><br/>
90
+ <div class="input-box">
91
+ <input type="text" id="<?php echo $code ?>_cc_number" title="<?php echo $this->__('Credit Card Number') ?>" class="required-entry input-text validate-cc-number validate-cc-type" autocomplete="off" onchange="cchashcall()" onkeypress="return isNumberKey(event,true)" value="" />
92
+ </div>
93
  </div>
94
  </li>
95
  <li class="fields">
96
+ <div class="field">
97
  <label style="float:none;" for="<?php echo $code ?>_expiration"><?php echo $this->__('NN Expiration Date') ?><span class="required">*</span></label><br />
98
+ <div class="input-box">
99
+ <div class="v-fix">
100
+ <select id="<?php echo $code ?>_expiration" style="width:140px;" onchange="cchashcall()" class="required-entry">
101
+ <option value=""><?php echo $this->__('Month'); ?></option>
102
+ <?php foreach ($this->getCcMonths() as $k => $v): ?>
103
+ <option value="<?php echo $k ?>"><?php echo $v ?></option>
104
+ <?php endforeach; ?>
105
+ </select>
106
+ </div>
107
  <div class="v-fix" style="padding-left:5px;">
108
+ <select id="<?php echo $code ?>_expiration_yr" style="width:103px;" onchange="cchashcall()" class="required-entry">
109
+ <option value=""><?php echo $this->__('Year'); ?></option>
110
+ <?php foreach ($this->getCcYears() as $k => $v): ?>
111
  <option value="<?php echo $k ?>"><?php echo $v ?></option>
112
+ <?php endforeach; ?>
113
+ </select>
114
+ </div>
115
  </div>
116
  </div>
 
117
  </li>
118
  <li class="fields">
119
  <div class="field">
120
+ <label style="float:none;" for="<?php echo $code ?>_cc_cid"><?php echo $this->__('NN CVC') ?><span class="required"></span></label><br />
121
  <div class="input-box">
122
+ <div class="v-fix"><input style="width: 35px" type="text" title="<?php echo $this->__('Card Verification Number') ?>" onkeypress="return isNumberKey(event, false);" class="required-entry input-text validate-cc-cvn" id="<?php echo $code ?>_cc_cid" name="payment[nn_cc_cid]" style="width:3em;" autocomplete="off" /></div>
123
  &nbsp;
124
+ <a href="#"><img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>cvc_hint.png' border="0" alt="CCV/CVC?" id="nn_cc_hint"></a>
125
  <img src="<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>creditcard_cvc.jpg" style="display:none;float:left;" border="0" id="nn_cvc_hover"/>
126
  </div>
127
  </div>
133
  if ($this->getCallbackConfigData() != 3):
134
  ?>
135
  <li>
136
+ <div class="input-box">
137
  <label style="float:none;" for="<?php echo $code ?>_callback_tel">
138
+ <?php
139
+ if ($this->getCallbackConfigData() == 2):
140
+ ?>
141
+ <?php echo $this->__('Mobile phone number'); ?>
142
+ <?php else: ?>
143
+ <?php echo $this->__('NN Mobile Number'); ?>
144
+ <?php endif; ?>
145
+ <span class="required">*</span></label><br/>
146
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" value="<?php
147
+ echo $telephoneNumber; ?>"/>
 
 
148
  </div>
149
  </li>
150
  <li>
152
  <?php echo $this->__('Note for pin by sms and callback') ?>
153
  </div>
154
  <div class="input-box">
155
+ <label style="float:none;" for="<?php echo $code ?>_callback_pin"><?php echo $this->__('PIN') ?><span class="required">*</span></label><br/>
156
+ <input onchange="document.getElementById('new_callback_pin').checked = false;" size="4" type="text" id="<?php echo $code ?>_callback_pin" name="payment[callback_pin]" title="<?php echo $this->__('Callback') ?>" class="input-text" /><br/>
157
+ <input id="new_callback_pin" type="checkbox" name="payment[new_callback_pin]" value="1">
158
+ <label style="float:none;" for="new_callback_pin"><?php echo $this->__('Forgot PIN? [New PIN Request]') ?></label>
159
  </div>
160
  </li>
161
  <!--}}} PIN by Callback-->
165
  ?>
166
  <li>
167
  <div class="input-box">
168
+ <label style="float:none;" for="<?php echo $code ?>_callback_email"><?php echo $this->__('E-mail Address') ?><span class="required">*</span></label><br/>
169
+ <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_email" name="payment[callback_email]" title="<?php echo $this->__('Callback Email') ?>" class="input-text validate-email required-entry" value="<?php
170
+ echo $billingaddress->getEmail(); ?>"/>
 
 
171
  </div>
172
+ </li>
173
  <?php endif ?>
174
  <!--}}} Reply by Email-->
175
  <?php endif ?>
176
  <!--}}} CallbackType-->
177
  </ul>
178
+
179
  <input type="hidden" id="original_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>" />
180
  <input type="hidden" id="original_vendor_authcode" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>" />
181
+ <input type="hidden" id="novalnet_cc_pan_hash" value="<?php
182
+ echo $ccRefill ? $assignDatahelper->getCheckout()->getCcPanHash() : '';
183
+ ?>" />
184
  <input type="hidden" name="novalnet_cc_hash" id="novalnet_cc_hash" value="" />
185
+ <input type="hidden" name="novalnet_cc_unique_id" id="novalnet_cc_unique_id" value="<?php echo $ccRefill ? $assignDatahelper->getCheckout()->getCcUniqueId() : '';
186
+ ?>" />
187
  <input type="hidden" id="nn_cc_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
188
+ <input type="hidden" id="nn_cc_validate_error_message" value="<?php echo $this->__('Your credit card details are invalid') . '!'; ?>" />
189
+ <!--}}} Novalnet Cc Form -->
190
  </fieldset>
 
191
  <style>
192
  .nnccloader {
193
  position: fixed;
199
  background: url('<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>novalnet-loading-icon.gif') 50% 50% no-repeat;
200
  }
201
  </style>
 
202
  <script type="text/javascript">
203
  jQuery('#nn_cc_hint').hover(function(){
204
  jQuery('#nn_cvc_hover').show();
app/design/frontend/{rwd/default/template/novalnet/payment/method/form/Sofortueberweisung.phtml → base/default/template/novalnet/payment/method/form/Eps.phtml} RENAMED
@@ -23,44 +23,39 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <a name="<?php echo $this->getMethodCode() ?>"></a>
28
- <?php
29
  $_code = $this->getMethodCode();
30
  $helper = Mage::helper('novalnet_payment');
31
  ?>
32
  <fieldset class="form-list">
 
33
  <!--{{{ Payment Logo -->
34
  <div>
35
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
36
  <?php
37
- $image = "sofort_Logo.png";
38
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
39
  ?>
40
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
41
  </a>
42
  </div>
43
  <!--}}} Payment Logo -->
44
- <!--{{{ Payment Description -->
45
- <div>
46
- <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
 
 
 
47
  <li>
48
- <?php echo $this->__('You will be redirected to Novalnet AG website when you place an order.') ?>
49
  </li>
50
- <?php if ($this->getUserInfo()): ?>
51
- <li>
52
- <?php echo $this->getUserInfo() ?>
53
- </li>
54
- <?php endif; ?>
55
- <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
56
- <li>
57
- <div style="font-weight:bold;color:red;font-size:12px;">
58
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
59
- </div>
60
- </li>
61
- <?php endif ?>
62
- </ul>
63
- </div>
64
- <!--}}} Payment Description -->
65
- <div class="clear"></div>
66
  </fieldset>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
26
  $_code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
29
  <fieldset class="form-list">
30
+
31
  <!--{{{ Payment Logo -->
32
  <div>
33
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
34
  <?php
35
+ $image = "eps.png";
36
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
37
  ?>
38
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
39
  </a>
40
  </div>
41
  <!--}}} Payment Logo -->
42
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
43
+ <!--{{{ Payment Description -->
44
+ <li>
45
+ <?php echo $this->__('redirect payment description') ?>
46
+ </li>
47
+ <?php if ($this->getUserInfo()): ?>
48
  <li>
49
+ <?php echo $this->getUserInfo() ?>
50
  </li>
51
+ <?php endif; ?>
52
+ <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
53
+ <li>
54
+ <div style="font-weight:bold;color:red;font-size:12px;">
55
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
56
+ </div>
57
+ </li>
58
+ <?php endif ?>
59
+ <!--}}} Payment Description -->
60
+ </ul>
 
 
 
 
 
 
61
  </fieldset>
app/design/frontend/base/default/template/novalnet/payment/method/form/Ideal.phtml CHANGED
@@ -23,44 +23,39 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <a name="<?php echo $this->getMethodCode() ?>"></a>
28
- <?php
29
  $_code = $this->getMethodCode();
30
  $helper = Mage::helper('novalnet_payment');
31
  ?>
32
  <fieldset class="form-list">
 
33
  <!--{{{ Payment Logo -->
34
  <div>
35
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
36
  <?php
37
- $image = "ideal_payment_small.png";
38
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
39
  ?>
40
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
41
  </a>
42
  </div>
43
  <!--}}} Payment Logo -->
44
- <!--{{{ Payment Description -->
45
- <div>
46
- <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
 
 
 
47
  <li>
48
- <?php echo $this->__('You will be redirected to Novalnet AG website when you place an order.') ?>
49
  </li>
50
- <?php if ($this->getUserInfo()): ?>
51
- <li>
52
- <?php echo $this->getUserInfo() ?>
53
- </li>
54
- <?php endif; ?>
55
- <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
56
- <li>
57
- <div style="font-weight:bold;color:red;font-size:12px;">
58
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
59
- </div>
60
- </li>
61
- <?php endif ?>
62
- </ul>
63
- </div>
64
- <!--}}} Payment Description -->
65
- <div class="clear"></div>
66
  </fieldset>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
26
  $_code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
29
  <fieldset class="form-list">
30
+
31
  <!--{{{ Payment Logo -->
32
  <div>
33
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
34
  <?php
35
+ $image = "ideal.png";
36
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
37
  ?>
38
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
39
  </a>
40
  </div>
41
  <!--}}} Payment Logo -->
42
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
43
+ <!--{{{ Payment Description -->
44
+ <li>
45
+ <?php echo $this->__('redirect payment description') ?>
46
+ </li>
47
+ <?php if ($this->getUserInfo()): ?>
48
  <li>
49
+ <?php echo $this->getUserInfo() ?>
50
  </li>
51
+ <?php endif; ?>
52
+ <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
53
+ <li>
54
+ <div style="font-weight:bold;color:red;font-size:12px;">
55
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
56
+ </div>
57
+ </li>
58
+ <?php endif ?>
59
+ <!--{{{ Payment Description -->
60
+ </ul>
 
 
 
 
 
 
61
  </fieldset>
app/design/frontend/base/default/template/novalnet/payment/method/form/Invoice.phtml CHANGED
@@ -23,16 +23,17 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $code = $this->getMethodCode();
29
  $helper = Mage::helper('novalnet_payment');
 
 
 
30
  ?>
31
  <fieldset class="form-list">
32
  <!-- PAYMENT LOGO -->
33
  <div>
34
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
35
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "kauf-auf-rechnung.png"; ?>
36
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
37
  </a>
38
  </div>
@@ -40,7 +41,7 @@ $helper = Mage::helper('novalnet_payment');
40
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
41
  <!--{{{ PAYMENT DESCRIPTION -->
42
  <li>
43
- <?php echo $this->__('The Bank details will be emailed to you soon after the completion of checkout process') ?>
44
  </li>
45
  <?php if ($this->getUserInfo()): ?>
46
  <li>
@@ -67,10 +68,10 @@ $helper = Mage::helper('novalnet_payment');
67
  ?>
68
  <?php echo $this->__('Mobile phone number'); ?>
69
  <?php else: ?>
70
- <?php echo $this->__('Ihre Telefon- / Mobil- Nummer'); ?>
71
  <?php endif; ?>
72
- <span class="required">*</span></label><br/>
73
- <input type="text" value="" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" />
74
  </div>
75
  </li>
76
  <li>
@@ -78,7 +79,7 @@ $helper = Mage::helper('novalnet_payment');
78
  <?php echo $this->__('Note for pin by sms and callback') ?>
79
  </div>
80
  <div class="input-box">
81
- <label style="float:none;" for="<?php echo $code ?>_callback_pin"><?php echo $this->__('PIN') ?><span class="required">*</span></label><br/>
82
  <input onkeydown="document.getElementById('<?php echo $code ?>_new_callback_pin').checked = false;" size="4" type="text" id="<?php echo $code ?>_callback_pin" name="payment[callback_pin]" title="<?php echo $this->__('Callback') ?>" class="input-text" /><br/>
83
  <input id="<?php echo $code ?>_new_callback_pin" type="checkbox" name="payment[new_callback_pin]" value="1">
84
  <label style="float:none;" for="<?php echo $code ?>_new_callback_pin"><?php echo $this->__('Forgot PIN? [New PIN Request]') ?></label>
@@ -89,8 +90,8 @@ $helper = Mage::helper('novalnet_payment');
89
  <?php elseif ($this->getCallbackConfigData() == 3): ?>
90
  <li>
91
  <div class="input-box">
92
- <label style="float:none;" for="<?php echo $code ?>_callback_email"><?php echo $this->__('E-mail Address') ?><span class="required">*</span></label><br/>
93
- <input type="text" value="" id="<?php echo $code ?>_callback_email" name="payment[callback_email]" title="<?php echo $this->__('Callback Email') ?>" class="input-text validate-email required-entry" />
94
  </div>
95
  </li>
96
  <?php endif ?>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
+ $billingaddress = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
29
+ $telephoneNumber = ($this->getCallbackConfigData() == 1 && $billingaddress->getTelephone())
30
+ ? $billingaddress->getTelephone() : '' ;
31
  ?>
32
  <fieldset class="form-list">
33
  <!-- PAYMENT LOGO -->
34
  <div>
35
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
36
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "invoice.png"; ?>
37
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
38
  </a>
39
  </div>
41
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
42
  <!--{{{ PAYMENT DESCRIPTION -->
43
  <li>
44
+ <?php echo $this->__('Invoice/Prepayment payment description') ?>
45
  </li>
46
  <?php if ($this->getUserInfo()): ?>
47
  <li>
68
  ?>
69
  <?php echo $this->__('Mobile phone number'); ?>
70
  <?php else: ?>
71
+ <?php echo $this->__('NN Mobile Number'); ?>
72
  <?php endif; ?>
73
+ <span class="required"></span></label><br/>
74
+ <input type="text" value="<?php echo $telephoneNumber; ?>" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" />
75
  </div>
76
  </li>
77
  <li>
79
  <?php echo $this->__('Note for pin by sms and callback') ?>
80
  </div>
81
  <div class="input-box">
82
+ <label style="float:none;" for="<?php echo $code ?>_callback_pin"><?php echo $this->__('PIN') ?><span class="required"></span></label><br/>
83
  <input onkeydown="document.getElementById('<?php echo $code ?>_new_callback_pin').checked = false;" size="4" type="text" id="<?php echo $code ?>_callback_pin" name="payment[callback_pin]" title="<?php echo $this->__('Callback') ?>" class="input-text" /><br/>
84
  <input id="<?php echo $code ?>_new_callback_pin" type="checkbox" name="payment[new_callback_pin]" value="1">
85
  <label style="float:none;" for="<?php echo $code ?>_new_callback_pin"><?php echo $this->__('Forgot PIN? [New PIN Request]') ?></label>
90
  <?php elseif ($this->getCallbackConfigData() == 3): ?>
91
  <li>
92
  <div class="input-box">
93
+ <label style="float:none;" for="<?php echo $code ?>_callback_email"><?php echo $this->__('E-mail Address') ?><span class="required"></span></label><br/>
94
+ <input type="text" value="<?php echo $billingaddress->getEmail(); ?>" id="<?php echo $code ?>_callback_email" name="payment[callback_email]" title="<?php echo $this->__('Callback Email') ?>" class="input-text validate-email required-entry" />
95
  </div>
96
  </li>
97
  <?php endif ?>
app/design/frontend/base/default/template/novalnet/payment/method/form/Paypal.phtml CHANGED
@@ -23,44 +23,39 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <a name="<?php echo $this->getMethodCode() ?>"></a>
28
- <?php
29
  $_code = $this->getMethodCode();
30
  $helper = Mage::helper('novalnet_payment');
31
  ?>
32
  <fieldset class="form-list">
 
33
  <!--{{{ Payment Logo -->
34
  <div>
35
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
36
  <?php
37
- $image = "paypal-small.png";
38
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
39
  ?>
40
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
41
  </a>
42
  </div>
43
  <!--}}} Payment Logo -->
44
- <!--{{{ Payment Description -->
45
- <div>
46
- <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
 
 
 
47
  <li>
48
- <?php echo $this->__('You will be redirected to Novalnet AG website when you place an order.') ?>
49
  </li>
50
- <?php if ($this->getUserInfo()): ?>
51
- <li>
52
- <?php echo $this->getUserInfo() ?>
53
- </li>
54
- <?php endif; ?>
55
- <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
56
- <li>
57
- <div style="font-weight:bold;color:red;font-size:12px;">
58
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
59
- </div>
60
- </li>
61
- <?php endif ?>
62
- </ul>
63
- </div>
64
- <!--}}} Payment Description -->
65
- <div class="clear"></div>
66
  </fieldset>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
26
  $_code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
29
  <fieldset class="form-list">
30
+
31
  <!--{{{ Payment Logo -->
32
  <div>
33
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
34
  <?php
35
+ $image = "paypal.png";
36
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
37
  ?>
38
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
39
  </a>
40
  </div>
41
  <!--}}} Payment Logo -->
42
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
43
+ <!--{{{ Payment Description -->
44
+ <li>
45
+ <?php echo $this->__('redirect payment description') ?>
46
+ </li>
47
+ <?php if ($this->getUserInfo()): ?>
48
  <li>
49
+ <?php echo $this->getUserInfo() ?>
50
  </li>
51
+ <?php endif; ?>
52
+ <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
53
+ <li>
54
+ <div style="font-weight:bold;color:red;font-size:12px;">
55
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
56
+ </div>
57
+ </li>
58
+ <?php endif ?>
59
+ <!--{{{ Payment Description -->
60
+ </ul>
 
 
 
 
 
 
61
  </fieldset>
app/design/frontend/base/default/template/novalnet/payment/method/form/Prepayment.phtml CHANGED
@@ -23,8 +23,6 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $code = $this->getMethodCode();
29
  $helper = Mage::helper('novalnet_payment');
30
  ?>
@@ -32,7 +30,7 @@ $helper = Mage::helper('novalnet_payment');
32
  <!-- PAYMENT LOGO -->
33
  <div>
34
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
35
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "vorauskasse.png"; ?>
36
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
37
  </a>
38
  </div>
@@ -40,14 +38,14 @@ $helper = Mage::helper('novalnet_payment');
40
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
41
  <!--{{{ PAYMENT DESCRIPTION -->
42
  <li>
43
- <?php echo $this->__('The Bank details will be emailed to you soon after the completion of checkout process') ?>
44
  </li>
45
  <?php if ($this->getUserInfo()): ?>
46
  <li>
47
  <?php echo $this->getUserInfo() ?>
48
  </li>
49
  <?php endif ?>
50
- <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
51
  <li>
52
  <div style="font-weight:bold;color:red;font-size:12px;">
53
  <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
@@ -55,6 +53,5 @@ $helper = Mage::helper('novalnet_payment');
55
  </li>
56
  <?php endif ?>
57
  <!--}}} PAYMENT DESCRIPTION -->
58
-
59
  </ul>
60
  </fieldset>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
30
  <!-- PAYMENT LOGO -->
31
  <div>
32
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
33
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . "prepayment.png"; ?>
34
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
35
  </a>
36
  </div>
38
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
39
  <!--{{{ PAYMENT DESCRIPTION -->
40
  <li>
41
+ <?php echo $this->__('Invoice/Prepayment payment description') ?>
42
  </li>
43
  <?php if ($this->getUserInfo()): ?>
44
  <li>
45
  <?php echo $this->getUserInfo() ?>
46
  </li>
47
  <?php endif ?>
48
+ <?php if ($this->getLiveMode() == 0): ?>
49
  <li>
50
  <div style="font-weight:bold;color:red;font-size:12px;">
51
  <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
53
  </li>
54
  <?php endif ?>
55
  <!--}}} PAYMENT DESCRIPTION -->
 
56
  </ul>
57
  </fieldset>
app/design/frontend/base/default/template/novalnet/payment/method/form/Sepa.phtml CHANGED
@@ -26,30 +26,30 @@
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
- $sepaRefill = $this->getMethod()->getConfigData('sepa_refill');
30
- $refillValues = $assignDatahelper->_getCheckout()->getData($code);
 
31
  $refillMethod = ($sepaRefill && $refillValues != '' && $code == $refillValues->getMethod());
 
 
 
 
 
 
 
32
 
33
- $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
34
- $accountHolder = $refillMethod ? $refillValues->getSepaHolder() : '';
35
- $billingCountry = $billingaddres->getcountryId() ? strtoupper($billingaddres->getcountryId()) : 'DE';
36
- $refillName = ($sepaRefill && $accountHolder)
37
- ? $accountHolder : $billingaddres->getFirstname() . ' ' . $billingaddres->getLastname();
38
- $dataStreet = $billingaddres->getStreet();
39
- $dataCity = $billingaddres->getCity();
40
- $dataCompany = $billingaddres->getCompany();
41
- $dataPostcode = $billingaddres->getPostcode();
42
- $dataemail = $billingaddres->getEmail();
43
- foreach ($dataStreet as $dataStreetValue) {
44
- $quoteaddress = $dataStreetValue;
45
  }
46
  ?>
47
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
48
  <!--{{{ Payment Logo -->
49
  <div>
50
- <a HREF="<?php echo $helper->getNovalnetUrl(); ?>" TARGET="_new" style="text-decoration:none;">
51
  <?php
52
- $image = "sepa_logo.png";
53
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
54
  ?>
55
  <img src="<?php echo $imgpath; ?>" alt="<?php echo $this->getMethod()->getConfigData('title'); ?>" title="<?php echo $this->getMethod()->getConfigData('title'); ?>" />
@@ -60,7 +60,7 @@ foreach ($dataStreet as $dataStreetValue) {
60
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
61
  <div class="nnsepaloader" id='sepa_loading' style='display:none;'></div>
62
  <li>
63
- <?php echo $this->__('Your account will be debited upon delivery of goods.'); ?>
64
  </li>
65
  <?php if ($this->getUserInfo()): ?>
66
  <li>
@@ -68,70 +68,73 @@ foreach ($dataStreet as $dataStreetValue) {
68
  </li>
69
  <?php endif ?>
70
  <?php if (Mage::helper('novalnet_payment')->getModel('novalnetSepa')->_getConfigData('live_mode', true) == 0): ?>
71
- <li>
72
- <div style="font-weight:bold;color:red;font-size:12px;">
73
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
74
- </div>
75
- </li>
76
  <?php endif ?>
 
77
  <li class="fields">
78
  <div class="field">
79
- <label style="float:none;" for="<?php echo $code ?>_account_holder"><?php echo $this->__('NN Account Holder') ?><span class="required">*</span></label><br/>
80
  <div class="input-box">
81
- <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_account_holder" name="payment[account_holder]" autocomplete="off" onchange="unsetHashRelatedElements()" value="<?php echo $refillName; ?>" />
82
  </div>
83
  </div>
84
  </li>
85
  <li class="fields">
86
- <div class="field">
87
  <label style="float:none;" for="<?php echo $code ?>_bank_country"><?php echo $this->__('NN Country') ?><span class="required">*</span></label><br />
88
  <div class="input-box">
89
- <?php
90
- $_countries = Mage::getResourceModel('directory/country_collection')
91
- ->loadData()
92
- ->toOptionArray(false)
93
- ?>
94
- <?php if (count($_countries) > 0): ?>
95
- <select id="<?php echo $code ?>_bank_country" onchange="unsetHashRelatedElements()" class="required-entry">
96
- <?php
97
- foreach ($_countries as $_country):
98
- if (in_array($billingCountry, $_country)) {
99
- ?>
100
- <option selected value="<?php echo $_country['value'] ?>"><?php echo $_country['label'] ?>
101
- </option>
102
  <?php } else { ?>
103
- <option value="<?php echo $_country['value'] ?>">
104
- <?php echo $_country['label'] ?>
105
- </option>
106
- <?php } ?>
107
- <?php endforeach; ?>
108
- </select><br/>
109
- <?php endif; ?>
110
- </div>
111
  </div>
112
  </li>
113
  <li class="fields">
114
  <div class="field">
115
- <label style="float:none;" for="<?php echo $code ?>_account_number"><?php echo $this->__('IBAN or Account Number') ?><span class="required">*</span></label><br/>
116
  <div class="input-box">
117
- <input type="text" id="<?php echo $code ?>_account_number" onchange="unsetHashRelatedElements()" title="<?php echo $this->__('IBAN or Account Number') ?>" class="required-entry input-text" autocomplete="off" value="" />
118
  </div>
119
  </div>
120
  </li>
 
121
  <li class="fields">
122
  <div class="field">
123
- <label style="float:none;" for="<?php echo $code ?>_bank_code"><?php echo $this->__('BIC or Bank Code') ?><span class="required">*</span></label><br/>
124
  <div class="input-box">
125
- <input type="text" id="<?php echo $code ?>_bank_code" title="<?php echo $this->__('BIC or Bank Code') ?>" class="input-text" autocomplete="off" onchange="unsetHashRelatedElements()" value="" />
126
  </div>
127
  </div>
128
  </li>
 
129
  <li class="fields">
130
  <div class="field">
131
  <div class="input-box">
132
- <input type="checkbox" id="<?php echo $code ?>_mandate_confirm" title="<?php echo $this->__('confirm') ?>" class="required-entry" onclick="sepaIbanBicCall(this)"/>
133
- <label style="float:none;" for="<?php echo $code ?>_mandate_confirm"><?php echo $this->__('NN Confirm') ?></label><br/>
134
- </div>
135
  </div>
136
  </li>
137
  <!--{{{ CallbackType-->
@@ -141,31 +144,29 @@ foreach ($dataStreet as $dataStreetValue) {
141
  if ($this->getCallbackConfigData() != 3):
142
  ?>
143
  <li>
 
144
  <div class="input-box">
145
- <label style="float:none;" for="<?php echo $code ?>_callback_tel">
146
- <?php
147
- if ($this->getCallbackConfigData() == 2):
148
- ?>
149
- <?php echo $this->__('Mobile phone number'); ?>
150
- <?php else: ?>
151
- <?php echo $this->__('Ihre Telefon- / Mobil- Nummer'); ?>
152
- <?php endif; ?>
153
- <span class="required">*</span></label><br/>
154
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" value="<?php
155
- echo $sepaRefill ? $helper->_getCheckout()->getData($code)->getNnCallbackTelNovalnetSepa()
156
- : '';
157
- ?>"/>
158
  </div>
159
  </li>
160
  <li>
161
  <div style="font-weight:bold;color:gray;border:1px solid #BFBFBF;font-size:11px; background:#FEFFBF; padding:10px; margin-top:10px;width:400px;">
162
  <?php echo $this->__('Note for pin by sms and callback') ?>
163
  </div>
 
164
  <div class="input-box">
165
- <label style="float:none;" for="<?php echo $code ?>_callback_pin"><?php echo $this->__('PIN') ?><span class="required">*</span></label><br/>
166
- <input onkeydown="document.getElementById('<?php echo $code ?>_new_callback_pin').checked = false;" size="4" type="text" id="<?php echo $code ?>_callback_pin" name="payment[callback_pin]" title="<?php echo $this->__('Callback') ?>" class="input-text" /><br/>
167
- <input id="<?php echo $code ?>_new_callback_pin" type="checkbox" name="payment[new_callback_pin]" value="1">
168
- <label style="float:none;" for="<?php echo $code ?>_new_callback_pin"><?php echo $this->__('Forgot PIN? [New PIN Request]') ?></label>
169
  </div>
170
  </li>
171
  <!--}}} PIN by Callback-->
@@ -174,12 +175,10 @@ foreach ($dataStreet as $dataStreetValue) {
174
  elseif ($this->getCallbackConfigData() == 3):
175
  ?>
176
  <li>
 
177
  <div class="input-box">
178
- <label style="float:none;" for="<?php echo $code ?>_callback_email"><?php echo $this->__('E-mail Address') ?><span class="required">*</span></label><br/>
179
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_email" name="payment[callback_email]" title="<?php echo $this->__('Callback Email') ?>" class="input-text validate-email required-entry" value="<?php
180
- echo $sepaRefill ? $helper->_getCheckout()->getData($code)->getNnCallbackEmailNovalnetSepa()
181
- : '';
182
- ?>"/>
183
  </div>
184
  </li>
185
  <?php endif ?>
@@ -189,8 +188,7 @@ foreach ($dataStreet as $dataStreetValue) {
189
  <!-- Mandate overlay START-->
190
  <li>
191
  <div class="bgCover">&nbsp;</div>
192
- <div id='sepa_mandate_overlay_block_first' style='display:none;' class='overlay_window_block'>
193
- <img src='<?php echo $this->getSkinUrl("images/novalnet/novalnet-loading-icon.gif"); ?>'alt='Loading...'/>
194
  </div>
195
  <div id='sepa_mandate_overlay_block' style='display:none;' class='overlay_window_block'>
196
  <div class='nn_header'>
@@ -210,6 +208,7 @@ foreach ($dataStreet as $dataStreetValue) {
210
  </tr>
211
  </table><br/>
212
  <?php echo $this->__('SEPA Confirm paragraph') ?>
 
213
  <br/> <br/>
214
  <?php echo $this->__('SEPA Confirm note') ?>
215
  <br/> <br/>
@@ -217,63 +216,71 @@ foreach ($dataStreet as $dataStreetValue) {
217
  <tr>
218
  <td><?php echo $this->__('Name of the payee') ?></td><td>:</td><td><span id='sepa_overlay_enduserfullname_span'>&nbsp;</span></td>
219
  </tr>
220
- <?php if ($dataCompany): ?>
221
  <tr>
222
- <td><?php echo $this->__('Company') ?></td><td>:</td><td><?php echo $dataCompany; ?></td>
223
  </tr>
224
- <?php endif; ?>
225
- <?php if ($quoteaddress): ?>
226
  <tr>
227
- <td><?php echo $this->__('Address') ?></td><td>:</td><td><?php echo $quoteaddress; ?></td>
228
  </tr>
229
- <?php endif; ?>
230
- <?php if ($dataPostcode && $dataCity): ?>
231
  <tr>
232
- <td><?php echo $this->__('Zip Code And City') ?></td><td>:</td><td><?php echo $dataPostcode; ?><span id='sepa_overlay_enduserzipcode_span'>&nbsp;</span> <?php echo $dataCity; ?></td>
 
 
 
 
233
  </tr>
234
- <?php endif; ?>
235
- <?php if ($dataPostcode): ?>
236
  <tr>
237
  <td><?php echo $this->__('Country') ?></td><td>:</td><td><span id='sepa_overlay_endusercountry_span'>&nbsp;</span></td>
238
  </tr>
239
- <?php endif; ?>
240
- <?php if ($dataemail): ?>
241
  <tr>
242
- <td><?php echo $this->__('Email') ?></td><td>:</td><td><?php echo $dataemail; ?></td>
243
  </tr>
244
- <?php endif; ?>
245
  <tr id='nn_sepa_overlay_iban_tr'>
246
  <td><?php echo $this->__('IBAN') ?></td><td>:</td><td><span id='sepa_overlay_iban_span'>&nbsp;</span></td>
247
  </tr>
248
  <tr id='nn_sepa_overlay_bic_tr'>
249
  <td><?php echo $this->__('BIC') ?></td><td>:</td><td><span id='sepa_overlay_bic_span'>&nbsp;</span></td>
250
  </tr>
 
251
  </table>
252
  <br/>
253
- <?php echo $dataCity; ?>, <span id='sepa_overlay_mandatedate_span'>&nbsp;</span>, <span id='sepa_overlay_enduserfullname_span1'>&nbsp;</span>
254
  </p>
255
  </div>
256
  <div class='nn_footer'>
257
- <input style="width: 30%" type='button' id='mandate_confirm_btn' name='mandate_confirm_btn' onclick="mandateConfirmButtonSubmit()" value=<?php echo $this->__('conirm_mandate') ?> class='mandate_confirm_btn' />
258
- <input style="width: 30%" type='button' id='mandate_cancel_btn' name='mandate_cancel_btn' onclick="mandateCancelButtonSubmit()" value=<?php echo $this->__('NN cancel') ?> class='mandate_confirm_btn' />
259
  <img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>logo.png' width=120 alt='Novalnet AG' style='float:right;' />
260
  </div>
261
  </div>
262
  </li>
263
  <!-- Mandate overlay END-->
264
  </ul>
 
 
 
 
 
 
 
 
 
 
 
265
  <input type="hidden" id="nn_sepa_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
266
- <input type="hidden" id="nn_sepa_validate_error_message" value="<?php echo $this->__('Please enter valid account details') . '!'; ?>" />
267
- <input type="hidden" id="process_vendor_id" name="process_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>"/>
268
- <input type="hidden" id="auth_code" name="auth_code" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>"/>
269
- <input type="hidden" id="sepa_payment_id" value="37" name="sepa_payment_id">
270
- <input type="hidden" id="result_sepa_hash" value="<?php echo $sepaRefill ? $refillValues->getSepaHash() : ''; ?>" name="result_sepa_hash">
271
- <input type="hidden" id="result_mandate_date" value="" name="result_mandate_date">
272
- <input type="hidden" id="result_mandate_ref" value="" name="result_mandate_ref">
273
- <input type="hidden" id="result_mandate_unique" value="" name="result_mandate_unique">
274
- <input type="hidden" id="nnsepa_iban_confirmed" value="0" name="nnsepa_iban_confirmed">
275
- <input type="hidden" id="sepaiban" value="" name="sepaiban">
276
- <input type="hidden" id="sepabic" value="" name="sepabic">
277
  </fieldset>
278
  <style>
279
  .nnsepaloader {
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
+ $sepaRefill = $this->getMethod()->_getConfigData('auto_refill', true);
30
+ $sepaPaymentRefill = $this->getMethod()->getConfigData('sepa_payment_refill');
31
+ $refillValues = $assignDatahelper->getCheckout()->getRefilldatavalues();
32
  $refillMethod = ($sepaRefill && $refillValues != '' && $code == $refillValues->getMethod());
33
+ // get quote billing address
34
+ $billingaddress = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
35
+ $telephoneNumber = ($this->getCallbackConfigData() == 1 && $billingaddress->getTelephone())
36
+ ? $billingaddress->getTelephone() : '' ;
37
+ $street = $billingaddress->getStreet();
38
+ $customerlogin = Mage::getSingleton('customer/session')->isLoggedIn();
39
+ $panhash = '';
40
 
41
+ if ($sepaPaymentRefill && $customerlogin) {
42
+ $panhash = Mage::getModel('novalnet_payment/separefill')->getSepaPanHash($helper);
43
+ } else if ($sepaRefill) {
44
+ $panhash = $assignDatahelper->getCheckout()->getSepaHash();
 
 
 
 
 
 
 
 
45
  }
46
  ?>
47
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
48
  <!--{{{ Payment Logo -->
49
  <div>
50
+ <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;">
51
  <?php
52
+ $image = "sepa.png";
53
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
54
  ?>
55
  <img src="<?php echo $imgpath; ?>" alt="<?php echo $this->getMethod()->getConfigData('title'); ?>" title="<?php echo $this->getMethod()->getConfigData('title'); ?>" />
60
  <ul id="payment_form_<?php echo $code ?>" style="display:none">
61
  <div class="nnsepaloader" id='sepa_loading' style='display:none;'></div>
62
  <li>
63
+ <?php echo $this->__('Your account will be debited upon the order submission'); ?>
64
  </li>
65
  <?php if ($this->getUserInfo()): ?>
66
  <li>
68
  </li>
69
  <?php endif ?>
70
  <?php if (Mage::helper('novalnet_payment')->getModel('novalnetSepa')->_getConfigData('live_mode', true) == 0): ?>
71
+ <li>
72
+ <div style="font-weight:bold;color:red;font-size:12px;">
73
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
74
+ </div>
75
+ </li>
76
  <?php endif ?>
77
+
78
  <li class="fields">
79
  <div class="field">
80
+ <label style="float:none;" for="<?php echo $code ?>_account_holder"><?php echo $this->__('Account Holder') ?><span class="required">*</span></label><br/>
81
  <div class="input-box">
82
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_account_holder" onkeypress="return ibanbicValidate(event)" onchange="unsetHashRelatedElements();" name="payment[account_holder]" autocomplete="off" value="<?php echo $billingaddress->getFirstname() . ' ' . $billingaddress->getLastname(); ?>" />
83
  </div>
84
  </div>
85
  </li>
86
  <li class="fields">
87
+ <div class="field">
88
  <label style="float:none;" for="<?php echo $code ?>_bank_country"><?php echo $this->__('NN Country') ?><span class="required">*</span></label><br />
89
  <div class="input-box">
90
+ <?php
91
+ $_countries = Mage::getResourceModel('directory/country_collection')
92
+ ->loadData()
93
+ ->toOptionArray(false)
94
+ ?>
95
+ <?php if (count($_countries) > 0): ?>
96
+ <select id="<?php echo $code ?>_bank_country" onchange="unsetHashRelatedElements()" class="required-entry">
97
+ <?php
98
+ foreach ($_countries as $_country):
99
+ if (in_array($billingaddress->getCountryId(), $_country)) {
100
+ ?>
101
+ <option selected value="<?php echo $_country['value'] ?>"><?php echo $_country['label'] ?>
102
+ </option>
103
  <?php } else { ?>
104
+ <option value="<?php echo $_country['value'] ?>">
105
+ <?php echo $_country['label'] ?>
106
+ </option>
107
+ <?php } ?>
108
+ <?php endforeach; ?>
109
+ </select><br/>
110
+ <?php endif; ?>
111
+ </div>
112
  </div>
113
  </li>
114
  <li class="fields">
115
  <div class="field">
116
+ <label style="float:none;" for="<?php echo $code ?>_account_number"><?php echo $this->__('IBAN or Account number') ?><span class="required">*</span></label><br/>
117
  <div class="input-box">
118
+ <input type="text" id="<?php echo $code ?>_account_number" onkeypress="return ibanbicValidate(event)" onchange="unsetHashRelatedElements();" title="<?php echo $this->__('IBAN or Account number') ?>" class="required-entry input-text" autocomplete="off" value="" />
119
  </div>
120
  </div>
121
  </li>
122
+
123
  <li class="fields">
124
  <div class="field">
125
+ <label style="float:none;" for="<?php echo $code ?>_bank_code"><?php echo $this->__('BIC or Bank code') ?><span class="required">*</span></label><br/>
126
  <div class="input-box">
127
+ <input type="text" id="<?php echo $code ?>_bank_code" title="<?php echo $this->__('BIC or Bank code') ?>" class="input-text" autocomplete="off" onkeypress="return ibanbicValidate(event)" onchange="unsetHashRelatedElements()" value="" />
128
  </div>
129
  </div>
130
  </li>
131
+
132
  <li class="fields">
133
  <div class="field">
134
  <div class="input-box">
135
+ <input type="checkbox" id="<?php echo $code ?>_mandate_confirm" title="<?php echo $this->__('confirm') ?>" class="required-entry" onclick="generate_sepa_iban_bic(this, '<?php echo $this->__('Your account details are invalid') ?>', '<?php echo $this->__('Basic parameter not valid') ?>')"/>
136
+ <label style="float:none;" ><?php echo $this->__('NN Confirm') ?><span class="required"></span></label><br/>
137
+ </div>
138
  </div>
139
  </li>
140
  <!--{{{ CallbackType-->
144
  if ($this->getCallbackConfigData() != 3):
145
  ?>
146
  <li>
147
+ <label style="float:none;" for="<?php echo $code ?>_callback_tel">
148
  <div class="input-box">
149
+ <?php
150
+ if ($this->getCallbackConfigData() == 2):
151
+ ?>
152
+ <?php echo $this->__('Mobile phone number'); ?>
153
+ <?php else: ?>
154
+ <?php echo $this->__('NN Mobile Number'); ?>
155
+ <?php endif; ?>
156
+ <span class="required"></span></label><br/>
 
157
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" value="<?php
158
+ echo $telephoneNumber; ?>"/>
 
 
159
  </div>
160
  </li>
161
  <li>
162
  <div style="font-weight:bold;color:gray;border:1px solid #BFBFBF;font-size:11px; background:#FEFFBF; padding:10px; margin-top:10px;width:400px;">
163
  <?php echo $this->__('Note for pin by sms and callback') ?>
164
  </div>
165
+ <label style="float:none;" for="<?php echo $code ?>_callback_pin"><?php echo $this->__('PIN') ?><span class="required">*</span></label><br/>
166
  <div class="input-box">
167
+ <input onchange="document.getElementById('new_callback_pin').checked = false;" size="4" type="text" id="<?php echo $code ?>_callback_pin" name="payment[callback_pin]" title="<?php echo $this->__('Callback') ?>" class="input-text" /><br/>
168
+ <input id="new_callback_pin" type="checkbox" name="payment[new_callback_pin]" value="1">
169
+ <label style="float:none;" for="new_callback_pin"><?php echo $this->__('Forgot PIN? [New PIN Request]') ?></label>
 
170
  </div>
171
  </li>
172
  <!--}}} PIN by Callback-->
175
  elseif ($this->getCallbackConfigData() == 3):
176
  ?>
177
  <li>
178
+ <label style="float:none;" for="<?php echo $code ?>_callback_email"><?php echo $this->__('E-mail Address') ?><span class="required">*</span></label><br/>
179
  <div class="input-box">
 
180
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_email" name="payment[callback_email]" title="<?php echo $this->__('Callback Email') ?>" class="input-text validate-email required-entry" value="<?php
181
+ echo $billingaddress->getEmail(); ?>"/>
 
 
182
  </div>
183
  </li>
184
  <?php endif ?>
188
  <!-- Mandate overlay START-->
189
  <li>
190
  <div class="bgCover">&nbsp;</div>
191
+ <div id='sepa_mandate_overlay_block_first' style='display:none;' class='nnsepaloader'>
 
192
  </div>
193
  <div id='sepa_mandate_overlay_block' style='display:none;' class='overlay_window_block'>
194
  <div class='nn_header'>
208
  </tr>
209
  </table><br/>
210
  <?php echo $this->__('SEPA Confirm paragraph') ?>
211
+
212
  <br/> <br/>
213
  <?php echo $this->__('SEPA Confirm note') ?>
214
  <br/> <br/>
216
  <tr>
217
  <td><?php echo $this->__('Name of the payee') ?></td><td>:</td><td><span id='sepa_overlay_enduserfullname_span'>&nbsp;</span></td>
218
  </tr>
219
+ <?php if($billingaddress->getCompany()) { ?>
220
  <tr>
221
+ <td><?php echo $this->__('Company name') ?></td><td>:</td><td><?php echo $billingaddress->getCompany(); ?></td>
222
  </tr>
223
+ <?php } ?>
 
224
  <tr>
225
+ <td><?php echo $this->__('NN Address') ?></td><td>:</td><td><?php echo $street[0]; ?></td>
226
  </tr>
227
+ <?php if(isset($street[1]) && $street[1]) { ?>
 
228
  <tr>
229
+ <td><?php echo $this->__('NN Street') ?></td><td>:</td><td><?php echo $street[1]; ?></td>
230
+ </tr>
231
+ <?php }?>
232
+ <tr>
233
+ <td><?php echo $this->__('Zip Code And City') ?></td><td>:</td><td><?php echo $billingaddress->getPostcode(); ?><span id='sepa_overlay_enduserzipcode_span'>&nbsp;</span> <?php echo $billingaddress->getCity(); ?></td>
234
  </tr>
 
 
235
  <tr>
236
  <td><?php echo $this->__('Country') ?></td><td>:</td><td><span id='sepa_overlay_endusercountry_span'>&nbsp;</span></td>
237
  </tr>
238
+ <?php if($billingaddress->getEmail()) { ?>
 
239
  <tr>
240
+ <td><?php echo $this->__('Email') ?></td><td>:</td><td><?php echo $billingaddress->getEmail(); ?></td>
241
  </tr>
242
+ <?php } ?>
243
  <tr id='nn_sepa_overlay_iban_tr'>
244
  <td><?php echo $this->__('IBAN') ?></td><td>:</td><td><span id='sepa_overlay_iban_span'>&nbsp;</span></td>
245
  </tr>
246
  <tr id='nn_sepa_overlay_bic_tr'>
247
  <td><?php echo $this->__('BIC') ?></td><td>:</td><td><span id='sepa_overlay_bic_span'>&nbsp;</span></td>
248
  </tr>
249
+
250
  </table>
251
  <br/>
252
+ <?php echo $billingaddress->getCity(); ?>, <span id='sepa_overlay_mandatedate_span'>&nbsp;</span>, <span id='sepa_overlay_enduserfullname_span1'>&nbsp;</span>
253
  </p>
254
  </div>
255
  <div class='nn_footer'>
256
+ <input style="width: 30%" type='button' id='mandate_confirm_btn' name='mandate_confirm_btn' onclick="mandate_confirm_btn_submit()" value=<?php echo $this->__('conirm_mandate') ?> class='mandate_confirm_btn' />
257
+ <input style="width: 30%" type='button' id='mandate_cancel_btn' name='mandate_cancel_btn' onclick="mandate_cancel_btn_submit()" value=<?php echo $this->__('cancel') ?> class='mandate_confirm_btn' />
258
  <img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>logo.png' width=120 alt='Novalnet AG' style='float:right;' />
259
  </div>
260
  </div>
261
  </li>
262
  <!-- Mandate overlay END-->
263
  </ul>
264
+
265
+ <input type="hidden" id="process_vendor_id" value="<?php echo trim($this->getMethod()->_getConfigData('merchant_id', true)) ?>"/>
266
+ <input type="hidden" id="auth_code" value="<?php echo trim($this->getMethod()->_getConfigData('auth_code', true)) ?>"/>
267
+ <input id="sepaiban" type="hidden" value="">
268
+ <input id="sepabic" type="hidden" value="">
269
+ <input id="sepa_payment_id" type="hidden" value="37">
270
+ <input id="novalnet_sepa_owner" type="hidden" value="">
271
+ <input id="result_mandate_date" type="hidden" value="">
272
+ <input id="result_mandate_ref" type="hidden" value="">
273
+ <input id="result_mandate_unique" type="hidden" value="" name="result_mandate_unique">
274
+ <input id="nnsepa_iban_confirmed" type="hidden" value="0" name="nnsepa_iban_confirmed">
275
  <input type="hidden" id="nn_sepa_merchant_validate_error_message" value="<?php echo $this->__('Basic parameter not valid') . '!'; ?>" />
276
+ <input type="hidden" id="nn_sepa_validate_error_message" value="<?php echo $this->__('Your account details are invalid') . '!'; ?>" />
277
+ <input id="result_sepa_hash" type="hidden" value="<?php
278
+ if (($sepaPaymentRefill || $sepaRefill) && $panhash != '') {
279
+ echo $panhash;
280
+ } else {
281
+ $panhash = '';
282
+ }
283
+ ?>" name="result_sepa_hash">
 
 
 
284
  </fieldset>
285
  <style>
286
  .nnsepaloader {
app/design/frontend/base/default/template/novalnet/payment/method/info/Banktransfer.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
+ ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
+ <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/info/Cc.phtml CHANGED
@@ -23,11 +23,13 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $_info = $this->getInfo();
29
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
30
  $helper = Mage::helper('novalnet_payment');
 
 
 
31
  if ($_info):
32
  ?>
33
  <?php
@@ -36,7 +38,10 @@ if ($this->getAdditionalData('NnTestOrder'))
36
  ?>
37
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
38
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
39
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>
 
 
 
40
  <?php if ($this->getAdditionalData('refunded_tid')):
41
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
42
  if ($this->getAdditionalData('fullRefund') == true):
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
  if ($_info):
34
  ?>
35
  <?php
38
  ?>
39
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
40
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
41
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>
42
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>
43
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
44
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
45
  <?php if ($this->getAdditionalData('refunded_tid')):
46
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
47
  if ($this->getAdditionalData('fullRefund') == true):
app/design/frontend/base/default/template/novalnet/payment/method/info/Eps.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
+ ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
+ <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/info/Ideal.phtml CHANGED
@@ -13,30 +13,40 @@
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
- *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $_info = $this->getInfo();
 
 
 
29
  if ($_info):
 
 
 
 
30
  ?>
31
- <?php
32
- if ($this->getAdditionalData('NnTestOrder'))
33
- echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
34
- ?>
35
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
36
- <?php if ($_info->getLastTransId() != "") echo $this->__('Novalnet Transaction ID: %s', $this->htmlEscape($_info->getLastTransId())) . '<br /><br />' ?>
37
- <?php if ($this->getAdditionalData('NnComments')) { ?>
38
- <?php echo $this->getAdditionalData('NnComments') ?><br />
39
- <?php } ?>
 
 
 
 
 
40
  <?php else: ?>
41
- <?php echo $this->__('Error in getting payment method'); ?>
42
  <?php endif; ?>
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
+ *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
  if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
  ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
  <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
  <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/info/Invoice.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,13 +20,17 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($_info): ?>
32
  <?php
@@ -35,7 +39,10 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
35
  ?>
36
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
38
- <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('Transaction deactivated successfully') . '<br>' ?>
 
 
 
39
  <?php if ($this->getAdditionalData('refunded_tid')):
40
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
  if ($this->getAdditionalData('fullRefund') == true):
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($_info): ?>
36
  <?php
39
  ?>
40
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
41
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
42
+ <?php if ($nextCycleDate) echo '<br>' . $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br><br>' ?>
43
+ <?php if ($this->getAdditionalData('captureTid')) echo '<br>' . $this->__('The transaction has been confirmed on %s', $captureTime) . '<br><br>' ?>
44
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
45
+ <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('The transaction has been canceled on ') . $currentTime . '<br>' ?>
46
  <?php if ($this->getAdditionalData('refunded_tid')):
47
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
48
  if ($this->getAdditionalData('fullRefund') == true):
app/design/frontend/base/default/template/novalnet/payment/method/info/Paypal.phtml CHANGED
@@ -13,28 +13,40 @@
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
- *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
 
 
 
27
  if ($_info):
 
 
 
 
28
  ?>
29
- <?php
30
- if ($this->getAdditionalData('NnTestOrder'))
31
- echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
32
- ?>
33
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
34
- <?php if ($_info->getLastTransId() != "") echo $this->__('Novalnet Transaction ID: %s', $this->htmlEscape($_info->getLastTransId())) . '<br /><br />' ?>
35
- <?php if ($this->getAdditionalData('NnComments')) { ?>
36
- <?php echo $this->getAdditionalData('NnComments') ?><br />
37
- <?php } ?>
 
 
 
 
 
38
  <?php else: ?>
39
- <?php echo $this->__('Error in getting payment method'); ?>
40
  <?php endif; ?>
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
  * would be greatly appreciated.
20
+ *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
  if ($_info):
31
+ ?>
32
+ <?php
33
+ if ($this->getAdditionalData('NnTestOrder'))
34
+ echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
35
  ?>
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
38
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
39
+ <?php if ($this->getAdditionalData('refunded_tid')):
40
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
+ if ($this->getAdditionalData('fullRefund') == true):
42
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
43
+ else:
44
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
45
+ endif;
46
+ endforeach;
47
+ endif;
48
+ ?>
49
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
50
  <?php else: ?>
51
+ <?php echo $this->__('Error in getting payment method') ?>
52
  <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/info/Prepayment.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,13 +20,17 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($_info): ?>
32
  <?php
@@ -35,7 +39,10 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
35
  ?>
36
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
37
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
38
- <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('Transaction deactivated successfully') . '<br>' ?>
 
 
 
39
  <?php if ($this->getAdditionalData('refunded_tid')):
40
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
41
  if ($this->getAdditionalData('fullRefund') == true):
@@ -46,7 +53,7 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
46
  endforeach;
47
  endif;
48
  ?>
49
- <?php if (!preg_match("/invoice|creditmemo|shipment|callback_novalnet2magento/i", $currentUrl)): ?>
50
  <?php
51
  if (strlen($this->getAdditionalData('NnNote'))):
52
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
@@ -96,3 +103,4 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
96
  <?php else: ?>
97
  <?php echo $this->__('Error in getting payment method') ?>
98
  <?php endif; ?>
 
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($_info): ?>
36
  <?php
39
  ?>
40
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
41
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br />' ?>
42
+ <?php if ($nextCycleDate) echo '<br>' . $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br><br>' ?>
43
+ <?php if ($this->getAdditionalData('captureTid')) echo '<br>' . $this->__('The transaction has been confirmed on %s', $captureTime) . '<br><br>' ?>
44
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
45
+ <?php if ($this->getAdditionalData('voidTid')) echo '<br>' . $this->__('The transaction has been canceled on ') . $currentTime . '<br>' ?>
46
  <?php if ($this->getAdditionalData('refunded_tid')):
47
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
48
  if ($this->getAdditionalData('fullRefund') == true):
53
  endforeach;
54
  endif;
55
  ?>
56
+ <?php if (!preg_match("/creditmemo|callback_novalnet2magento/i", $currentUrl)): ?>
57
  <?php
58
  if (strlen($this->getAdditionalData('NnNote'))):
59
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
103
  <?php else: ?>
104
  <?php echo $this->__('Error in getting payment method') ?>
105
  <?php endif; ?>
106
+
app/design/frontend/base/default/template/novalnet/payment/method/info/Sepa.phtml CHANGED
@@ -23,11 +23,13 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <?php
28
  $_info = $this->getInfo();
29
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
30
  $helper = Mage::helper('novalnet_payment');
 
 
 
31
  if ($_info):
32
  ?>
33
  <?php
@@ -36,7 +38,10 @@ if ($this->getAdditionalData('NnTestOrder'))
36
  ?>
37
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
38
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
39
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>
 
 
 
40
  <?php if ($this->getAdditionalData('refunded_tid')):
41
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
42
  if ($this->getAdditionalData('fullRefund') == true):
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
  if ($_info):
34
  ?>
35
  <?php
38
  ?>
39
  <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
40
  <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
41
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>
42
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>
43
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>
44
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
45
  <?php if ($this->getAdditionalData('refunded_tid')):
46
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
47
  if ($this->getAdditionalData('fullRefund') == true):
app/design/frontend/base/default/template/novalnet/payment/method/info/Sofortueberweisung.phtml DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * Part of the payment module of Novalnet AG
16
- * https://www.novalnet.de
17
- * If you have found this script useful a small
18
- * recommendation as well as a comment on merchant form
19
- * would be greatly appreciated.
20
- *
21
- * @category Novalnet
22
- * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
- $_info = $this->getInfo();
27
- if ($_info):
28
- ?>
29
- <?php
30
- if ($this->getAdditionalData('NnTestOrder'))
31
- echo '<div style="color:white;font-weight:bold;background:red;padding:5px 10px;text-align:center;font-size:15px">!', $this->__('Testorder'), '!</div>'
32
- ?>
33
- <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br />
34
- <?php if ($_info->getLastTransId() != "") echo $this->__('Novalnet Transaction ID: %s', $this->htmlEscape($_info->getLastTransId())) . '<br /><br />' ?>
35
- <?php if ($this->getAdditionalData('NnComments')) { ?>
36
- <?php echo $this->getAdditionalData('NnComments') ?><br />
37
- <?php } ?>
38
- <?php else: ?>
39
- <?php echo $this->__('Error in getting payment method'); ?>
40
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Banktransfer.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Cc.phtml CHANGED
@@ -25,19 +25,37 @@
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
28
  $helper = Mage::helper('novalnet_payment');
 
 
 
 
29
  ?>
30
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
31
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
32
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
33
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>{{pdf_row_separator}}
 
 
 
34
  <?php if ($this->getAdditionalData('refunded_tid')):
35
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
36
  if ($this->getAdditionalData('fullRefund') == true):
37
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
 
 
 
38
  else:
39
  echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
 
 
 
40
  endif;
41
  endforeach;
42
  endif;
43
- ?>{{pdf_row_separator}}
 
 
 
 
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
+ if ($_info):
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
45
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
46
+ ?>
47
+ {{pdf_row_separator}}
48
+ <?php
49
  else:
50
  echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
51
+ ?>
52
+ {{pdf_row_separator}}
53
+ <?php
54
  endif;
55
  endforeach;
56
  endif;
57
+ ?>
58
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
59
+ <?php else: ?>
60
+ <?php echo $this->__('Error in getting payment method') ?>
61
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Eps.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
+ ?>
32
+ <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Ideal.phtml CHANGED
@@ -23,7 +23,27 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
 
 
26
  ?>
27
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
28
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
29
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $this->getInfo()->getLastTransId()) ?>{{pdf_row_separator}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
  ?>
32
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Invoice.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,18 +20,25 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
32
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
33
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
34
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') ?>{{pdf_row_separator}}
 
 
 
35
  <?php if ($this->getAdditionalData('refunded_tid')):
36
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
37
  if ($this->getAdditionalData('fullRefund') == true):
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
37
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Paypal.phtml CHANGED
@@ -23,12 +23,27 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
 
 
26
  ?>
27
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
28
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
29
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $this->getInfo()->getLastTransId()) ?>{{pdf_row_separator}}
30
- <?php
31
- if (strlen($this->getAdditionalData('NnComments'))) {
32
- echo $this->getAdditionalData('NnComments');
33
- }
34
- ?>{{pdf_row_separator}}
 
 
 
 
 
 
 
 
 
 
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ $_info = $this->getInfo();
27
+ $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $helper = Mage::helper('novalnet_payment');
29
+ $currentTime = $this->getAdditionalData('voidCreateAt');
30
+ if ($_info):
31
  ?>
32
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
33
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
34
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>
35
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>
36
+ <?php if ($this->getAdditionalData('refunded_tid')):
37
+ foreach($this->getAdditionalData('refunded_tid') as $key => $value):
38
+ if ($this->getAdditionalData('fullRefund') == true):
39
+ echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
40
+ else:
41
+ echo $this->__('New Tid: %s', $helper->makeValidNumber($value['reftid'])) . ' ' . $this->__('for the refunded amount %s', $value['refamount']) . '<br><br>';
42
+ endif;
43
+ endforeach;
44
+ endif;
45
+ ?>
46
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Error in getting payment method') ?>
49
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Prepayment.phtml CHANGED
@@ -12,7 +12,7 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * Part of the payment module of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
@@ -20,18 +20,25 @@
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
- * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 
 
 
 
30
  ?>
31
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
32
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
33
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
34
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') ?>{{pdf_row_separator}}
 
 
 
35
  <?php if ($this->getAdditionalData('refunded_tid')):
36
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
37
  if ($this->getAdditionalData('fullRefund') == true):
@@ -42,7 +49,7 @@ $currentUrl = Mage::helper('core/url')->getCurrentUrl();
42
  endforeach;
43
  endif;
44
  ?>{{pdf_row_separator}}
45
- <?php if (!preg_match("/invoice|creditmemo|shipment|callback_novalnet2magento/i", $currentUrl)): ?>
46
  <?php
47
  if (strlen($this->getAdditionalData('NnNote'))):
48
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * Part of the Paymentmodule of Novalnet AG
16
  * https://www.novalnet.de
17
  * If you have found this script useful a small
18
  * recommendation as well as a comment on merchant form
20
  *
21
  * @category Novalnet
22
  * @package Novalnet_Payment
23
+ * @copyright Novalnet AG
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
  $helper = Mage::helper('novalnet_payment');
29
  $currentUrl = Mage::helper('core/url')->getCurrentUrl();
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
33
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
  <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
37
  <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) echo $this->__('The transaction has been canceled on %s', $currentTime) . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
49
  endforeach;
50
  endif;
51
  ?>{{pdf_row_separator}}
52
+ <?php if (!preg_match("/creditmemo|callback_novalnet2magento/i", $currentUrl)): ?>
53
  <?php
54
  if (strlen($this->getAdditionalData('NnNote'))):
55
  if (strstr($this->getAdditionalData('NnNote'), 'br')):
app/design/frontend/base/default/template/novalnet/payment/method/pdf/Sepa.phtml CHANGED
@@ -25,21 +25,42 @@
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
 
28
  $helper = Mage::helper('novalnet_payment');
 
 
 
 
29
  ?>
30
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
31
- <strong><?php echo Mage::helper('novalnet_payment')->__('%s', $this->getMethod()->getTitle()) ?></strong>{{pdf_row_separator}}
32
- <?php echo Mage::helper('novalnet_payment')->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br>'; ?>{{pdf_row_separator}}
33
- <?php if ($this->getAdditionalData('voidTid')) echo $this->__('Transaction deactivated successfully') . '<br><br>' ?>{{pdf_row_separator}}
 
 
 
34
  <?php if ($this->getAdditionalData('refunded_tid')):
35
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
36
  if ($this->getAdditionalData('fullRefund') == true):
37
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
 
 
 
38
  elseif(preg_match("/refund/i", $value['reftid'])):
39
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('amount refunded is %s', $value['refamount']) . '<br><br>';
 
 
 
40
  else:
41
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('refund amount %s', $value['refamount']) . ', ' . $this->__('New Tid: %s', $value['reftid']) . ' ' . $this->__('for the balance amount.') . '<br><br>';
 
 
 
42
  endif;
43
  endforeach;
44
  endif;
45
- ?>{{pdf_row_separator}}
 
 
 
 
25
  */
26
  $_info = $this->getInfo();
27
  $transactionId = $this->getAdditionalData('NnTid') ? $this->getAdditionalData('NnTid') : $_info->getLastTransId();
28
+ $nextCycleId = $this->getAdditionalData('NnSepaParentTid') ? $this->getAdditionalData('NnSepaParentTid') : $this->getAdditionalData('NnTid');
29
  $helper = Mage::helper('novalnet_payment');
30
+ $currentTime = $this->getAdditionalData('voidCreateAt');
31
+ $captureTime = $this->getAdditionalData('CaptureCreateAt');
32
+ $nextCycleDate = $helper->getCycleDate($nextCycleId);
33
+ if ($_info):
34
  ?>
35
  <?php if ($this->getAdditionalData('NnTestOrder')) echo $this->__('Testorder'); ?>{{pdf_row_separator}}
36
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>{{pdf_row_separator}}
37
+ <?php if ($transactionId) echo $this->__('Novalnet Transaction ID: %s', $helper->makeValidNumber($transactionId)) . '<br /><br>' ?>{{pdf_row_separator}}
38
+ <?php if ($nextCycleDate) echo $this->__('Next Payment Date is: %s', $nextCycleDate) . '<br /><br>' ?>{{pdf_row_separator}}
39
+ <?php if ($this->getAdditionalData('captureTid')) echo $this->__('The transaction has been confirmed on %s', $captureTime) . '<br /><br>' ?>{{pdf_row_separator}}
40
+ <?php if ($this->getAdditionalData('subsCancelReason')) echo $this->__('Subscription Cancellation: %s', $this->getAdditionalData('subsCancelReason')) . '<br /><br>' ?>{{pdf_row_separator}}
41
+ <?php if ($this->getAdditionalData('voidTid')) $this->__('The transaction has been canceled on ') . $currentTime . '<br><br>' ?>{{pdf_row_separator}}
42
  <?php if ($this->getAdditionalData('refunded_tid')):
43
  foreach($this->getAdditionalData('refunded_tid') as $key => $value):
44
  if ($this->getAdditionalData('fullRefund') == true):
45
  echo $this->__('Refunded Transaction ID: %s', $helper->makeValidNumber($value['reftid'])) . '<br><br>';
46
+ ?>
47
+ {{pdf_row_separator}}
48
+ <?php
49
  elseif(preg_match("/refund/i", $value['reftid'])):
50
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('amount refunded is %s', $value['refamount']) . '<br><br>';
51
+ ?>
52
+ {{pdf_row_separator}}
53
+ <?php
54
  else:
55
  echo $this->__('For Tid: %s', $helper->makeValidNumber($value['reqtid'])) . ' ' . $this->__('refund amount %s', $value['refamount']) . ', ' . $this->__('New Tid: %s', $value['reftid']) . ' ' . $this->__('for the balance amount.') . '<br><br>';
56
+ ?>
57
+ {{pdf_row_separator}}
58
+ <?php
59
  endif;
60
  endforeach;
61
  endif;
62
+ ?>
63
+ <?php if ($this->getAdditionalData('NnComments')) echo $this->getAdditionalData('NnComments'); ?>
64
+ <?php else: ?>
65
+ <?php echo $this->__('Error in getting payment method') ?>
66
+ <?php endif; ?>
app/design/frontend/base/default/template/novalnet/sales/recurring/profile/view.phtml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * Part of the payment module of Novalnet AG
16
+ * https://www.novalnet.de
17
+ * If you have found this script useful a small
18
+ * recommendation as well as a comment on merchant form
19
+ * would be greatly appreciated.
20
+ *
21
+ * @category Novalnet
22
+ * @package Novalnet_Payment
23
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <?php /* @var $this Mage_Sales_Block_Recurring_Profile_View */ ?>
28
+
29
+ <div class="order-page">
30
+
31
+ <!-- title 'n' actions -->
32
+ <div class="page-title title-buttons">
33
+ <h1><?php echo $this->__('Recurring Profile # %s', $this->escapeHtml($this->getReferenceId())) ?></h1>
34
+ <div id="recurring_buttons_view">
35
+ <?php if ($this->getCanCancel()): ?>
36
+ <button style="position: static;" type="button" title="<?php echo $this->__('Cancel') ?>" class="button" onclick="cancelviewstatus('recurring_buttons_view', 'recurring_cancel_button_view')"><span><span><?php echo $this->__('Cancel') ?></span></span></button>
37
+ <?php endif; ?>
38
+ <?php
39
+ if ($this->getCanSuspend() && $this->_profile->getState() != 'pending'):
40
+ ?>
41
+ <button style="position: static;" type="button" title="<?php echo $this->__('Suspend') ?>" class="button" onclick="if (confirm('<?php echo $this->getConfirmationMessage() ?>')) {
42
+ window.location.href = '<?php echo $this->getSuspendUrl() ?>';
43
+ }
44
+ return false;"><span><span><?php echo $this->__('Suspend') ?></span></span></button>
45
+ <?php endif; ?>
46
+ <?php
47
+ if ($this->getCanActivate() && $this->_profile->getState() != 'pending'):
48
+ ?>
49
+ <button style="position: static;" type="button" title="<?php echo $this->__('Activate') ?>" class="button" onclick="if (confirm('<?php echo $this->getConfirmationMessage() ?>')) {
50
+ window.location.href = '<?php echo $this->getActivateUrl() ?>';
51
+ }
52
+ return false;"><span><span><?php echo $this->__('Activate') ?></span></span></button>
53
+ <?php endif; ?>
54
+ </div>
55
+
56
+ <div id="recurring_cancel_button_view" style="display:none;">
57
+ <?php if ($this->getCanCancel()): ?>
58
+ <?php echo $this->getCancelReason(); ?>
59
+ <button type="button" title="<?php echo $this->__('Cancel') ?>" class="button" onclick="cancel_action('<?php echo $this->getConfirmationMessage() ?>', '<?php echo $this->getCancelUrl() ?>','<?php echo $this->__('Please select the reason of subscription cancellation'); ?>');"><span><span><?php echo $this->__('Cancel') ?></span></span></button>
60
+ <?php endif; ?>
61
+ </div>
62
+ </div>
63
+
64
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
65
+
66
+ <!-- info tabs -->
67
+ <?php $infoTabs = $this->getChildGroup('info_tabs'); ?>
68
+
69
+ <dl class="order-info">
70
+ <dt><?php echo $this->__('About This Profile:') ?></dt>
71
+ <dd>
72
+ <ul id="order-info-tabs">
73
+ <?php foreach ($infoTabs as $block): ?>
74
+ <?php if ($this->getObjectData($block, 'is_view_current')): ?>
75
+ <li class="current"><strong><?php echo $this->escapeHtml($this->getObjectData($block, 'view_label')) ?></strong></li>
76
+ <?php else: ?>
77
+ <li><a href="<?php echo $this->escapeHtml($this->getObjectData($block, 'view_url')) ?>"><?php echo $this->escapeHtml($this->getObjectData($block, 'view_label')) ?></a></li>
78
+ <?php endif; ?>
79
+ <?php endforeach; ?>
80
+ </ul>
81
+ </dd>
82
+ </dl>
83
+
84
+ <!-- info blocks in 2 columns -->
85
+ <?php for ($i = 1; $i <= 5; $i++): ?>
86
+ <?php $infoBlocks = $this->getChildGroup("info_blocks_row_{$i}"); ?>
87
+ <?php if ($infoBlocks): ?>
88
+ <div class="col2-set order-info-box">
89
+ <?php for ($j = 1; $j <= 2; $j++): ?>
90
+ <?php foreach ($infoBlocks as $alias => $block): ?>
91
+ <?php if ($j == $this->getObjectData($block, 'view_column')): ?>
92
+ <div class="col-<?php echo $j ?>">
93
+ <div>
94
+ <div class="box-title">
95
+ <h2><?php echo $this->escapeHtml($this->getObjectData($block, 'view_label')) ?></h2>
96
+ </div>
97
+ <div class="box-content">
98
+ <?php
99
+ $html = $this->getChildHtml($alias)
100
+ ?>
101
+ <?php
102
+ echo ($html ? $html : $this->__('No information available.'));
103
+ ?>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ <?php endif; ?>
108
+ <?php endforeach; ?>
109
+ <?php endfor; ?>
110
+ </div>
111
+ <?php endif; ?>
112
+ <?php endfor; ?>
113
+
114
+ <!-- table data block -->
115
+ <?php $table = $this->getChild('table') ?>
116
+ <?php if ($table): ?>
117
+ <div>
118
+ <h2 class="table-caption"><?php echo $this->escapeHtml($this->getObjectData($table, 'view_label')) ?></h2>
119
+ <?php echo $this->getChildHtml('table') ?>
120
+ </div>
121
+ <?php endif; ?>
122
+
123
+ <div class="buttons-set">
124
+ <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->__('Back to Recurring Profiles') ?></a></p>
125
+ </div>
126
+ </div>
127
+ <script type="text/javascript">
128
+ function cancelviewstatus(current_id, change_id)
129
+ {
130
+ document.getElementById(current_id).style.display = 'none';
131
+ document.getElementById(change_id).style.display = 'block';
132
+ }
133
+
134
+ function cancel_action(message, url, cancelReason)
135
+ {
136
+ var reason = parseInt(document.getElementById('reason-subscribe').value);
137
+ var resontext = document.getElementById('reason-subscribe');
138
+ var resontextval = resontext.options[resontext.selectedIndex].innerHTML;
139
+
140
+ if (reason) {
141
+ if (confirm(message)) {
142
+ window.location.href = url + "?reason=" + resontextval;
143
+ }
144
+ } else {
145
+ alert(cancelReason);
146
+ }
147
+ return false;
148
+ }
149
+ </script>
app/design/frontend/default/default/layout/novalnet.xml CHANGED
@@ -1,7 +1,36 @@
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <layout version="0.1.0">
3
  <checkout_onepage_index>
4
  <reference name="head">
 
 
 
5
  <action method="addJs">
6
  <script>novalnet/novalnetcc.js</script>
7
  </action>
1
  <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * Part of the payment module of Novalnet AG
17
+ * https://www.novalnet.de
18
+ * If you have found this script useful a small
19
+ * recommendation as well as a comment on merchant form
20
+ * would be greatly appreciated.
21
+ *
22
+ * @category Novalnet
23
+ * @package Novalnet_Payment
24
+ * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ -->
28
  <layout version="0.1.0">
29
  <checkout_onepage_index>
30
  <reference name="head">
31
+ <action method="addJs">
32
+ <script>novalnet/novalnetJquery.js</script>
33
+ </action>
34
  <action method="addJs">
35
  <script>novalnet/novalnetcc.js</script>
36
  </action>
app/design/frontend/{base/default/template/novalnet/payment/method/form/Sofortueberweisung.phtml → default/default/template/novalnet/payment/method/form/Banktransfer.phtml} RENAMED
@@ -23,9 +23,6 @@
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- ?>
27
- <a name="<?php echo $this->getMethodCode() ?>"></a>
28
- <?php
29
  $_code = $this->getMethodCode();
30
  $helper = Mage::helper('novalnet_payment');
31
  ?>
@@ -34,33 +31,30 @@ $helper = Mage::helper('novalnet_payment');
34
  <div>
35
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
36
  <?php
37
- $image = "sofort_Logo.png";
38
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
39
  ?>
40
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
41
  </a>
42
  </div>
43
  <!--}}} Payment Logo -->
44
- <!--{{{ Payment Description -->
45
- <div>
46
- <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
 
 
 
47
  <li>
48
- <?php echo $this->__('You will be redirected to Novalnet AG website when you place an order.') ?>
49
  </li>
50
- <?php if ($this->getUserInfo()): ?>
51
- <li>
52
- <?php echo $this->getUserInfo() ?>
53
- </li>
54
- <?php endif; ?>
55
- <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
56
- <li>
57
- <div style="font-weight:bold;color:red;font-size:12px;">
58
- <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
59
- </div>
60
- </li>
61
- <?php endif ?>
62
- </ul>
63
- </div>
64
- <!--}}} Payment Description -->
65
- <div class="clear"></div>
66
  </fieldset>
23
  * @copyright Copyright (c) Novalnet AG. (https://www.novalnet.de)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
 
 
 
26
  $_code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  ?>
31
  <div>
32
  <a href="<?php echo $helper->getNovalnetUrl() ?>" target="_new" style="text-decoration:none;">
33
  <?php
34
+ $image = "banktransfer.png";
35
  $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $image;
36
  ?>
37
  <img src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
38
  </a>
39
  </div>
40
  <!--}}} Payment Logo -->
41
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none;">
42
+ <!--{{{ Payment Description -->
43
+ <li>
44
+ <?php echo $this->__('redirect payment description') ?>
45
+ </li>
46
+ <?php if ($this->getUserInfo()): ?>
47
  <li>
48
+ <?php echo $this->getUserInfo() ?>
49
  </li>
50
+ <?php endif; ?>
51
+ <?php if ($this->getMethod()->_getConfigData('live_mode', true) == 0): ?>
52
+ <li>
53
+ <div style="font-weight:bold;color:red;font-size:12px;">
54
+ <?php echo $this->__('Please Note: This transaction will run on TEST MODE and the amount will not be charged') ?>
55
+ </div>
56
+ </li>
57
+ <?php endif ?>
58
+ <!--{{{ Payment Description -->
59
+ </ul>
 
 
 
 
 
 
60
  </fieldset>
app/design/frontend/default/default/template/novalnet/payment/method/form/Cc.phtml CHANGED
@@ -26,29 +26,31 @@
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
- $refillValues = $assignDatahelper->_getCheckout()->getData($code);
30
- $ccRefill = $this->getMethod()->getConfigData('cc_refill');
31
  $creditCardSecure = $this->getMethod()->getConfigData('active_cc3d');
32
- $refillMethod = ($refillValues != '' && $code == $refillValues->getMethod());
33
-
34
- $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
 
 
35
  ?>
36
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
37
  <!--{{{ Payment Logo -->
38
  <div>
39
  <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;float:none;">
40
  <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
41
- <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $typeCode . "_Logo.png"; ?>
42
- <img style="height:20px;" src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
43
  <?php endforeach; ?>
44
  </a>
45
  </div>
46
  <!--}}} Payment Logo -->
47
  <!--{{{ Novalnet Cc Form -->
48
- <ul id="payment_form_<?php echo $code ?>" style="display:none">
 
49
  <div class="nnccloader" id='cc_loading' style='display:none;'></div>
50
  <li>
51
- <?php echo $this->__('The amount will be booked immediately from your credit card.'); ?>
52
  </li>
53
  <?php if ($this->getUserInfo()): ?>
54
  <li>
@@ -64,13 +66,13 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
64
  <?php endif ?>
65
  <li class="fields">
66
  <div class="field">
67
- <label style="float:none;" for="<?php echo $code ?>_cc_type"><?php echo $this->__('NN CC type') ?><span class="required">*</span></label><br />
68
- <div class="input-box">
69
- <select id="<?php echo $code ?>_cc_type" onchange="ccHashCall();" class="required-entry validate-cc-type-select">
70
- <option value=""><?php echo $this->__('--Please Select--') ?></option>
71
- <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
72
- <option value="<?php echo $typeCode ?>"><?php echo $typeName ?></option>
73
- <?php endforeach; ?>
74
  </select>
75
  </div>
76
  </div>
@@ -78,47 +80,48 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
78
  <li class="fields">
79
  <div class="field">
80
  <label style="float:none;" for="<?php echo $code ?>_cc_owner"><?php echo $this->__('NN CC holder') ?><span class="required">*</span></label><br/>
81
- <div class="input-box">
82
- <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_cc_owner" autocomplete="off" onchange="ccHashCall();" value="<?php echo $billingaddres->getFirstname().' '.$billingaddres->getLastname() ?>" /></div>
83
  </div>
84
  </li>
85
- <li class="fields">
86
- <div class="field">
87
  <label style="float:none;" for="<?php echo $code ?>_cc_number"><?php echo $this->__('NN CC number') ?><span class="required">*</span></label><br/>
88
- <div class="input-box">
89
- <input type="text" id="<?php echo $code ?>_cc_number" title="<?php echo $this->__('Credit Card Number') ?>" class="required-entry input-text validate-cc-number validate-cc-type" autocomplete="off" onchange="ccHashCall();" onkeypress="return isNumberKey(event, true);" value="" /> </div>
 
90
  </div>
91
  </li>
92
  <li class="fields">
93
- <div class="field">
94
  <label style="float:none;" for="<?php echo $code ?>_expiration"><?php echo $this->__('NN Expiration Date') ?><span class="required">*</span></label><br />
95
- <div class="input-box">
96
- <div class="v-fix">
97
- <select id="<?php echo $code ?>_expiration" style="width:140px;" onchange="ccHashCall();" class="required-entry">
98
- <option value=""><?php echo $this->__('Month'); ?></option>
99
- <?php foreach ($this->getCcMonths() as $k => $v): ?>
100
- <option value="<?php echo $k ?>"><?php echo $v ?></option>
101
- <?php endforeach; ?>
102
- </select>
103
- </div>
104
  <div class="v-fix" style="padding-left:5px;">
105
- <select id="<?php echo $code ?>_expiration_yr" style="width:103px;" onchange="ccHashCall();" class="required-entry">
106
- <option value=""><?php echo $this->__('Year'); ?></option>
107
- <?php foreach ($this->getCcYears() as $k => $v): ?>
108
  <option value="<?php echo $k ?>"><?php echo $v ?></option>
109
- <?php endforeach; ?>
110
- </select>
 
111
  </div>
112
  </div>
113
- </div>
114
  </li>
115
- <li class="fields">
116
  <div class="field">
117
- <label style="float:none;" for="<?php echo $code ?>_cc_cid"><?php echo $this->__('NN CVC') ?><span class="required">*</span></label><br />
118
  <div class="input-box">
119
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Card Verification Number') ?>" onkeypress="return isNumberKey(event);" class="required-entry input-text validate-cc-cvn" id="<?php echo $code ?>_cc_cid" name="payment[nn_cc_cid]" style="width:3em;" autocomplete="off" /></div>
120
  &nbsp;
121
- <a href="#"><img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>cvc_hint.png' border="0" style="margin-top:0px;" alt="CCV/CVC?" id="nn_cc_hint"></a>
122
  <img src="<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>creditcard_cvc.jpg" style="display:none;float:left;" border="0" id="nn_cvc_hover"/>
123
  </div>
124
  </div>
@@ -130,20 +133,18 @@ $billingaddres = Mage::getSingleton('checkout/session')->getQuote()->getBillingA
130
  if ($this->getCallbackConfigData() != 3):
131
  ?>
132
  <li>
133
- <div class="input-box">
134
  <label style="float:none;" for="<?php echo $code ?>_callback_tel">
135
- <?php
136
- if ($this->getCallbackConfigData() == 2):
137
- ?>
138
- <?php echo $this->__('Mobile phone number'); ?>
139
- <?php else: ?>
140
- <?php echo $this->__('Ihre Telefon- / Mobil- Nummer'); ?>
141
- <?php endif; ?>
142
- <span class="required">*</span></label><br/>
143
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" value="<?php
144
- echo $ccRefill ? $helper->_getCheckout()->getData($code)->getNnCallbackTelNovalnetCc()
145
- : '';
146
- ?>"/>
147
  </div>
148
  </li>
149
  <li>
@@ -151,10 +152,10 @@ $billingaddres = Mage::getSingleton('checkout/sessio
26
  $code = $this->getMethodCode();
27
  $helper = Mage::helper('novalnet_payment');
28
  $assignDatahelper = Mage::helper('novalnet_payment/AssignData');
29
+ $refillValues = $assignDatahelper->getCheckout()->getRefilldatavalues();
 
30
  $creditCardSecure = $this->getMethod()->getConfigData('active_cc3d');
31
+ $ccRefill = $this->getMethod()->_getConfigData('auto_refill', true);
32
+ // get quote billing address
33
+ $billingaddress = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress();
34
+ $telephoneNumber = ($this->getCallbackConfigData() == 1 && $billingaddress->getTelephone())
35
+ ? $billingaddress->getTelephone() : '' ;
36
  ?>
37
  <fieldset class="form-list" id="fieldset_<?php echo $code ?>">
38
  <!--{{{ Payment Logo -->
39
  <div>
40
  <a href="<?php echo $helper->getNovalnetUrl(); ?>" target="_new" style="text-decoration:none;float:none;">
41
  <?php foreach ($this->getCcAvailableTypes() as $typeCode => $typeName): ?>
42
+ <?php $imgpath = $helper->getNovalnetPaymentFormLogoUrl() . $typeCode . ".png"; ?>
43
+ <img style="height:20px;display:inline;" src="<?php echo $imgpath ?>" alt="<?php echo $this->getMethod()->getConfigData('title') ?>" title="<?php echo $this->getMethod()->getConfigData('title') ?>" />
44
  <?php endforeach; ?>
45
  </a>
46
  </div>
47
  <!--}}} Payment Logo -->
48
  <!--{{{ Novalnet Cc Form -->
49
+
50
+ <ul id="payment_form_<?php echo $code ?>" style="display:none;">
51
  <div class="nnccloader" id='cc_loading' style='display:none;'></div>
52
  <li>
53
+ <?php echo $this->__('The amount will be debited from your credit card once the order is submitted'); ?>
54
  </li>
55
  <?php if ($this->getUserInfo()): ?>
56
  <li>
66
  <?php endif ?>
67
  <li class="fields">
68
  <div class="field">
69
+ <label style="float:none;" for="<?php echo $code ?>_cc_type"><?php echo $this->__('NN CC type') ?><span class="required">*</span></label><br />
70
+ <div class="input-box">
71
+ <select id="<?php echo $code ?>_cc_type" onchange="cchashcall()" class="required-entry validate-cc-type-select">
72
+ <option value=""><?php echo $this->__('NN Select') ?></option>
73
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
74
+ <option value="<?php echo $_typeCode ?>"><?php echo $_typeName ?></option>
75
+ <?php endforeach; ?>
76
  </select>
77
  </div>
78
  </div>
80
  <li class="fields">
81
  <div class="field">
82
  <label style="float:none;" for="<?php echo $code ?>_cc_owner"><?php echo $this->__('NN CC holder') ?><span class="required">*</span></label><br/>
83
+ <div class="input-box">
84
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="required-entry input-text" id="<?php echo $code ?>_cc_owner" autocomplete="off" onchange="cchashcall()" value="<?php echo $billingaddress->getFirstname() . ' ' . $billingaddress->getLastname(); ?>" /></div>
85
  </div>
86
  </li>
87
+ <li class="fields">
88
+ <div class="field">
89
  <label style="float:none;" for="<?php echo $code ?>_cc_number"><?php echo $this->__('NN CC number') ?><span class="required">*</span></label><br/>
90
+ <div class="input-box">
91
+ <input type="text" id="<?php echo $code ?>_cc_number" title="<?php echo $this->__('Credit Card Number') ?>" class="required-entry input-text validate-cc-number validate-cc-type" autocomplete="off" onchange="cchashcall()" onkeypress="return isNumberKey(event,true)" value="" />
92
+ </div>
93
  </div>
94
  </li>
95
  <li class="fields">
96
+ <div class="field">
97
  <label style="float:none;" for="<?php echo $code ?>_expiration"><?php echo $this->__('NN Expiration Date') ?><span class="required">*</span></label><br />
98
+ <div class="input-box">
99
+ <div class="v-fix">
100
+ <select id="<?php echo $code ?>_expiration" style="width:140px;" onchange="cchashcall()" class="required-entry">
101
+ <option value=""><?php echo $this->__('Month'); ?></option>
102
+ <?php foreach ($this->getCcMonths() as $k => $v): ?>
103
+ <option value="<?php echo $k ?>"><?php echo $v ?></option>
104
+ <?php endforeach; ?>
105
+ </select>
106
+ </div>
107
  <div class="v-fix" style="padding-left:5px;">
108
+ <select id="<?php echo $code ?>_expiration_yr" style="width:103px;" onchange="cchashcall()" class="required-entry">
109
+ <option value=""><?php echo $this->__('Year'); ?></option>
110
+ <?php foreach ($this->getCcYears() as $k => $v): ?>
111
  <option value="<?php echo $k ?>"><?php echo $v ?></option>
112
+ <?php endforeach; ?>
113
+ </select>
114
+ </div>
115
  </div>
116
  </div>
 
117
  </li>
118
+ <li class="fields">
119
  <div class="field">
120
+ <label style="float:none;" for="<?php echo $code ?>_cc_cid"><?php echo $this->__('NN CVC') ?><span class="required"></span></label><br />
121
  <div class="input-box">
122
+ <div class="v-fix"><input style="width: 35px" type="text" title="<?php echo $this->__('Card Verification Number') ?>" onkeypress="return isNumberKey(event, false);" class="required-entry input-text validate-cc-cvn" id="<?php echo $code ?>_cc_cid" name="payment[nn_cc_cid]" style="width:3em;" autocomplete="off" /></div>
123
  &nbsp;
124
+ <a href="#"><img src='<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>cvc_hint.png' border="0" alt="CCV/CVC?" id="nn_cc_hint"></a>
125
  <img src="<?php echo $helper->getNovalnetPaymentFormLogoUrl() ?>creditcard_cvc.jpg" style="display:none;float:left;" border="0" id="nn_cvc_hover"/>
126
  </div>
127
  </div>
133
  if ($this->getCallbackConfigData() != 3):
134
  ?>
135
  <li>
136
+ <div class="input-box">
137
  <label style="float:none;" for="<?php echo $code ?>_callback_tel">
138
+ <?php
139
+ if ($this->getCallbackConfigData() == 2):
140
+ ?>
141
+ <?php echo $this->__('Mobile phone number'); ?>
142
+ <?php else: ?>
143
+ <?php echo $this->__('NN Mobile Number'); ?>
144
+ <?php endif; ?>
145
+ <span class="required">*</span></label><br/>
146
  <input type="text" autocomplete="off" id="<?php echo $code ?>_callback_tel" name="payment[callback_tel]" title="<?php echo $this->__('Callback') ?>" class="required-entry input-text validate-number" value="<?php
147
+ echo $telephoneNumber; ?>"/>
 
 
148
  </div>
149
  </li>
150
  <li>