HeidelpayCDEdition - Version 17.5.17

Version Notes

- Bugfix capture does not have reference id

Download this release

Release Info

Developer Heidelberger Payment GmbH
Extension HeidelpayCDEdition
Version 17.5.17
Comparing to
See all releases


Code changes from version 17.3.30 to 17.5.17

Files changed (271) hide show
  1. app/code/community/HeidelpayCD/Edition/Block/Abstract.php +0 -0
  2. app/code/community/HeidelpayCD/Edition/Block/Button.php +0 -0
  3. app/code/community/HeidelpayCD/Edition/Block/Form/Creditcard.php +0 -0
  4. app/code/community/HeidelpayCD/Edition/Block/Form/Debit.php +0 -0
  5. app/code/community/HeidelpayCD/Edition/Block/Form/Desconly.php +0 -0
  6. app/code/community/HeidelpayCD/Edition/Block/Form/DirectDebitSecured.php +0 -0
  7. app/code/community/HeidelpayCD/Edition/Block/Form/Eps.php +0 -0
  8. app/code/community/HeidelpayCD/Edition/Block/Form/Giropay.php +0 -9
  9. app/code/community/HeidelpayCD/Edition/Block/Form/Ideal.php +0 -0
  10. app/code/community/HeidelpayCD/Edition/Block/Form/InvoiceSecured.php +0 -0
  11. app/code/community/HeidelpayCD/Edition/Block/Form/Masterpass.php +0 -0
  12. app/code/community/HeidelpayCD/Edition/Block/Form/Postfinance.php +0 -0
  13. app/code/community/HeidelpayCD/Edition/Block/Index.php +0 -0
  14. app/code/community/HeidelpayCD/Edition/Block/Info/Debit.php +0 -18
  15. app/code/community/HeidelpayCD/Edition/Block/Info/DirectDebit.php +0 -0
  16. app/code/community/HeidelpayCD/Edition/Block/Info/Invoice.php +0 -0
  17. app/code/community/HeidelpayCD/Edition/Block/Info/Masterpass.php +0 -0
  18. app/code/community/HeidelpayCD/Edition/Block/Info/Prepayment.php +0 -0
  19. app/code/community/HeidelpayCD/Edition/Block/Onepage.php +0 -0
  20. app/code/community/HeidelpayCD/Edition/Block/Onepage/Billing.php +0 -0
  21. app/code/community/HeidelpayCD/Edition/Block/Onepage/Progress.php +0 -0
  22. app/code/community/HeidelpayCD/Edition/Block/Onepage/Shipping.php +0 -0
  23. app/code/community/HeidelpayCD/Edition/Block/Response.php +0 -0
  24. app/code/community/HeidelpayCD/Edition/Block/Success.php +0 -0
  25. app/code/community/HeidelpayCD/Edition/CHANGELOG.md +33 -0
  26. app/code/community/HeidelpayCD/Edition/Edition/Block/Abstract.php +37 -0
  27. app/code/community/HeidelpayCD/Edition/Edition/Block/Button.php +19 -0
  28. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Creditcard.php +24 -0
  29. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Debit.php +24 -0
  30. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Desconly.php +24 -0
  31. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/DirectDebitSecured.php +24 -0
  32. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Eps.php +24 -0
  33. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Ideal.php +24 -0
  34. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/InvoiceSecured.php +24 -0
  35. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Masterpass.php +24 -0
  36. app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Postfinance.php +24 -0
  37. app/code/community/HeidelpayCD/Edition/Edition/Block/Index.php +24 -0
  38. app/code/community/HeidelpayCD/Edition/Edition/Block/Info/DirectDebit.php +24 -0
  39. app/code/community/HeidelpayCD/Edition/Edition/Block/Info/Invoice.php +24 -0
  40. app/code/community/HeidelpayCD/Edition/Edition/Block/Info/Masterpass.php +27 -0
  41. app/code/community/HeidelpayCD/Edition/Edition/Block/Info/Prepayment.php +24 -0
  42. app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage.php +49 -0
  43. app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage/Billing.php +52 -0
  44. app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage/Progress.php +104 -0
  45. app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage/Shipping.php +51 -0
  46. app/code/community/HeidelpayCD/Edition/Edition/Block/Response.php +19 -0
  47. app/code/community/HeidelpayCD/Edition/Edition/Block/Success.php +38 -0
  48. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Abstract.php +37 -0
  49. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Button.php +19 -0
  50. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Creditcard.php +24 -0
  51. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Debit.php +24 -0
  52. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Desconly.php +24 -0
  53. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/DirectDebitSecured.php +24 -0
  54. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Eps.php +24 -0
  55. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Ideal.php +24 -0
  56. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/InvoiceSecured.php +24 -0
  57. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Masterpass.php +24 -0
  58. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Postfinance.php +24 -0
  59. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Index.php +24 -0
  60. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/DirectDebit.php +24 -0
  61. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/Invoice.php +24 -0
  62. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/Masterpass.php +27 -0
  63. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/Prepayment.php +24 -0
  64. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage.php +49 -0
  65. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage/Billing.php +52 -0
  66. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage/Progress.php +104 -0
  67. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage/Shipping.php +51 -0
  68. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Response.php +19 -0
  69. app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Success.php +38 -0
  70. app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/AbstractHelper.php +98 -0
  71. app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/BasketApi.php +136 -0
  72. app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/Data.php +19 -0
  73. app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/OrderState.php +105 -0
  74. app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/Payment.php +309 -0
  75. app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/Validator.php +41 -0
  76. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Customer.php +24 -0
  77. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Customer.php +23 -0
  78. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Customer/Collection.php +24 -0
  79. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Transaction.php +23 -0
  80. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Transaction/Collection.php +24 -0
  81. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Observer.php +196 -0
  82. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Order/Pdf/Invoice.php +21 -0
  83. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Abstract.php +1138 -0
  84. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/AbstractSecuredPaymentMethods.php +325 -0
  85. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/HcdDirectDebitSecured.php +105 -0
  86. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/HcdInvoiceSecured.php +35 -0
  87. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdbs.php +174 -0
  88. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdcc.php +76 -0
  89. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcddc.php +67 -0
  90. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcddd.php +86 -0
  91. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdeps.php +55 -0
  92. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdgp.php +22 -0
  93. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdide.php +60 -0
  94. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdiv.php +60 -0
  95. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdmk.php +34 -0
  96. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdmpa.php +142 -0
  97. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdpal.php +65 -0
  98. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdpf.php +56 -0
  99. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdpp.php +183 -0
  100. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdsu.php +33 -0
  101. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdyt.php +24 -0
  102. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Resource/Encryption.php +39 -0
  103. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Resource/Setup.php +19 -0
  104. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/System/Config/Source/Bookingmode.php +31 -0
  105. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/System/Config/Source/Recognition.php +32 -0
  106. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/System/Config/Source/Returnurl.php +31 -0
  107. app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Transaction.php +130 -0
  108. app/code/community/HeidelpayCD/Edition/Edition/Edition/controllers/CheckoutController.php +288 -0
  109. app/code/community/HeidelpayCD/Edition/Edition/Edition/controllers/IndexController.php +664 -0
  110. app/code/community/HeidelpayCD/Edition/Edition/Edition/controllers/ResponseController.php +274 -0
  111. app/code/community/HeidelpayCD/Edition/Edition/Edition/etc/config.xml +370 -0
  112. app/code/community/HeidelpayCD/Edition/Edition/Edition/etc/system.xml +1539 -0
  113. app/code/community/HeidelpayCD/Edition/Edition/Edition/sql/hcd_setup/install-15.1.30.php +188 -0
  114. app/code/community/HeidelpayCD/Edition/Edition/Helper/AbstractHelper.php +98 -0
  115. app/code/community/HeidelpayCD/Edition/Edition/Helper/BasketApi.php +136 -0
  116. app/code/community/HeidelpayCD/Edition/Edition/Helper/Data.php +19 -0
  117. app/code/community/HeidelpayCD/Edition/Edition/Helper/OrderState.php +105 -0
  118. app/code/community/HeidelpayCD/Edition/Edition/Helper/Payment.php +309 -0
  119. app/code/community/HeidelpayCD/Edition/Edition/Helper/Validator.php +41 -0
  120. app/code/community/HeidelpayCD/Edition/Edition/Model/Customer.php +24 -0
  121. app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Customer.php +23 -0
  122. app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Customer/Collection.php +24 -0
  123. app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Transaction.php +23 -0
  124. app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Transaction/Collection.php +24 -0
  125. app/code/community/HeidelpayCD/Edition/Edition/Model/Observer.php +196 -0
  126. app/code/community/HeidelpayCD/Edition/Edition/Model/Order/Pdf/Invoice.php +21 -0
  127. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Abstract.php +1138 -0
  128. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/AbstractSecuredPaymentMethods.php +325 -0
  129. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/HcdDirectDebitSecured.php +105 -0
  130. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/HcdInvoiceSecured.php +35 -0
  131. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdbs.php +174 -0
  132. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdcc.php +76 -0
  133. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcddc.php +67 -0
  134. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcddd.php +86 -0
  135. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdeps.php +55 -0
  136. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdgp.php +22 -0
  137. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdide.php +60 -0
  138. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdiv.php +60 -0
  139. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdmk.php +34 -0
  140. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdmpa.php +142 -0
  141. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdpal.php +65 -0
  142. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdpf.php +56 -0
  143. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdpp.php +183 -0
  144. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdsu.php +33 -0
  145. app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdyt.php +24 -0
  146. app/code/community/HeidelpayCD/Edition/Edition/Model/Resource/Encryption.php +39 -0
  147. app/code/community/HeidelpayCD/Edition/Edition/Model/Resource/Setup.php +19 -0
  148. app/code/community/HeidelpayCD/Edition/Edition/Model/System/Config/Source/Bookingmode.php +31 -0
  149. app/code/community/HeidelpayCD/Edition/Edition/Model/System/Config/Source/Recognition.php +32 -0
  150. app/code/community/HeidelpayCD/Edition/Edition/Model/System/Config/Source/Returnurl.php +31 -0
  151. app/code/community/HeidelpayCD/Edition/Edition/Model/Transaction.php +130 -0
  152. app/code/community/HeidelpayCD/Edition/Edition/controllers/CheckoutController.php +288 -0
  153. app/code/community/HeidelpayCD/Edition/Edition/controllers/IndexController.php +664 -0
  154. app/code/community/HeidelpayCD/Edition/Edition/controllers/ResponseController.php +274 -0
  155. app/code/community/HeidelpayCD/Edition/Edition/etc/config.xml +370 -0
  156. app/code/community/HeidelpayCD/Edition/Edition/etc/system.xml +1539 -0
  157. app/code/community/HeidelpayCD/Edition/Edition/sql/hcd_setup/install-15.1.30.php +188 -0
  158. app/code/community/HeidelpayCD/Edition/Helper/AbstractHelper.php +0 -0
  159. app/code/community/HeidelpayCD/Edition/Helper/BasketApi.php +0 -0
  160. app/code/community/HeidelpayCD/Edition/Helper/Data.php +0 -0
  161. app/code/community/HeidelpayCD/Edition/Helper/OrderState.php +0 -0
  162. app/code/community/HeidelpayCD/Edition/Helper/Payment.php +0 -0
  163. app/code/community/HeidelpayCD/Edition/Helper/Validator.php +0 -0
  164. app/code/community/HeidelpayCD/Edition/LICENSE.txt +170 -0
  165. app/code/community/HeidelpayCD/Edition/Model/Customer.php +0 -0
  166. app/code/community/HeidelpayCD/Edition/Model/Mysql4/Customer.php +0 -0
  167. app/code/community/HeidelpayCD/Edition/Model/Mysql4/Customer/Collection.php +0 -0
  168. app/code/community/HeidelpayCD/Edition/Model/Mysql4/Transaction.php +0 -0
  169. app/code/community/HeidelpayCD/Edition/Model/Mysql4/Transaction/Collection.php +0 -0
  170. app/code/community/HeidelpayCD/Edition/Model/Observer.php +0 -0
  171. app/code/community/HeidelpayCD/Edition/Model/Order/Pdf/Invoice.php +0 -0
  172. app/code/community/HeidelpayCD/Edition/Model/Payment/Abstract.php +2 -3
  173. app/code/community/HeidelpayCD/Edition/Model/Payment/AbstractSecuredPaymentMethods.php +0 -0
  174. app/code/community/HeidelpayCD/Edition/Model/Payment/HcdDirectDebitSecured.php +0 -0
  175. app/code/community/HeidelpayCD/Edition/Model/Payment/HcdInvoiceSecured.php +0 -0
  176. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdbs.php +0 -0
  177. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdcc.php +0 -0
  178. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcddc.php +0 -0
  179. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcddd.php +0 -0
  180. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdeps.php +0 -0
  181. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdgp.php +0 -0
  182. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdide.php +0 -0
  183. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdiv.php +0 -0
  184. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdmk.php +0 -0
  185. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdmpa.php +0 -0
  186. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpal.php +0 -0
  187. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpf.php +0 -0
  188. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpp.php +0 -0
  189. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdsu.php +0 -0
  190. app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdyt.php +0 -0
  191. app/code/community/HeidelpayCD/Edition/Model/Resource/Encryption.php +0 -0
  192. app/code/community/HeidelpayCD/Edition/Model/Resource/Setup.php +0 -0
  193. app/code/community/HeidelpayCD/Edition/Model/System/Config/Source/Bookingmode.php +0 -0
  194. app/code/community/HeidelpayCD/Edition/Model/System/Config/Source/Recognition.php +0 -0
  195. app/code/community/HeidelpayCD/Edition/Model/System/Config/Source/Returnurl.php +0 -0
  196. app/code/community/HeidelpayCD/Edition/Model/Transaction.php +0 -0
  197. app/code/community/HeidelpayCD/Edition/README.md +38 -0
  198. app/code/community/HeidelpayCD/Edition/controllers/CheckoutController.php +0 -0
  199. app/code/community/HeidelpayCD/Edition/controllers/IndexController.php +0 -0
  200. app/code/community/HeidelpayCD/Edition/controllers/ResponseController.php +0 -0
  201. app/code/community/HeidelpayCD/Edition/etc/config.xml +1 -1
  202. app/code/community/HeidelpayCD/Edition/etc/system.xml +0 -0
  203. app/code/community/HeidelpayCD/Edition/sql/hcd_setup/install-15.1.30.php +0 -0
  204. app/design/adminhtml/base/default/template/hcd/info/info/pdf/directdebit.phtml +40 -0
  205. app/design/adminhtml/base/default/template/hcd/info/info/pdf/invoice.phtml +41 -0
  206. app/design/adminhtml/base/default/template/hcd/info/info/pdf/prepayment.phtml +40 -0
  207. app/design/adminhtml/base/default/template/hcd/info/pdf/directdebit.phtml +0 -0
  208. app/design/adminhtml/base/default/template/hcd/info/pdf/invoice.phtml +0 -0
  209. app/design/adminhtml/base/default/template/hcd/info/pdf/prepayment.phtml +0 -0
  210. app/design/adminhtml/default/default/template/hcd/Info/Info/masterpass.phtml +22 -0
  211. app/design/adminhtml/default/default/template/hcd/Info/masterpass.phtml +0 -0
  212. app/design/adminhtml/default/default/template/hcd/Info/pdf/invoice.phtml +0 -27
  213. app/design/frontend/base/default/layout/hcd.xml +0 -0
  214. app/design/frontend/base/default/template/hcd/Info/Info/debit.phtml +23 -0
  215. app/design/frontend/base/default/template/hcd/Info/Info/masterpass.phtml +23 -0
  216. app/design/frontend/base/default/template/hcd/Info/debit.phtml +0 -0
  217. app/design/frontend/base/default/template/hcd/Info/masterpass.phtml +0 -0
  218. app/design/frontend/base/default/template/hcd/button.phtml +0 -0
  219. app/design/frontend/base/default/template/hcd/form/creditcard.phtml +0 -0
  220. app/design/frontend/base/default/template/hcd/form/debit.phtml +0 -0
  221. app/design/frontend/base/default/template/hcd/form/desconly.phtml +0 -0
  222. app/design/frontend/base/default/template/hcd/form/direct-debit-secured.phtml +0 -0
  223. app/design/frontend/base/default/template/hcd/form/eps.phtml +0 -0
  224. app/design/frontend/base/default/template/hcd/form/form/creditcard.phtml +96 -0
  225. app/design/frontend/base/default/template/hcd/form/form/debit.phtml +73 -0
  226. app/design/frontend/base/default/template/hcd/form/form/desconly.phtml +22 -0
  227. app/design/frontend/base/default/template/hcd/form/form/direct-debit-secured.phtml +147 -0
  228. app/design/frontend/base/default/template/hcd/form/form/eps.phtml +60 -0
  229. app/design/frontend/base/default/template/hcd/form/form/ideal.phtml +60 -0
  230. app/design/frontend/base/default/template/hcd/form/form/invoice-secured.phtml +118 -0
  231. app/design/frontend/base/default/template/hcd/form/form/masterpass.phtml +56 -0
  232. app/design/frontend/base/default/template/hcd/form/form/postfinance.phtml +40 -0
  233. app/design/frontend/base/default/template/hcd/form/giropay.phtml +0 -45
  234. app/design/frontend/base/default/template/hcd/form/ideal.phtml +0 -0
  235. app/design/frontend/base/default/template/hcd/form/invoice-secured.phtml +0 -0
  236. app/design/frontend/base/default/template/hcd/form/masterpass.phtml +0 -0
  237. app/design/frontend/base/default/template/hcd/form/postfinance.phtml +0 -0
  238. app/design/frontend/base/default/template/hcd/index.phtml +0 -0
  239. app/design/frontend/base/default/template/hcd/mail/hcd_payment_info.phtml +0 -0
  240. app/design/frontend/base/default/template/hcd/mail/mail/hcd_payment_info.phtml +16 -0
  241. app/design/frontend/base/default/template/hcd/onepage.phtml +0 -0
  242. app/design/frontend/base/default/template/hcd/onepage/billing.phtml +0 -0
  243. app/design/frontend/base/default/template/hcd/onepage/onepage/billing.phtml +168 -0
  244. app/design/frontend/base/default/template/hcd/onepage/onepage/payment.phtml +47 -0
  245. app/design/frontend/base/default/template/hcd/onepage/onepage/payment/methods.phtml +75 -0
  246. app/design/frontend/base/default/template/hcd/onepage/onepage/progress.phtml +33 -0
  247. app/design/frontend/base/default/template/hcd/onepage/onepage/progress/payment.phtml +51 -0
  248. app/design/frontend/base/default/template/hcd/onepage/onepage/progress/shipping.phtml +44 -0
  249. app/design/frontend/base/default/template/hcd/onepage/onepage/shipping_method.phtml +20 -0
  250. app/design/frontend/base/default/template/hcd/onepage/payment.phtml +0 -0
  251. app/design/frontend/base/default/template/hcd/onepage/payment/methods.phtml +0 -0
  252. app/design/frontend/base/default/template/hcd/onepage/progress.phtml +0 -0
  253. app/design/frontend/base/default/template/hcd/onepage/progress/payment.phtml +0 -0
  254. app/design/frontend/base/default/template/hcd/onepage/progress/shipping.phtml +0 -0
  255. app/design/frontend/base/default/template/hcd/onepage/shipping_method.phtml +0 -0
  256. app/design/frontend/base/default/template/hcd/response.phtml +0 -0
  257. app/design/frontend/base/default/template/hcd/success.phtml +0 -0
  258. app/etc/modules/HeidelpayCD_Edition.xml +0 -0
  259. app/locale/de_DE/HeidelpayCD_Edition.csv +0 -0
  260. app/locale/en_US/HeidelpayCD_Edition.csv +0 -0
  261. js/hcd/heidelpaycd.js +0 -0
  262. js/hcd/heidelpaypci3.js +0 -0
  263. js/hcd/opcheckout.js +0 -0
  264. package.xml +6 -9
  265. skin/adminhtml/base/default/images/hcd/masterpass_100_28.jpg +0 -0
  266. skin/frontend/base/default/css/hcdcc_payment_frame.css +0 -0
  267. skin/frontend/base/default/css/hcddc_payment_frame.css +0 -0
  268. skin/frontend/base/default/css/heidelpaycd.css +0 -0
  269. skin/frontend/base/default/images/hcd/loading.gif +0 -0
  270. skin/frontend/base/default/images/hcd/masterpass_100_28.jpg +0 -0
  271. skin/frontend/base/default/images/hcd/masterpass_240_66.jpg +0 -0
app/code/community/HeidelpayCD/Edition/Block/Abstract.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Button.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Creditcard.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Debit.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Desconly.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/DirectDebitSecured.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Eps.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Giropay.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class HeidelpayCD_Edition_Block_Form_Giropay extends Mage_Payment_Block_Form
3
- {
4
- protected function _construct()
5
- {
6
- parent::_construct();
7
- $this->setTemplate('hcd/form/giropay.phtml');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/HeidelpayCD/Edition/Block/Form/Ideal.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/InvoiceSecured.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Masterpass.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Form/Postfinance.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Index.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Info/Debit.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- class HeidelpayCD_Edition_Block_Info_Debit extends Mage_Payment_Block_Info
3
- {
4
- protected function _prepareSpecificInformation($transport = null)
5
- {
6
- /*
7
- $session = $this->getSession();
8
- $transport = new Varien_Object();
9
- $transport = parent::_prepareSpecificInformation($transport);
10
- $transport->addData(array(
11
- Mage::helper('hcd')->__('IBAN') => print_r($session,1)."48534958",
12
- Mage::helper('hcd')->__('BIC') => "48534958",
13
- Mage::helper('hcd')->__('Owner') => "123456"
14
- ));
15
- return $transport;
16
- */
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/HeidelpayCD/Edition/Block/Info/DirectDebit.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Info/Invoice.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Info/Masterpass.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Info/Prepayment.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Onepage.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Onepage/Billing.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Onepage/Progress.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Onepage/Shipping.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Response.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Block/Success.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/CHANGELOG.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Release Notes - heidelpay extension for Magento 1
2
+
3
+ ## v17.5.17
4
+
5
+ ### Fixed
6
+ - online capture failed because of missing reference id
7
+
8
+ ## v17.3.30
9
+
10
+ ### Added
11
+ - new payment method invoice secured
12
+ - new payment method direct debit secured
13
+ - add doc blocks to file and functions
14
+ #### prepayment, invoice and invoice secured
15
+ - add payment information to pdf template for invoice and prepayment
16
+ #### direct debit and direct debit secured
17
+ - add creditor identifier and mandate reference ID to pdf invoice
18
+
19
+ ### Changed
20
+ - enforce code style and magento marketplace standard
21
+ - move response action into a response controller
22
+ #### giropay
23
+ - input fields for iban and bic in store front are not longer required
24
+ ### invoice
25
+ - the magento invoice will now be generated automatically, but is set to not paid
26
+ ### Fixed
27
+
28
+ ### Removed
29
+ - remove insurance provider option from direct debit and invoice payment method. Please use the new payment methods instead.
30
+ - payment method yapital is not longer available. The model will not be removed because of backwards capability.
31
+ - payment method MangirKart is not longer available. The model will not be removed because of backwards capability.
32
+ ### direct debit
33
+ - bic is not longer necessary for the 23 SEPA countries
app/code/community/HeidelpayCD/Edition/Edition/Block/Abstract.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Abstract block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Abstract extends Mage_Core_Block_Template
18
+ {
19
+ public function getSession()
20
+ {
21
+ return Mage::getSingleton('core/session');
22
+ }
23
+
24
+ public function getCheckout()
25
+ {
26
+ return Mage::getSingleton('checkout/session');
27
+ }
28
+
29
+ public function getCurrentOrder()
30
+ {
31
+ $order = Mage::getModel('sales/order');
32
+ $session = $this->getCheckout();
33
+ $order->loadByIncrementId($session->getLastRealOrderId());
34
+
35
+ return $order;
36
+ }
37
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Button.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Button block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Button extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Creditcard.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Credit card block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Creditcard extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/creditcard.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Debit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Debit extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/debit.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Desconly.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Description only block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warnina
17
+ class HeidelpayCD_Edition_Block_Form_Desconly extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/desconly.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/DirectDebitSecured.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_DirectDebitSecured extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/direct-debit-secured.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Eps.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Eps block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Eps extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/eps.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Ideal.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDeal block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Ideal extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/ideal.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/InvoiceSecured.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice secured form block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_InvoiceSecured extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/invoice-secured.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Masterpass.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Masterpass extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/masterpass.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Form/Postfinance.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Postfinance block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Postfinance extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/postfinance.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Index.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Index block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Index extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ public function getHcdHolder()
20
+ {
21
+ $order = $this->getCurrentOrder();
22
+ return $order->getBillingAddress()->getFirstname().' '.$order->getBillingAddress()->getLastname();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Info/DirectDebit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_DirectDebit extends Mage_Payment_Block_Info
18
+ {
19
+ public function toPdf()
20
+ {
21
+ $this->setTemplate('hcd/info/pdf/directdebit.phtml');
22
+ return $this->toHtml();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Info/Invoice.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_Invoice extends Mage_Payment_Block_Info
18
+ {
19
+ public function toPdf()
20
+ {
21
+ $this->setTemplate('hcd/info/pdf/invoice.phtml');
22
+ return $this->toHtml();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Info/Masterpass.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_Masterpass extends Mage_Payment_Block_Info
18
+ {
19
+ /**
20
+ * Init default template for block
21
+ */
22
+ protected function _construct()
23
+ {
24
+ parent::_construct();
25
+ $this->setTemplate('hcd/info/masterpass.phtml');
26
+ }
27
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Info/Prepayment.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_Prepayment extends Mage_Payment_Block_Info
18
+ {
19
+ public function toPdf()
20
+ {
21
+ $this->setTemplate('hcd/info/pdf/prepayment.phtml');
22
+ return $this->toHtml();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage extends Mage_Checkout_Block_Onepage
18
+ {
19
+ /**
20
+ * Get 'one step checkout' step data
21
+ *
22
+ * @return array
23
+ */
24
+ public function getSteps()
25
+ {
26
+ $steps = array();
27
+ $stepCodes = $this->_getStepCodes();
28
+
29
+ if ($this->isCustomerLoggedIn()) {
30
+ $stepCodes = array_diff($stepCodes, array('login'));
31
+ }
32
+
33
+ foreach ($stepCodes as $step) {
34
+ $steps[$step] = $this->getCheckout()->getStepData($step);
35
+ }
36
+
37
+ return $steps;
38
+ }
39
+
40
+ /**
41
+ * Get active step
42
+ *
43
+ * @return string
44
+ */
45
+ public function getActiveStep()
46
+ {
47
+ return $this->isCustomerLoggedIn() ? 'billing' : 'billing';
48
+ }
49
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage/Billing.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage billing block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage_Billing extends Mage_Checkout_Block_Onepage_Billing
18
+ {
19
+ public function getAddress()
20
+ {
21
+ $hcdWallet = Mage::getSingleton('checkout/session')->getHcdWallet();
22
+ if (!empty($hcdWallet)) {
23
+ $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
24
+ $this->_address = Mage::getModel('sales/quote_address')->setAddressType(
25
+ Mage_Sales_Model_Quote_Address::TYPE_BILLING
26
+ )
27
+ ->setStoreId(Mage::app()->getStore()->getId())
28
+ ->setFirstname($wallet['adress']['firstname'])
29
+ ->setLastname($wallet['adress']['lastname'])
30
+ ->setEmail($wallet['adress']['email'])
31
+ ->setSuffix((''))
32
+ ->setCompany('')
33
+ ->setStreet(
34
+ array(
35
+ '0' => $wallet['adress']['street'][0],
36
+ '1' => $wallet['adress']['street'][1]
37
+ )
38
+ )
39
+ ->setCity($wallet['adress']['city'])
40
+ ->setPostcode($wallet['adress']['postcode'])
41
+ ->setCountry_id($wallet['adress']['country_id'])
42
+ ->setRegion($wallet['adress']['region'])
43
+ ->setRegion_id((string)$wallet['adress']['region_id'])
44
+ ->setTelephone($wallet['adress']['telephone'])
45
+ ->setFax();
46
+
47
+ return $this->_address;
48
+ } else {
49
+ return parent::getAddress();
50
+ }
51
+ }
52
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage/Progress.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage progress block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage_Progress extends Mage_Checkout_Block_Onepage_Progress
18
+ {
19
+ public function getBilling()
20
+ {
21
+ Mage::log(' getBillingAddress '.$this->getQuote()->getBillingAddress());
22
+ return $this->getQuote()->getBillingAddress();
23
+ }
24
+
25
+ public function getShipping()
26
+ {
27
+ return $this->getQuote()->getShippingAddress();
28
+ }
29
+
30
+ public function getShippingMethod()
31
+ {
32
+ return $this->getQuote()->getShippingAddress()->getShippingMethod();
33
+ }
34
+
35
+ public function getShippingDescription()
36
+ {
37
+ return $this->getQuote()->getShippingAddress()->getShippingDescription();
38
+ }
39
+
40
+ public function getShippingAmount()
41
+ {
42
+ return $this->getQuote()->getShippingAddress()->getShippingAmount();
43
+ }
44
+
45
+ public function getPaymentHtml()
46
+ {
47
+ return $this->getChildHtml('payment_info');
48
+ }
49
+
50
+ /**
51
+ * Get is step completed.
52
+ * if is set 'toStep' then all steps after him is not completed.
53
+ *
54
+ * @param string $currentStep
55
+ *
56
+ * @see : Mage_Checkout_Block_Onepage_Abstract::_getStepCodes() for allowed values
57
+ *
58
+ * @return bool
59
+ */
60
+ public function isStepComplete($currentStep)
61
+ {
62
+ $autho = Mage::getSingleton('core/session');
63
+
64
+ if (!empty(Mage::getSingleton('checkout/session')->getHcdWallet())) {
65
+ Mage::log('isStepComplete yes');
66
+ return true;
67
+ } else {
68
+ $stepsRevertIndex = array_flip($this->_getStepCodes());
69
+
70
+ $toStep = $this->getRequest()->getParam('toStep');
71
+
72
+ if (empty($toStep) || !isset($stepsRevertIndex[$currentStep])) {
73
+ return $this->getCheckout()->getStepData($currentStep, 'complete');
74
+ }
75
+
76
+ if ($stepsRevertIndex[$currentStep] > $stepsRevertIndex[$toStep]) {
77
+ return false;
78
+ }
79
+
80
+ return $this->getCheckout()->getStepData($currentStep, 'complete');
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Get quote shipping price including tax
86
+ *
87
+ * @return float
88
+ */
89
+ public function getShippingPriceInclTax()
90
+ {
91
+ $inclTax = $this->getQuote()->getShippingAddress()->getShippingInclTax();
92
+ return $this->formatPrice($inclTax);
93
+ }
94
+
95
+ public function getShippingPriceExclTax()
96
+ {
97
+ return $this->formatPrice($this->getQuote()->getShippingAddress()->getShippingAmount());
98
+ }
99
+
100
+ public function formatPrice($price)
101
+ {
102
+ return $this->getQuote()->getStore()->formatPrice($price);
103
+ }
104
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Onepage/Shipping.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage shipping block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage_Shipping extends Mage_Checkout_Block_Onepage_Shipping
18
+ {
19
+ public function getAddress()
20
+ {
21
+ if (!empty(Mage::getSingleton('checkout/session')->getHcdWallet())) {
22
+ $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
23
+ $this->_address = Mage::getModel('sales/quote_address')->setAddressType(
24
+ Mage_Sales_Model_Quote_Address::TYPE_BILLING
25
+ )
26
+ ->setStoreId(Mage::app()->getStore()->getId())
27
+ ->setFirstname($wallet['adress']['firstname'])
28
+ ->setLastname($wallet['adress']['lastname'])
29
+ ->setEmail($wallet['adress']['email'])
30
+ ->setSuffix((''))
31
+ ->setCompany('')
32
+ ->setStreet(
33
+ array(
34
+ '0' => $wallet['adress']['street'][0],
35
+ '1' => $wallet['adress']['street'][1]
36
+ )
37
+ )
38
+ ->setCity($wallet['adress']['city'])
39
+ ->setPostcode($wallet['adress']['postcode'])
40
+ ->setCountry_id($wallet['adress']['country_id'])
41
+ ->setRegion($wallet['adress']['region'])
42
+ ->setRegion_id((string)$wallet['adress']['region_id'])
43
+ ->setTelephone($wallet['adress']['telephone'])
44
+ ->setFax();
45
+
46
+ return $this->_address;
47
+ } else {
48
+ return parent::getAddress();
49
+ }
50
+ }
51
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Response.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Index block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Response extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Block/Success.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Success block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Success extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ public function showPaymentInfo()
20
+ {
21
+ $return = array();
22
+ $order = $this->getCurrentOrder();
23
+ $session = $this->getCheckout();
24
+
25
+ $info = ($session->getHcdPaymentInfo() !== false) ? $session->getHcdPaymentInfo() : false;
26
+
27
+ if (!empty($info)) {
28
+ $return['Title'] = $order->getPayment()->getMethodInstance()->getTitle();
29
+ $return['Message'] = $session->getHcdPaymentInfo();
30
+
31
+ $session->unsHcdPaymentInfo();
32
+
33
+ return $return;
34
+ }
35
+
36
+ return false;
37
+ }
38
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Abstract.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Abstract block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Abstract extends Mage_Core_Block_Template
18
+ {
19
+ public function getSession()
20
+ {
21
+ return Mage::getSingleton('core/session');
22
+ }
23
+
24
+ public function getCheckout()
25
+ {
26
+ return Mage::getSingleton('checkout/session');
27
+ }
28
+
29
+ public function getCurrentOrder()
30
+ {
31
+ $order = Mage::getModel('sales/order');
32
+ $session = $this->getCheckout();
33
+ $order->loadByIncrementId($session->getLastRealOrderId());
34
+
35
+ return $order;
36
+ }
37
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Button.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Button block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Button extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Creditcard.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Credit card block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Creditcard extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/creditcard.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Debit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Debit extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/debit.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Desconly.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Description only block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warnina
17
+ class HeidelpayCD_Edition_Block_Form_Desconly extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/desconly.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/DirectDebitSecured.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_DirectDebitSecured extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/direct-debit-secured.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Eps.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Eps block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Eps extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/eps.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Ideal.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * IDeal block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Ideal extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/ideal.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/InvoiceSecured.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice secured form block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_InvoiceSecured extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/invoice-secured.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Masterpass.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Masterpass extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/masterpass.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Form/Postfinance.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Postfinance block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Form_Postfinance extends Mage_Payment_Block_Form
18
+ {
19
+ protected function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->setTemplate('hcd/form/postfinance.phtml');
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Index.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Index block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Index extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ public function getHcdHolder()
20
+ {
21
+ $order = $this->getCurrentOrder();
22
+ return $order->getBillingAddress()->getFirstname().' '.$order->getBillingAddress()->getLastname();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/DirectDebit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_DirectDebit extends Mage_Payment_Block_Info
18
+ {
19
+ public function toPdf()
20
+ {
21
+ $this->setTemplate('hcd/info/pdf/directdebit.phtml');
22
+ return $this->toHtml();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/Invoice.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_Invoice extends Mage_Payment_Block_Info
18
+ {
19
+ public function toPdf()
20
+ {
21
+ $this->setTemplate('hcd/info/pdf/invoice.phtml');
22
+ return $this->toHtml();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/Masterpass.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_Masterpass extends Mage_Payment_Block_Info
18
+ {
19
+ /**
20
+ * Init default template for block
21
+ */
22
+ protected function _construct()
23
+ {
24
+ parent::_construct();
25
+ $this->setTemplate('hcd/info/masterpass.phtml');
26
+ }
27
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Info/Prepayment.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice info block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Info_Prepayment extends Mage_Payment_Block_Info
18
+ {
19
+ public function toPdf()
20
+ {
21
+ $this->setTemplate('hcd/info/pdf/prepayment.phtml');
22
+ return $this->toHtml();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage extends Mage_Checkout_Block_Onepage
18
+ {
19
+ /**
20
+ * Get 'one step checkout' step data
21
+ *
22
+ * @return array
23
+ */
24
+ public function getSteps()
25
+ {
26
+ $steps = array();
27
+ $stepCodes = $this->_getStepCodes();
28
+
29
+ if ($this->isCustomerLoggedIn()) {
30
+ $stepCodes = array_diff($stepCodes, array('login'));
31
+ }
32
+
33
+ foreach ($stepCodes as $step) {
34
+ $steps[$step] = $this->getCheckout()->getStepData($step);
35
+ }
36
+
37
+ return $steps;
38
+ }
39
+
40
+ /**
41
+ * Get active step
42
+ *
43
+ * @return string
44
+ */
45
+ public function getActiveStep()
46
+ {
47
+ return $this->isCustomerLoggedIn() ? 'billing' : 'billing';
48
+ }
49
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage/Billing.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage billing block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage_Billing extends Mage_Checkout_Block_Onepage_Billing
18
+ {
19
+ public function getAddress()
20
+ {
21
+ $hcdWallet = Mage::getSingleton('checkout/session')->getHcdWallet();
22
+ if (!empty($hcdWallet)) {
23
+ $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
24
+ $this->_address = Mage::getModel('sales/quote_address')->setAddressType(
25
+ Mage_Sales_Model_Quote_Address::TYPE_BILLING
26
+ )
27
+ ->setStoreId(Mage::app()->getStore()->getId())
28
+ ->setFirstname($wallet['adress']['firstname'])
29
+ ->setLastname($wallet['adress']['lastname'])
30
+ ->setEmail($wallet['adress']['email'])
31
+ ->setSuffix((''))
32
+ ->setCompany('')
33
+ ->setStreet(
34
+ array(
35
+ '0' => $wallet['adress']['street'][0],
36
+ '1' => $wallet['adress']['street'][1]
37
+ )
38
+ )
39
+ ->setCity($wallet['adress']['city'])
40
+ ->setPostcode($wallet['adress']['postcode'])
41
+ ->setCountry_id($wallet['adress']['country_id'])
42
+ ->setRegion($wallet['adress']['region'])
43
+ ->setRegion_id((string)$wallet['adress']['region_id'])
44
+ ->setTelephone($wallet['adress']['telephone'])
45
+ ->setFax();
46
+
47
+ return $this->_address;
48
+ } else {
49
+ return parent::getAddress();
50
+ }
51
+ }
52
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage/Progress.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage progress block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage_Progress extends Mage_Checkout_Block_Onepage_Progress
18
+ {
19
+ public function getBilling()
20
+ {
21
+ Mage::log(' getBillingAddress '.$this->getQuote()->getBillingAddress());
22
+ return $this->getQuote()->getBillingAddress();
23
+ }
24
+
25
+ public function getShipping()
26
+ {
27
+ return $this->getQuote()->getShippingAddress();
28
+ }
29
+
30
+ public function getShippingMethod()
31
+ {
32
+ return $this->getQuote()->getShippingAddress()->getShippingMethod();
33
+ }
34
+
35
+ public function getShippingDescription()
36
+ {
37
+ return $this->getQuote()->getShippingAddress()->getShippingDescription();
38
+ }
39
+
40
+ public function getShippingAmount()
41
+ {
42
+ return $this->getQuote()->getShippingAddress()->getShippingAmount();
43
+ }
44
+
45
+ public function getPaymentHtml()
46
+ {
47
+ return $this->getChildHtml('payment_info');
48
+ }
49
+
50
+ /**
51
+ * Get is step completed.
52
+ * if is set 'toStep' then all steps after him is not completed.
53
+ *
54
+ * @param string $currentStep
55
+ *
56
+ * @see : Mage_Checkout_Block_Onepage_Abstract::_getStepCodes() for allowed values
57
+ *
58
+ * @return bool
59
+ */
60
+ public function isStepComplete($currentStep)
61
+ {
62
+ $autho = Mage::getSingleton('core/session');
63
+
64
+ if (!empty(Mage::getSingleton('checkout/session')->getHcdWallet())) {
65
+ Mage::log('isStepComplete yes');
66
+ return true;
67
+ } else {
68
+ $stepsRevertIndex = array_flip($this->_getStepCodes());
69
+
70
+ $toStep = $this->getRequest()->getParam('toStep');
71
+
72
+ if (empty($toStep) || !isset($stepsRevertIndex[$currentStep])) {
73
+ return $this->getCheckout()->getStepData($currentStep, 'complete');
74
+ }
75
+
76
+ if ($stepsRevertIndex[$currentStep] > $stepsRevertIndex[$toStep]) {
77
+ return false;
78
+ }
79
+
80
+ return $this->getCheckout()->getStepData($currentStep, 'complete');
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Get quote shipping price including tax
86
+ *
87
+ * @return float
88
+ */
89
+ public function getShippingPriceInclTax()
90
+ {
91
+ $inclTax = $this->getQuote()->getShippingAddress()->getShippingInclTax();
92
+ return $this->formatPrice($inclTax);
93
+ }
94
+
95
+ public function getShippingPriceExclTax()
96
+ {
97
+ return $this->formatPrice($this->getQuote()->getShippingAddress()->getShippingAmount());
98
+ }
99
+
100
+ public function formatPrice($price)
101
+ {
102
+ return $this->getQuote()->getStore()->formatPrice($price);
103
+ }
104
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Onepage/Shipping.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Onepage shipping block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Onepage_Shipping extends Mage_Checkout_Block_Onepage_Shipping
18
+ {
19
+ public function getAddress()
20
+ {
21
+ if (!empty(Mage::getSingleton('checkout/session')->getHcdWallet())) {
22
+ $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
23
+ $this->_address = Mage::getModel('sales/quote_address')->setAddressType(
24
+ Mage_Sales_Model_Quote_Address::TYPE_BILLING
25
+ )
26
+ ->setStoreId(Mage::app()->getStore()->getId())
27
+ ->setFirstname($wallet['adress']['firstname'])
28
+ ->setLastname($wallet['adress']['lastname'])
29
+ ->setEmail($wallet['adress']['email'])
30
+ ->setSuffix((''))
31
+ ->setCompany('')
32
+ ->setStreet(
33
+ array(
34
+ '0' => $wallet['adress']['street'][0],
35
+ '1' => $wallet['adress']['street'][1]
36
+ )
37
+ )
38
+ ->setCity($wallet['adress']['city'])
39
+ ->setPostcode($wallet['adress']['postcode'])
40
+ ->setCountry_id($wallet['adress']['country_id'])
41
+ ->setRegion($wallet['adress']['region'])
42
+ ->setRegion_id((string)$wallet['adress']['region_id'])
43
+ ->setTelephone($wallet['adress']['telephone'])
44
+ ->setFax();
45
+
46
+ return $this->_address;
47
+ } else {
48
+ return parent::getAddress();
49
+ }
50
+ }
51
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Response.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Index block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Response extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Block/Success.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Success block
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Block_Success extends HeidelpayCD_Edition_Block_Abstract
18
+ {
19
+ public function showPaymentInfo()
20
+ {
21
+ $return = array();
22
+ $order = $this->getCurrentOrder();
23
+ $session = $this->getCheckout();
24
+
25
+ $info = ($session->getHcdPaymentInfo() !== false) ? $session->getHcdPaymentInfo() : false;
26
+
27
+ if (!empty($info)) {
28
+ $return['Title'] = $order->getPayment()->getMethodInstance()->getTitle();
29
+ $return['Message'] = $session->getHcdPaymentInfo();
30
+
31
+ $session->unsHcdPaymentInfo();
32
+
33
+ return $return;
34
+ }
35
+
36
+ return false;
37
+ }
38
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/AbstractHelper.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Heidelpay abstract helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_AbstractHelper extends Mage_Core_Helper_Abstract
19
+ {
20
+ /**
21
+ * abstract log function because of backtrace
22
+ *
23
+ * @param mixed $message
24
+ * @param mixed $level
25
+ * @param mixed $file
26
+ */
27
+ public function log($message, $level = "DEBUG", $file = false)
28
+ {
29
+ $callers = debug_backtrace();
30
+ return $this->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
31
+ }
32
+
33
+ /**
34
+ * real log function which will be called from all controllers and models
35
+ *
36
+ * @param mixed $message
37
+ * @param mixed $level
38
+ * @param mixed $file
39
+ */
40
+ public function realLog($message, $level = "DEBUG", $file = false)
41
+ {
42
+ $storeId = Mage::app()->getStore()->getId();
43
+ $path = "hcd/settings/";
44
+
45
+
46
+ switch ($level) {
47
+ case "CRIT":
48
+ $lev = Zend_Log::CRIT;
49
+ break;
50
+ case "ERR":
51
+ case "ERROR":
52
+ $lev = Zend_Log::ERR;
53
+ break;
54
+ case "WARN":
55
+ $lev = Zend_Log::WARN;
56
+ break;
57
+ case "NOTICE":
58
+ $lev = Zend_Log::NOTICE;
59
+ break;
60
+ case "INFO":
61
+ $lev = Zend_Log::INFO;
62
+ break;
63
+ default:
64
+ $lev = Zend_Log::DEBUG;
65
+ if (Mage::getStoreConfig($path . "log", $storeId) == 0) {
66
+ return true;
67
+ }
68
+ break;
69
+ }
70
+
71
+ $file = ($file === false) ? "Heidelpay.log" : $file;
72
+
73
+ Mage::log($message, $lev, $file);
74
+ return true;
75
+ }
76
+
77
+ /**
78
+ * function to split paymentCode into code and method
79
+ *
80
+ * @param $paymentCode string payment code from response
81
+ *
82
+ * @return array payment code and method as an array
83
+ */
84
+ public function splitPaymentCode($paymentCode)
85
+ {
86
+ return preg_split('/\./', $paymentCode);
87
+ }
88
+
89
+ /**
90
+ * function to format amount
91
+ *
92
+ * @param mixed $number
93
+ */
94
+ public function format($number)
95
+ {
96
+ return number_format($number, 2, '.', '');
97
+ }
98
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/BasketApi.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Payment Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_BasketApi extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * collect items for basket api
22
+ *
23
+ * @param $quote Mage_Sales_Model_Order quote object
24
+ * @param $storeId integer current store id
25
+ * @param $includingShipment boolean include
26
+ *
27
+ * @return array return basket api array
28
+ */
29
+ public function basketItems($quote, $storeId, $includingShipment = false)
30
+ {
31
+ $shoppingCartItems = $quote->getAllVisibleItems();
32
+
33
+ $shoppingCart = array(
34
+
35
+ 'authentication' => array(
36
+
37
+ 'login' => trim(Mage::getStoreConfig('hcd/settings/user_id', $storeId)),
38
+ 'sender' => trim(Mage::getStoreConfig('hcd/settings/security_sender', $storeId)),
39
+ 'password' => trim(Mage::getStoreConfig('hcd/settings/user_pwd', $storeId)),
40
+
41
+ ),
42
+
43
+
44
+ 'basket' => array(
45
+ 'amountTotalNet' => floor(bcmul($quote->getGrandTotal(), 100, 10)),
46
+ 'currencyCode' => $quote->getGlobalCurrencyCode(),
47
+ 'amountTotalDiscount' => floor(bcmul($quote->getDiscountAmount(), 100, 10)),
48
+ 'itemCount' => count($shoppingCartItems)
49
+ )
50
+
51
+
52
+ );
53
+
54
+ $count = 1;
55
+ /** @var $item Mage_Sales_Model_Order_Item */
56
+ foreach ($shoppingCartItems as $item) {
57
+ $shoppingCart['basket']['basketItems'][] = array(
58
+ 'position' => $count,
59
+ 'basketItemReferenceId' => $item->getItemId(),
60
+ 'quantity' => ($item->getQtyOrdered() !== false) ? floor($item->getQtyOrdered()) : $item->getQty(),
61
+ 'vat' => floor($item->getTaxPercent()),
62
+ 'amountVat' => floor(bcmul($item->getTaxAmount(), 100, 10)),
63
+ 'amountGross' => floor(bcmul($item->getRowTotalInclTax(), 100, 10)),
64
+ 'amountNet' => floor(bcmul($item->getRowTotal(), 100, 10)),
65
+ 'amountPerUnit' => floor(bcmul($item->getPrice(), 100, 10)),
66
+ 'amountDiscount' => floor(bcmul($item->getDiscountAmount(), 100, 10)),
67
+ 'type' => 'goods',
68
+ 'title' => $item->getName(),
69
+ 'imageUrl' => (string)Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail')
70
+ );
71
+ $count++;
72
+ }
73
+
74
+ if ($includingShipment and $this->getShippingNetPrice($quote) > 0) {
75
+ // Shipping amount including tax
76
+ $shippingAmountInclTax = floor(
77
+ bcmul(
78
+ (($quote->getShippingAmount() - $quote->getShippingRefunded())
79
+ * (1 + $this->getShippingTaxPercent($quote) / 100)),
80
+ 100, 10
81
+ )
82
+ );
83
+
84
+ $shoppingCart['basket']['basketItems'][] = array(
85
+ 'position' => $count,
86
+ 'basketItemReferenceId' => $count,
87
+ "type" => "shipment",
88
+ "title" => "Shipping",
89
+ 'quantity' => 1,
90
+ 'vat' => $this->getShippingTaxPercent($quote),
91
+ 'amountVat' => floor(
92
+ bcmul(
93
+ ($shippingAmountInclTax - $this->getShippingTaxPercent($quote)),
94
+ 100, 10
95
+ )
96
+ ),
97
+ 'amountGross' => $shippingAmountInclTax,
98
+ 'amountNet' => $this->getShippingNetPrice($quote) ,
99
+ 'amountPerUnit' => $shippingAmountInclTax,
100
+ 'amountDiscount' => ''
101
+ );
102
+ }
103
+
104
+
105
+ return $shoppingCart;
106
+ }
107
+
108
+ /**
109
+ * Calculate shipping net price
110
+ *
111
+ * @param $order Mage_Sales_Model_Order magento order object
112
+ *
113
+ * @return string shipping net price
114
+ */
115
+ public function getShippingNetPrice($order)
116
+ {
117
+ $shippingTax = $order->getShippingTaxAmount();
118
+ $price = $order->getShippingInclTax() - $shippingTax;
119
+ $price -= $order->getShippingRefunded();
120
+ $price -= $order->getShippingCanceled();
121
+ return $price;
122
+ }
123
+
124
+ /**
125
+ * Calculate shipping tax in percent for BillSafe
126
+ *
127
+ * @param $order Mage_Sales_Model_Order magentp order object
128
+ *
129
+ * @return string shipping tex in percent
130
+ */
131
+ public function getShippingTaxPercent($order)
132
+ {
133
+ $tax = ($order->getShippingTaxAmount() * 100) / $order->getShippingAmount();
134
+ return $this->format(round($tax));
135
+ }
136
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/Data.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Helper data
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Helper_Data extends Mage_Core_Helper_Data
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/OrderState.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Order state Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_OrderState extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * @param $data HeidelpayCD_Edition_Model_Transaction
22
+ * @param $order Mage_Sales_Model_Order
23
+ * @param string $message order history message
24
+ */
25
+ public function mapStatus($data, $order, $message = '')
26
+ {
27
+ $this->log('mapStatus' . json_encode($data));
28
+ $paymentCode = $this->splitPaymentCode($data['PAYMENT_CODE']);
29
+
30
+ $message = ($message === '') ? $data['PROCESSING_RETURN'] : $message;
31
+
32
+
33
+ // Set language for mail template etc
34
+ if (strtoupper($data['CRITERION_LANGUAGE']) == 'DE') {
35
+ $locale = 'de_DE';
36
+ Mage::app()->getLocale()->setLocaleCode($locale);
37
+ Mage::getSingleton('core/translate')->setLocale($locale)->init('frontend', true);
38
+ }
39
+
40
+
41
+ // handle charge back notifications for cc, dc and dd
42
+ if ($paymentCode[1] == 'CB') {
43
+ $this->log('charge back for order ' . $order->getIncrementId());
44
+
45
+ $order->getPayment()->getMethodInstance()->chargeBackTransaction($order);
46
+
47
+ Mage::dispatchEvent('heidelpay_after_map_status_chargeBack', array('order' => $order));
48
+ $this->log('Is this order protected ? ' . (string)$order->isStateProtected());
49
+ $order->save();
50
+ return;
51
+ }
52
+
53
+ // Do nothing if status is already successful
54
+ if ($order->getStatus() == $order->getPayment()->getMethodInstance()->getStatusSuccess()) {
55
+ return;
56
+ }
57
+
58
+ // If the order is canceled, closed or complete do not change order status
59
+ if ($order->getStatus() == Mage_Sales_Model_Order::STATE_CANCELED or
60
+ $order->getStatus() == Mage_Sales_Model_Order::STATE_CLOSED or
61
+ $order->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE
62
+ ) {
63
+ // you can use this event for example to get a notification when a canceled order has been paid
64
+ $this->log('Order '.$order->getRealOrderId().' is canceled, closed or complete.');
65
+ Mage::dispatchEvent('heidelpay_map_status_cancel', array('order' => $order, 'data' => $data));
66
+ return;
67
+ }
68
+
69
+ // Set status for transaction that are not ok
70
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
71
+ $order->getPayment()->getMethodInstance()->canceledTransaction($order, $message);
72
+ Mage::dispatchEvent('heidelpay_after_map_status_canceled', array('order' => $order));
73
+ $order->save();
74
+
75
+ return;
76
+ }
77
+
78
+ // Set status for transaction with payment transaction
79
+ $paidTransactionTypes = array('CP', 'DB', 'RC', 'FI');
80
+
81
+ if (in_array($paymentCode[1], $paidTransactionTypes)) {
82
+ // only Billsafe finalize will have impacted on the order status
83
+ if ($paymentCode[1] === 'FI' and $data['ACCOUNT_BRAND'] !== 'BILLSAFE') {
84
+ return;
85
+ }
86
+
87
+ $order->getPayment()->getMethodInstance()->processingTransaction($order, $data, $message);
88
+
89
+ Mage::dispatchEvent('heidelpay_after_map_status_processed', array('order' => $order));
90
+ $order->save();
91
+ return;
92
+ }
93
+
94
+ //
95
+ if ($order->getStatus() != $order->getPayment()->getMethodInstance()->getStatusSuccess() and
96
+ $order->getStatus() != $order->getPayment()->getMethodInstance()->getStatusError()
97
+ ) {
98
+ $order->getPayment()->getMethodInstance()->pendingTransaction($order, $data, $message);
99
+ }
100
+
101
+
102
+ Mage::dispatchEvent('heidelpay_after_map_status', array('order' => $order));
103
+ $order->save();
104
+ }
105
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/Payment.php ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Payment Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_Payment extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * send request to heidelpay apo
22
+ *
23
+ * @param $url string url for the heidelpay api
24
+ * @param array $params post parameter
25
+ *
26
+ * @return mixed|null|Zend_Http_Response response from heidelpay api
27
+ */
28
+ public function doRequest($url, $params = array())
29
+ {
30
+ $client = new Zend_Http_Client(trim($url), array());
31
+
32
+ if (array_key_exists('raw', $params)) {
33
+ $client->setRawData(json_encode($params['raw']), 'application/json');
34
+ } else {
35
+ $client->setParameterPost($params);
36
+ }
37
+
38
+ if (extension_loaded('curl')) {
39
+ $adapter = new Zend_Http_Client_Adapter_Curl();
40
+ $adapter->setCurlOption(CURLOPT_SSL_VERIFYPEER, true);
41
+ $adapter->setCurlOption(CURLOPT_SSL_VERIFYHOST, 2);
42
+ $adapter->setCurlOption(CURLOPT_SSLVERSION, 6);
43
+ $client->setAdapter($adapter);
44
+ }
45
+
46
+ $response = $client->request('POST');
47
+ $res = $response->getBody();
48
+
49
+
50
+ if ($response->isError()) {
51
+ $this->log("Request fail. Http code : " . $response->getStatus() . ' Message : ' . $res, 'ERROR');
52
+ $this->log("Request data : " . json_encode($params), 'ERROR');
53
+ if (array_key_exists('raw', $params)) {
54
+ return $response;
55
+ }
56
+ }
57
+
58
+ if (array_key_exists('raw', $params)) {
59
+ return json_decode($res, true);
60
+ }
61
+
62
+ $result = null;
63
+ // @codingStandardsIgnoreLine parse_str is discouraged
64
+ parse_str($res, $result);
65
+ ksort($result);
66
+ return $result;
67
+ }
68
+
69
+ // @codingStandardsIgnoreLine more than 120 characters
70
+ public function preparePostData($config = array(), $front = array(), $customer = array(), $basket = array(), $criterion = array())
71
+ {
72
+ $params = array();
73
+ /*
74
+ * configuration part of this function
75
+ */
76
+ $params['SECURITY.SENDER'] = $config['SECURITY.SENDER'];
77
+ $params['USER.LOGIN'] = $config['USER.LOGIN'];
78
+ $params['USER.PWD'] = $config['USER.PWD'];
79
+
80
+ switch ($config['TRANSACTION.MODE']) {
81
+ case 'INTEGRATOR_TEST':
82
+ $params['TRANSACTION.MODE'] = 'INTEGRATOR_TEST';
83
+ break;
84
+ case 'CONNECTOR_TEST':
85
+ $params['TRANSACTION.MODE'] = 'CONNECTOR_TEST';
86
+ break;
87
+ default:
88
+ $params['TRANSACTION.MODE'] = 'LIVE';
89
+ }
90
+
91
+ $params['TRANSACTION.CHANNEL'] = $config['TRANSACTION.CHANNEL'];
92
+
93
+
94
+ $params = array_merge($params, $this->_setPaymentMethod($config, $customer));
95
+
96
+
97
+ /* debit on registration */
98
+ if (array_key_exists('ACCOUNT.REGISTRATION', $config)) {
99
+ $params['ACCOUNT.REGISTRATION'] = $config['ACCOUNT.REGISTRATION'];
100
+ $params['FRONTEND.ENABLED'] = "false";
101
+ }
102
+
103
+ if (array_key_exists('SHOP.TYPE', $config)) {
104
+ $params['SHOP.TYPE'] = $config['SHOP.TYPE'];
105
+ }
106
+
107
+ if (array_key_exists('SHOPMODUL.VERSION', $config)) {
108
+ $params['SHOPMODUL.VERSION'] = $config['SHOPMODUL.VERSION'];
109
+ }
110
+
111
+ /* frontend configuration */
112
+
113
+ /* override FRONTEND.ENABLED if necessary */
114
+ if (array_key_exists('FRONTEND.ENABLED', $front)) {
115
+ $params['FRONTEND.ENABLED'] = $front['FRONTEND.ENABLED'];
116
+ unset($front['FRONTEND.ENABLED']);
117
+ }
118
+
119
+ if (array_key_exists('FRONTEND.MODE', $front)) {
120
+ $params['FRONTEND.MODE'] = $front['FRONTEND.MODE'];
121
+ unset($front['FRONTEND.MODE']);
122
+ } else {
123
+ $params['FRONTEND.MODE'] = "WHITELABEL";
124
+ $params['TRANSACTION.RESPONSE'] = "SYNC";
125
+ $params['FRONTEND.ENABLED'] = 'true';
126
+ }
127
+
128
+
129
+ $params = array_merge($params, $front);
130
+
131
+ /* costumer data configuration */
132
+ $params = array_merge($params, $customer);
133
+
134
+ /* basket data configuration */
135
+ $params = array_merge($params, $basket);
136
+
137
+ /* criterion data configuration */
138
+ $params = array_merge($params, $criterion);
139
+
140
+ $params['REQUEST.VERSION'] = "1.0";
141
+
142
+ // sort the parameter
143
+ ksort($params);
144
+
145
+ return $params;
146
+ }
147
+
148
+ // @codingStandardsIgnoreLine should be refactored - issue #3
149
+ protected function _setPaymentMethod($config = array(), $customer = array())
150
+ {
151
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'PA' : $config['PAYMENT.TYPE'];
152
+ /* Set payment method */
153
+ switch ($config['PAYMENT.METHOD']) {
154
+ /* sofort */
155
+ case 'su':
156
+ $params['ACCOUNT.BRAND'] = "SOFORT";
157
+ $params['PAYMENT.CODE'] = "OT." . $type;
158
+ break;
159
+ /* griopay */
160
+ case 'gp':
161
+ $params['ACCOUNT.BRAND'] = "GIROPAY";
162
+ $params['PAYMENT.CODE'] = "OT." . $type;
163
+ break;
164
+ /* ideal */
165
+ case 'ide':
166
+ $params['ACCOUNT.BRAND'] = "IDEAL";
167
+ $params['PAYMENT.CODE'] = "OT." . $type;
168
+ break;
169
+ /* eps */
170
+ case 'eps':
171
+ $params['ACCOUNT.BRAND'] = "EPS";
172
+ $params['PAYMENT.CODE'] = "OT." . $type;
173
+ break;
174
+ /* postfinance */
175
+ case 'pf':
176
+ $params['PAYMENT.CODE'] = "OT." . $type;
177
+ break;
178
+ /* paypal */
179
+ case 'pal':
180
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'DB' : $config['PAYMENT.TYPE'];
181
+ $params['PAYMENT.CODE'] = "VA." . $type;
182
+ $params['ACCOUNT.BRAND'] = "PAYPAL";
183
+ break;
184
+ /* prepayment */
185
+ case 'pp':
186
+ $params['PAYMENT.CODE'] = "PP." . $type;
187
+ break;
188
+ /* invoce */
189
+ case 'iv':
190
+ $params['PAYMENT.CODE'] = "IV." . $type;
191
+ break;
192
+ /* invoice secured */
193
+ case 'ivsec':
194
+ $params['PAYMENT.CODE'] = "IV." . $type;
195
+ break;
196
+ /* direct debit secured */
197
+ case 'ddsec':
198
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'DB' : $config['PAYMENT.TYPE'];
199
+ $params['PAYMENT.CODE'] = "DD." . $type;
200
+ break;
201
+ /* BillSafe */
202
+ case 'bs':
203
+ $params['PAYMENT.CODE'] = "IV." . $type;
204
+ $params['ACCOUNT.BRAND'] = "BILLSAFE";
205
+ $params['FRONTEND.ENABLED'] = "false";
206
+ break;
207
+ /* MasterPass */
208
+ case 'mpa':
209
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'DB' : $config['PAYMENT.TYPE'];
210
+
211
+ // masterpass as a payment method
212
+ if (!array_key_exists('IDENTIFICATION.REFERENCEID', $customer) and ($type == 'DB' or $type == 'PA')) {
213
+ $params['WALLET.DIRECT_PAYMENT'] = "true";
214
+ $params['WALLET.DIRECT_PAYMENT_CODE'] = "WT." . $type;
215
+ $type = 'IN';
216
+ }
217
+
218
+ $params['PAYMENT.CODE'] = "WT." . $type;
219
+ $params['ACCOUNT.BRAND'] = "MASTERPASS";
220
+ break;
221
+ default:
222
+ $params['PAYMENT.CODE'] = strtoupper($config['PAYMENT.METHOD']) . '.' . $type;
223
+ break;
224
+ }
225
+
226
+ return $params;
227
+ }
228
+
229
+ /**
230
+ * get language code
231
+ *
232
+ * @param string $default default language code
233
+ *
234
+ * @return string return current lang code
235
+ */
236
+ public function getLang($default = 'en')
237
+ {
238
+ $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());
239
+ if (!empty($locale)) {
240
+ return strtoupper($locale[0]);
241
+ }
242
+
243
+ return strtoupper($default);
244
+ }
245
+
246
+ /**
247
+ * helper to generate customer payment error messages
248
+ *
249
+ * @param mixed $errorMsg
250
+ * @param null|mixed $errorCode
251
+ * @param null|mixed $orderNumber
252
+ */
253
+ public function handleError($errorMsg, $errorCode = null, $orderNumber = null)
254
+ {
255
+ // default is return generic error message
256
+ if ($orderNumber != null) {
257
+ $this->log('Ordernumber ' . $orderNumber . ' -> ' . $errorMsg . ' [' . $errorCode . ']', 'NOTICE');
258
+ }
259
+
260
+ if ($errorCode) {
261
+ if (!preg_match(
262
+ '/HPError-[0-9]{3}\.[0-9]{3}\.[0-9]{3}/', $this->_getHelper()->__('HPError-' . $errorCode),
263
+ $matches
264
+ )
265
+ ) { //JUST return when snipet exists
266
+ return $this->_getHelper()->__('HPError-' . $errorCode);
267
+ }
268
+ }
269
+
270
+ return $this->_getHelper()->__('An unexpected error occurred. Please contact us to get further information.');
271
+ }
272
+
273
+ /**
274
+ * get helper instance
275
+ *
276
+ * @return Mage_Core_Helper_Abstract
277
+ */
278
+ protected function _getHelper()
279
+ {
280
+ return Mage::helper('hcd');
281
+ }
282
+
283
+ /**
284
+ * Get region code
285
+ *
286
+ * @param $countryCode string country code
287
+ * @param $stateByName string state name
288
+ *
289
+ * @return mixed regionId
290
+ */
291
+ public function getRegion($countryCode, $stateByName)
292
+ {
293
+ $regionData = Mage::getModel('directory/region')->getResourceCollection()
294
+ ->addCountryFilter($countryCode)
295
+ ->load();
296
+
297
+
298
+ $regionId = null;
299
+
300
+ foreach ($regionData as $region) {
301
+ if (strtolower($stateByName) == strtolower($region['name']) or $stateByName == $region['code']) {
302
+ return $region['region_id'];
303
+ }
304
+ }
305
+
306
+ // Return last region if mapping fails
307
+ return $region['region_id'];
308
+ }
309
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Helper/Validator.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Validator Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_Validator extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * Validates the age of the customer
22
+ *
23
+ * It will return true if the costumer is older then 18 years
24
+ *
25
+ * @param $day integer day of the customers birth
26
+ * @param $mount integer month of the customers birth
27
+ * @param $year integer year of the customers birth
28
+ * @param mixed $month
29
+ *
30
+ * @return bool return true if the costumer is older then 18 years
31
+ */
32
+ public function validateDateOfBirth($day, $month, $year)
33
+ {
34
+ // @codingStandardsIgnoreLine should be refactored - issue #2
35
+ if (strtotime("$year/$month/$day") < (time() - (18 * 60 * 60 * 24 * 365))) {
36
+ return true;
37
+ }
38
+
39
+ return false;
40
+ }
41
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Customer.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer Model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Customer extends Mage_Core_Model_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/customer');
22
+ parent::_construct();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Customer.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer mysql driver
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Customer extends Mage_Core_Model_Mysql4_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/customer', 'id');
22
+ }
23
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Customer/Collection.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer collection
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Customer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/customer');
22
+ parent::_construct();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Transaction.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Transaction mysql driver
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Transaction extends Mage_Core_Model_Mysql4_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/transaction', 'id');
22
+ }
23
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Mysql4/Transaction/Collection.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Transaction collection
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Transaction_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/transaction');
22
+ parent::_construct();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Observer.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * heidelpay observer model
4
+ *
5
+ * @license Use of this software requires acceptance of the License Agreement.
6
+ * @copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Observer
18
+ {
19
+ public $invoiceOrderEmail = true;
20
+
21
+ /**
22
+ * Unset session variable hcdWallet if the customers return to backet
23
+ *
24
+ * @param $observer
25
+ */
26
+ public function removeWalletDataFromCheckout()
27
+ {
28
+ // unset wallet data from session
29
+ if ($session = Mage::getSingleton('checkout/session')) {
30
+ $session->unsHcdWallet();
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Unset session variable hcdWallet if the customers return to backet
36
+ *
37
+ * @param $observer
38
+ */
39
+ public function handleWalletDataDuringCheckout($observer)
40
+ {
41
+ $controller = $observer->getControllerAction();
42
+
43
+ $controllerName = $controller->getRequest()->getControllerName();
44
+
45
+ $actionName = $controller->getRequest()->getActionName();
46
+
47
+ if (($controllerName == "cart" and $actionName == "index")
48
+ or ($controllerName == "onepage" and $actionName == "index")
49
+ ) {
50
+
51
+ /**
52
+ * remove wallet information from session (currently only masterpass)
53
+ */
54
+ if ($session = Mage::getSingleton('checkout/session')) {
55
+ $session->unsHcdWallet();
56
+ }
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Observer on save shipment to report the shipment to heidelpay
62
+ *
63
+ * @param $observer
64
+ */
65
+ public function reportShippingToHeidelpay($observer)
66
+ {
67
+ $shipment = $observer->getEvent()->getShipment();
68
+ $order = $shipment->getOrder();
69
+ if (empty($order)) {
70
+ return $this;
71
+ }
72
+
73
+ $payment = $order->getPayment()->getMethodInstance();
74
+
75
+ $paymentCode = $payment->getCode();
76
+
77
+
78
+ $paymentMethod = array('hcdivsec', 'hcdbs');
79
+
80
+
81
+ // return $this when reporting shipment is not needed
82
+ if (!in_array($paymentCode, $paymentMethod)) {
83
+ return $this;
84
+ }
85
+
86
+ /** @var $transactionModel HeidelpayCD_Edition_Model_Transaction */
87
+ $transactionModel = Mage::getModel('hcd/transaction');
88
+ /** @var $sessionModel Mage_Core_Model_Session */
89
+ $sessionModel = Mage::getSingleton('core/session');
90
+ /** @var $heidelpayHelper HeidelpayCD_Edition_Helper_Data */
91
+ $heidelpayHelper = Mage::helper('hcd');
92
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
93
+ $paymentHelper = Mage::helper('hcd/payment');
94
+
95
+ // load authorisation form database
96
+ $authorisation = $transactionModel->getOneTransactionByMethode($order->getRealOrderId(), 'PA');
97
+ // no authorisation found
98
+ if ($authorisation === false) {
99
+ $sessionModel->addError(
100
+ $heidelpayHelper->__(
101
+ 'Delivery notes to Heidelpay fail, because of no initial authorisation'
102
+ )
103
+ );
104
+ return $this;
105
+ }
106
+
107
+ // set config parameter for request
108
+ $config = $payment->getMainConfig($paymentCode, $order->getStoreId());
109
+ $config['PAYMENT.TYPE'] = 'FI';
110
+
111
+ // set frontend parameter for request
112
+ $frontend = $payment->getFrontend($order->getRealOrderId(), $authorisation['CRITERION_STOREID']);
113
+ $frontend['FRONTEND.MODE'] = 'DEFAULT';
114
+ $frontend['FRONTEND.ENABLED'] = 'false';
115
+
116
+ // set user parameter for request
117
+ $user = $payment->getUser($order, true);
118
+
119
+ $basketData = $payment->getBasketData($order);
120
+ $basketData['IDENTIFICATION.REFERENCEID'] = $authorisation['IDENTIFICATION_UNIQUEID'];#
121
+
122
+ $criterion = array();
123
+
124
+ Mage::dispatchEvent(
125
+ 'heidelpay_reportShippingToHeidelpay_bevor_preparePostData',
126
+ array(
127
+ 'payment' => $payment,
128
+ 'config' => $config,
129
+ 'frontend' => $frontend,
130
+ 'user' => $user,
131
+ 'basketData' => $basketData,
132
+ 'criterion' => $criterion
133
+ )
134
+ );
135
+
136
+ // prepare shipment report
137
+ $params = $paymentHelper->preparePostData($config, $frontend, $user, $basketData, $criterion);
138
+
139
+ $this->log("doRequest url : " . $config['URL']);
140
+ $this->log("doRequest params : " . json_encode($params));
141
+ // send shipment report to heidelpay api
142
+ $src = $paymentHelper->doRequest($config['URL'], $params);
143
+
144
+ $this->log("doRequest response : " . json_encode($src));
145
+
146
+ // generate error message in case of api error
147
+ if ($src['PROCESSING_RESULT'] == "NOK") {
148
+ $sessionModel
149
+ ->addError(
150
+ $heidelpayHelper
151
+ ->__(
152
+ 'Delivery notes to Heidelpay fail, because of :
153
+ '
154
+ )
155
+ . $src['PROCESSING_RETURN']
156
+ );
157
+ $shipment->_dataSaveAllowed = false;
158
+ Mage::app()->getResponse()
159
+ // @codingStandardsIgnoreLine use of S_SERVER is discouraged
160
+ ->setRedirect($_SERVER['HTTP_REFERER'])
161
+ ->sendResponse();
162
+ return;
163
+ }
164
+
165
+ $message = $heidelpayHelper->__('report shipment to heidelpay successful. Waiting for receipt of money');
166
+ $order->setState(
167
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
168
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
169
+ $message
170
+ )->save();
171
+
172
+
173
+ // successful send shipment report to heidelpay
174
+ $sessionModel
175
+ ->addSuccess(
176
+ $heidelpayHelper
177
+ ->__('Successfully report delivery to Heidelpay.')
178
+ );
179
+ }
180
+
181
+ /**
182
+ * log function
183
+ *
184
+ * @param $message string log message
185
+ * @param $level string log level
186
+ * @param $file string log file
187
+ *
188
+ * @return mixed
189
+ */
190
+ protected function log($message, $level = "DEBUG", $file = false)
191
+ {
192
+ $callers = debug_backtrace();
193
+ return Mage::helper('hcd/payment')
194
+ ->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
195
+ }
196
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Order/Pdf/Invoice.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Order pdf invoice
4
+ *
5
+ * this is now handled by pdf templates
6
+ *
7
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
8
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
9
+ *
10
+ * @link https://dev.heidelpay.de/magento
11
+ *
12
+ * @author Jens Richter
13
+ *
14
+ * @package Heidelpay
15
+ * @subpackage Magento
16
+ * @category Magento
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Invoice
20
+ {
21
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Abstract.php ADDED
@@ -0,0 +1,1138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Abstract payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Method_Abstract
19
+ {
20
+ /**
21
+ * @var string payment code of the method
22
+ */
23
+ protected $_code = 'abstract';
24
+ /**
25
+ * @var Mage_Sales_Model_Order magento order object
26
+ */
27
+ protected $_order;
28
+ /**
29
+ * @var bool weather this payment method is a gateway method
30
+ */
31
+ protected $_isGateway = true;
32
+ /**
33
+ * @var bool this payment method allows authorisation
34
+ */
35
+ protected $_canAuthorize = false;
36
+ /**
37
+ * @var bool this payment method is able to capture
38
+ */
39
+ protected $_canCapture = false;
40
+ /**
41
+ * @var bool this payment method is capable of partly capture
42
+ */
43
+ protected $_canCapturePartial = false;
44
+ /**
45
+ * @var bool the chard amount can be reverted to the given account
46
+ */
47
+ protected $_canRefund = true;
48
+ /**
49
+ * @var bool even spear invoice can be reverted
50
+ */
51
+ protected $_canRefundInvoicePartial = true;
52
+
53
+ protected $_canVoid = true;
54
+ /**
55
+ * @var bool payment method can be used from backend
56
+ */
57
+ protected $_canUseInternal = false;
58
+ /**
59
+ * @var bool payment method can be used for checkout
60
+ */
61
+ protected $_canUseCheckout = true;
62
+ /**
63
+ * @var bool payment method supports multishipping checkout
64
+ */
65
+ protected $_canUseForMultishipping = false;
66
+ /**
67
+ * @var bool Basket details will be send to the payment server
68
+ */
69
+ protected $_canBasketApi = false;
70
+ /**
71
+ * @var bool payment method needs to be initialized
72
+ */
73
+ protected $_isInitializeNeeded = true;
74
+ /**
75
+ * @var bool invoice order mail send
76
+ */
77
+ protected $_invoiceOrderEmail = true;
78
+
79
+ /**
80
+ * @var string productive payment server url
81
+ */
82
+ protected $_liveUrl = 'https://heidelpay.hpcgw.net/ngw/post';
83
+ /**
84
+ * @var string sandbox payment server url
85
+ */
86
+ protected $_sandboxUrl = 'https://test-heidelpay.hpcgw.net/ngw/post';
87
+ /**
88
+ * @var string checkout information and form
89
+ */
90
+ protected $_formBlockType = 'hcd/form_desconly';
91
+
92
+ /**
93
+ * @return bool payment method will redirect the customer directly to heidelpay
94
+ */
95
+ public function activeRedirect()
96
+ {
97
+ return true;
98
+ }
99
+
100
+ /**
101
+ * Inject template for checkout
102
+ *
103
+ * @return string template form
104
+ */
105
+ public function getFormBlockType()
106
+ {
107
+ return $this->_formBlockType;
108
+ }
109
+
110
+ /**
111
+ * This payment method supports basket api
112
+ *
113
+ * @return bool
114
+ */
115
+ public function canBasketApi()
116
+ {
117
+ return $this->_canBasketApi;
118
+ }
119
+
120
+ /**
121
+ * Getter for pending status
122
+ *
123
+ * @param bool $param return state or status
124
+ *
125
+ * @return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
126
+ */
127
+ public function getStatusPendig($param = false)
128
+ {
129
+ if ($param == false) {
130
+ return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
131
+ } // status
132
+
133
+ return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT; //state
134
+ }
135
+
136
+ /**
137
+ * Getter for error status
138
+ *
139
+ * @param bool $param return state or status
140
+ *
141
+ * @return Mage_Sales_Model_Order::STATE_CANCELED;
142
+ */
143
+ public function getStatusError($param = false)
144
+ {
145
+ if ($param == false) {
146
+ return Mage_Sales_Model_Order::STATE_CANCELED;
147
+ } // status
148
+
149
+ return Mage_Sales_Model_Order::STATE_CANCELED; //state
150
+ }
151
+
152
+ /**
153
+ * Getter for success status
154
+ *
155
+ * @param bool $param return state or status
156
+ *
157
+ * @return Mage_Sales_Model_Order::STATE_PROCESSING;
158
+ */
159
+ public function getStatusSuccess($param = false)
160
+ {
161
+ if ($param == false) {
162
+ return Mage_Sales_Model_Order::STATE_PROCESSING;
163
+ } // status
164
+
165
+ return Mage_Sales_Model_Order::STATE_PROCESSING; //state
166
+ }
167
+
168
+ /**
169
+ * Getter for partly paid status
170
+ *
171
+ * @param bool $param return state or status
172
+ *
173
+ * @return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
174
+ */
175
+ public function getStatusPartlyPaid($param = false)
176
+ {
177
+ if ($param == false) {
178
+ return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
179
+ } // status
180
+
181
+ return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW; //state
182
+ }
183
+
184
+ /**
185
+ * Getter for core session
186
+ *
187
+ * @return Mage_Heidelpay_Model_Session
188
+ */
189
+ public function getSession()
190
+ {
191
+ return Mage::getSingleton('core/session');
192
+ }
193
+
194
+ /**
195
+ * Validate input data from checkout
196
+ *
197
+ * @return HeidelpayCD_Edition_Model_Payment_Abstract
198
+ */
199
+ public function validate()
200
+ {
201
+ parent::validate();
202
+ return $this;
203
+ }
204
+
205
+ /**
206
+ * Inject information template
207
+ *
208
+ * @return string
209
+ */
210
+ public function getInfoBlockType()
211
+ {
212
+ return $this->_infoBlockType;
213
+ }
214
+
215
+ /**
216
+ * Deactivate payment method in case of wrong currency or other credentials
217
+ *
218
+ * @param Mage_Quote
219
+ * @param null|mixed $quote
220
+ *
221
+ * @return bool
222
+ */
223
+ public function isAvailable($quote = null)
224
+ {
225
+ # Minimum and maximum amount
226
+ $totals = $this->getQuote()->getTotals();
227
+ if (!isset($totals['grand_total'])) {
228
+ return false;
229
+ }
230
+
231
+ $storeId = Mage::app()->getStore()->getId();
232
+
233
+ $amount = sprintf('%1.2f', $totals['grand_total']->getData('value'));
234
+ $amount = $amount * 100;
235
+ $path = "payment/" . $this->_code . "/";
236
+ $minamount = Mage::getStoreConfig($path . 'min_amount', $storeId);
237
+ $maxamount = Mage::getStoreConfig($path . 'max_amount', $storeId);
238
+ if (is_numeric($minamount) && $minamount > 0 && $minamount > $amount) {
239
+ return false;
240
+ }
241
+
242
+ if (is_numeric($maxamount) && $maxamount > 0 && $maxamount < $amount) {
243
+ return false;
244
+ }
245
+
246
+ return parent::isAvailable($quote);
247
+ }
248
+
249
+ /**
250
+ * Get current quote
251
+ *
252
+ * @return Mage_Sales_Model_Quote
253
+ */
254
+ public function getQuote()
255
+ {
256
+ return $this->getCheckout()->getQuote();
257
+ }
258
+
259
+ /**
260
+ * Get current checkout session
261
+ *
262
+ * @return Mage_Core_Model_Abstract::getSingleton('checkout/session')
263
+ */
264
+ public function getCheckout()
265
+ {
266
+ return Mage::getSingleton('checkout/session');
267
+ }
268
+
269
+ /**
270
+ * Redirect to heidelpay index controller in case of placing the order
271
+ *
272
+ * @return string controller url
273
+ */
274
+ public function getOrderPlaceRedirectUrl()
275
+ {
276
+ return Mage::getUrl('hcd/', array('_secure' => true));
277
+ }
278
+
279
+ /**
280
+ * Call heidelpay api for a payment request
281
+ *
282
+ * @param bool $isRegistration payment method supports registration
283
+ * @param bool $BasketI Id of a heidelpay basket api call
284
+ * @param bool $refId payment reference id for debit/authorize on a registration
285
+ * @param mixed $basketId
286
+ *
287
+ * @return mixed
288
+ */
289
+ public function getHeidelpayUrl($isRegistration = false, $basketId = false, $refId = false)
290
+ {
291
+ $config = $frontend = $user = $basketData = array();
292
+ $criterion = array();
293
+
294
+ if ($isRegistration === false) {
295
+ $order = Mage::getModel('sales/order');
296
+ $session = $this->getCheckout();
297
+ $order->loadByIncrementId($session->getLastRealOrderId());
298
+ $ordernr = $order->getRealOrderId();
299
+ } else {
300
+ $customerId = $this->getCustomerId();
301
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
302
+ $ordernr = ($customerId == 0) ? $visitorData['visitor_id'] : $customerId;
303
+ $order = $this->getQuote();
304
+ }
305
+
306
+ $this->log("Heidelpay Payment Code : " . $this->_code);
307
+ $config = $this->getMainConfig($this->_code);
308
+ if ($isRegistration === true) {
309
+ $config['PAYMENT.TYPE'] = 'RG';
310
+ }
311
+
312
+ if ($isRegistration === true) {
313
+ $basketData['PRESENTATION.CURRENCY'] =
314
+ $this->getQuote()->getQuoteCurrencyCode();
315
+ }
316
+
317
+ // add parameters for pci 3 iframe
318
+
319
+ if ($this->_code == 'hcdcc' or $this->_code == 'hcddc') {
320
+ $url = explode('/', Mage::getUrl('/', array('_secure' => true)));
321
+ $criterion['FRONTEND.PAYMENT_FRAME_ORIGIN'] = $url[0] . '//' . $url[2];
322
+ $criterion['FRONTEND.CSS_PATH'] =
323
+ Mage::getDesign()->getSkinUrl(
324
+ 'css/' . $this->_code . '_payment_frame.css',
325
+ array('_secure' => true)
326
+ );
327
+ // set frame to sync modus if frame is used in befor order mode
328
+ // (this is the registration case)
329
+ $criterion['FRONTEND.PREVENT_ASYNC_REDIRECT'] =
330
+ ($isRegistration === true) ? 'TRUE' : 'FALSE';
331
+ }
332
+
333
+ $frontend = $this->getFrontend($ordernr);
334
+ if ($isRegistration === true) {
335
+ $frontend['FRONTEND.SUCCESS_URL'] =
336
+ Mage::getUrl('hcd/', array('_secure' => true));
337
+ }
338
+
339
+ if ($isRegistration === true) {
340
+ $frontend['CRITERION.SHIPPPING_HASH'] = $this->getShippingHash();
341
+ }
342
+
343
+ $user = $this->getUser($order, $isRegistration);
344
+
345
+
346
+ if ($isRegistration === false) {
347
+ $completeBasket =
348
+ ($config['INVOICEING'] == 1
349
+ or $this->_code == "hcdbs") ? true : false;
350
+ $basketData = $this->getBasketData($order, $completeBasket);
351
+ }
352
+
353
+ if ($refId !== false) {
354
+ $user['IDENTIFICATION.REFERENCEID'] = $refId;
355
+ }
356
+
357
+ if ($basketId !== false) {
358
+ $basketData['BASKET.ID'] = $basketId;
359
+ }
360
+
361
+ Mage::dispatchEvent(
362
+ 'heidelpay_getHeidelpayUrl_bevor_preparePostData',
363
+ array(
364
+ 'order' => $order,
365
+ 'config' => $config,
366
+ 'frontend' => $frontend,
367
+ 'user' => $user,
368
+ 'basketData' => $basketData,
369
+ 'criterion' => $criterion
370
+ )
371
+ );
372
+
373
+ $params = Mage::helper('hcd/payment')->preparePostData(
374
+ $config, $frontend, $user, $basketData,
375
+ $criterion
376
+ );
377
+ $this->log("doRequest url : " . $config['URL'], 'DEBUG');
378
+ $this->log("doRequest params : " . json_encode($params), 'DEBUG');
379
+ $src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
380
+ $this->log("doRequest response : " . json_encode($src), 'DEBUG');
381
+
382
+ return $src;
383
+ }
384
+
385
+ /**
386
+ * Getter for customer identification number
387
+ *
388
+ * @return int customer identification number
389
+ */
390
+ public function getCustomerId()
391
+ {
392
+ return $this->getQuote()->getBillingAddress()->getCustomerId();
393
+ }
394
+
395
+ /**
396
+ * logger
397
+ *
398
+ * @param $message string message that should be logged
399
+ * @param string $level message level (like debug,info or warning)
400
+ * @param bool $file name of the logfile
401
+ *
402
+ * @return mixed
403
+ */
404
+ public function log($message, $level = "DEBUG", $file = false)
405
+ {
406
+ $callers = debug_backtrace();
407
+ $paymentHelper = Mage::helper('hcd/payment');
408
+ return $paymentHelper->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
409
+ }
410
+
411
+ /**
412
+ * Load configuration parameter for the given payment method
413
+ *
414
+ * @param mixed $code payment method code
415
+ * @param mixed $storeId magento store identification number
416
+ *
417
+ * @return mixed
418
+ */
419
+ public function getMainConfig($code, $storeId = false)
420
+ {
421
+ $storeId = ($storeId) ? $storeId : $this->getStore();
422
+ $path = "hcd/settings/";
423
+ $config = array();
424
+ $config['PAYMENT.METHOD'] = preg_replace('/^hcd/', '', $code);
425
+ $config['SECURITY.SENDER'] = Mage::getStoreConfig($path . "security_sender", $storeId);
426
+ if (Mage::getStoreConfig($path . "transactionmode", $storeId) == 0) {
427
+ $config['TRANSACTION.MODE'] = 'LIVE';
428
+ $config['URL'] = $this->_liveUrl;
429
+ } else {
430
+ $config['TRANSACTION.MODE'] = 'CONNECTOR_TEST';
431
+ $config['URL'] = $this->_sandboxUrl;
432
+ }
433
+
434
+ $config['USER.LOGIN'] = trim(Mage::getStoreConfig($path . "user_id", $storeId));
435
+ $config['USER.PWD'] = trim(Mage::getStoreConfig($path . "user_pwd", $storeId));
436
+ $config['INVOICEING'] = (Mage::getStoreConfig($path . "invoicing", $storeId) == 1) ? 1 : 0;
437
+ $config['USER.PWD'] = trim(Mage::getStoreConfig($path . "user_pwd", $storeId));
438
+
439
+ $path = "payment/" . $code . "/";
440
+ $config['TRANSACTION.CHANNEL'] = trim(Mage::getStoreConfig($path . "channel", $storeId));
441
+ (Mage::getStoreConfig(
442
+ $path . "bookingmode",
443
+ $storeId
444
+ ) == true) ? $config['PAYMENT.TYPE'] = Mage::getStoreConfig(
445
+ $path . "bookingmode",
446
+ $storeId
447
+ ) : false;
448
+
449
+ return $config;
450
+ }
451
+
452
+ /**
453
+ * Prepare frontend parameter for heidelpay api call
454
+ *
455
+ * @param $orderNumber order identification number
456
+ * @param bool $storeId shore identification number
457
+ *
458
+ * @return array
459
+ */
460
+ public function getFrontend($orderNumber, $storeId = false)
461
+ {
462
+ return array(
463
+ 'FRONTEND.LANGUAGE' => Mage::helper('hcd/payment')->getLang(),
464
+ 'FRONTEND.RESPONSE_URL' => Mage::getUrl(
465
+ 'hcd/response/',
466
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
467
+ ),
468
+ 'FRONTEND.SUCCESS_URL' => Mage::getUrl(
469
+ 'hcd/index/success',
470
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
471
+ ),
472
+ 'FRONTEND.FAILURE_URL' => Mage::getUrl(
473
+ 'hcd/index/error',
474
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
475
+ ),
476
+ 'CRITERION.PUSH_URL' => Mage::getUrl(
477
+ 'hcd/index/push',
478
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
479
+ ),
480
+ 'CRITERION.SECRET' => Mage::getModel('hcd/resource_encryption')
481
+ ->getHash((string)$orderNumber),
482
+ 'CRITERION.LANGUAGE' => strtolower(Mage::helper('hcd/payment')->getLang()),
483
+ 'CRITERION.STOREID' => ($storeId) ? $storeId : Mage::app()->getStore()->getId(),
484
+ 'SHOP.TYPE' => 'Magento ' . Mage::getVersion(),
485
+ 'SHOPMODULE.VERSION' => 'HeidelpayCD Edition - ' .
486
+ (string)Mage::getConfig()->getNode()->modules->HeidelpayCD_Edition->version
487
+ );
488
+ }
489
+
490
+ /**
491
+ * ShippingHash Getter
492
+ *
493
+ * A hash of the customers shipping details
494
+ *
495
+ * @return string hash
496
+ *
497
+ */
498
+ public function getShippingHash()
499
+ {
500
+ $shipping = $this->getQuote()->getShippingAddress();
501
+ // @codingStandardsIgnoreStart can not be replace because of backwards compatiblity
502
+ return md5(
503
+ $shipping->getFirstname() .
504
+ $shipping->getLastname() .
505
+ $shipping->getStreet1() . " " . $shipping->getStreet2() .
506
+ $shipping->getPostcode() .
507
+ $shipping->getCity() .
508
+ $shipping->getCountry()
509
+ );
510
+ // @codingStandardsIgnoreEnd
511
+ }
512
+
513
+ /**
514
+ * Customer parameter for heidelpay api call
515
+ *
516
+ * @param $order Mage_Sales_Model_Order magento order object
517
+ * @param bool $isReg in case of registration
518
+ *
519
+ * @return array
520
+ *
521
+ */
522
+ // @codingStandardsIgnoreLine should be refactored - issue #1
523
+ public function getUser($order, $isReg = false)
524
+ {
525
+ $user = array();
526
+ $billing = $order->getBillingAddress();
527
+ $email = ($order->getBillingAddress()->getEmail())
528
+ ? $order->getBillingAddress()->getEmail() : $order->getCustomerEmail();
529
+ $customerId = $billing->getCustomerId();
530
+ $user['CRITERION.GUEST'] = 'false';
531
+ if ($customerId == 0) {
532
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
533
+ $customerId = $visitorData['visitor_id'];
534
+ $user['CRITERION.GUEST'] = 'true';
535
+ }
536
+
537
+ $user['IDENTIFICATION.SHOPPERID'] = $customerId;
538
+ if ($billing->getCompany() == true) {
539
+ $user['NAME.COMPANY'] = trim($billing->getCompany());
540
+ }
541
+
542
+ $user['NAME.GIVEN'] = trim($billing->getFirstname());
543
+ $user['NAME.FAMILY'] = trim($billing->getLastname());
544
+ $user['ADDRESS.STREET'] =
545
+ trim($billing->getStreet1() . " " . $billing->getStreet2());
546
+ $user['ADDRESS.ZIP'] = trim($billing->getPostcode());
547
+ $user['ADDRESS.CITY'] = trim($billing->getCity());
548
+ $user['ADDRESS.COUNTRY'] = trim($billing->getCountry());
549
+ $user['CONTACT.EMAIL'] = trim($email);
550
+ $user['CONTACT.IP'] =
551
+ (filter_var(
552
+ trim(Mage::app()->getRequest()->getClientIp()), FILTER_VALIDATE_IP
553
+ )) ? trim(Mage::app()->getRequest()->getClientIp()) : '127.0.0.1';
554
+
555
+
556
+ //load recognized data
557
+
558
+ if ($isReg === false
559
+ and $order->getPayment()->getMethodInstance()
560
+ ->activeRedirect() === true
561
+ ) {
562
+ if ($this->getCustomerData($this->_code, $billing->getCustomerId())) {
563
+ $paymentData =
564
+ $this->getCustomerData($this->_code, $billing->getCustomerId());
565
+
566
+
567
+ $this->log('getUser Customer: ' . json_encode($paymentData), 'DEBUG');
568
+
569
+ if (isset($paymentData['payment_data']['ACCOUNT.IBAN'])) {
570
+ $paymentData['payment_data']['ACCOUNT.IBAN'] =
571
+ strtoupper($paymentData['payment_data']['ACCOUNT.IBAN']);
572
+ }
573
+
574
+ // remove SHIPPING_HASH from parameters
575
+ if (isset($paymentData['payment_data']['SHIPPPING_HASH'])) {
576
+ unset($paymentData['payment_data']['SHIPPPING_HASH']);
577
+ }
578
+
579
+ // remove cc or dc reference data
580
+ if ($this->_code == 'hcdcc' or $this->_code == 'hcddc') {
581
+ if (isset($paymentData['payment_data']['ACCOUNT_BRAND'])) {
582
+ unset($paymentData['payment_data']['ACCOUNT_BRAND']);
583
+ }
584
+
585
+ if (isset($paymentData['payment_data']['ACCOUNT_NUMBER'])) {
586
+ unset($paymentData['payment_data']['ACCOUNT_NUMBER']);
587
+ }
588
+
589
+ if (isset($paymentData['payment_data']['ACCOUNT_HOLDER'])) {
590
+ unset($paymentData['payment_data']['ACCOUNT_HOLDER']);
591
+ }
592
+
593
+ if (isset($paymentData['payment_data']['ACCOUNT_EXPIRY_MONTH'])
594
+ ) {
595
+ unset($paymentData['payment_data']['ACCOUNT_EXPIRY_MONTH']);
596
+ }
597
+
598
+ if (isset($paymentData['payment_data']['ACCOUNT_EXPIRY_YEAR'])) {
599
+ unset($paymentData['payment_data']['ACCOUNT_EXPIRY_YEAR']);
600
+ }
601
+ }
602
+
603
+ foreach ($paymentData['payment_data'] as $k => $v) {
604
+ $user[$k] = $v;
605
+ }
606
+ }
607
+ }
608
+
609
+ return $user;
610
+ }
611
+
612
+ /**
613
+ * Load additional payment information
614
+ *
615
+ * @param bool $code current payment method
616
+ * @param bool $customerId the customers identification number
617
+ * @param bool $storeId magento store id
618
+ *
619
+ * @return array|bool additional payment information
620
+ */
621
+ public function getCustomerData($code = false, $customerId = false, $storeId = false)
622
+ {
623
+ $paymentCode = ($code) ? $code : $this->_code;
624
+ $customerId = ($customerId) ? $customerId : $this->getQuote()->getBillingAddress()->getCustomerId();
625
+ $storeId = ($storeId) ? $storeId : Mage::app()->getStore()->getId();
626
+ if ($customerId == 0) {
627
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
628
+ $customerId = $visitorData['visitor_id'];
629
+ $storeId = 0;
630
+ }
631
+
632
+ $this->log('StoreID :' . Mage::app()->getStore()->getId());
633
+
634
+ $customerData = Mage::getModel('hcd/customer')
635
+ ->getCollection()
636
+ ->addFieldToFilter('Customerid', $customerId)
637
+ ->addFieldToFilter('Storeid', $storeId)
638
+ ->addFieldToFilter('Paymentmethode', $paymentCode);
639
+
640
+ $customerData->load();
641
+ $data = $customerData->getData();
642
+
643
+ /* retun false if not */
644
+ if (empty($data[0]['id'])) {
645
+ return false;
646
+ }
647
+
648
+ $return = array();
649
+
650
+ $return['id'] = $data[0]['id'];
651
+
652
+ if (!empty($data[0]['uniqeid'])) {
653
+ $return['uniqeid'] = $data[0]['uniqeid'];
654
+ }
655
+
656
+ if (!empty($data[0]['payment_data'])) {
657
+ $return['payment_data'] = json_decode(
658
+ Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['payment_data']),
659
+ true
660
+ );
661
+ }
662
+
663
+ return $return;
664
+ }
665
+
666
+ /**
667
+ * Prepare basket details for heidelpay basket call
668
+ *
669
+ * @param $order Mage_Sales_Model_Order magento order object
670
+ * @param bool $completeBasket
671
+ * @param bool $amount order amount
672
+ *
673
+ * @return array
674
+ */
675
+ public function getBasketData($order, $completeBasket = false, $amount = false)
676
+ {
677
+ $data = array(
678
+ 'PRESENTATION.AMOUNT' => ($amount) ? $amount : Mage::helper('hcd/payment')
679
+ ->format($order->getGrandTotal()),
680
+ 'PRESENTATION.CURRENCY' => $order->getOrderCurrencyCode(),
681
+ 'IDENTIFICATION.TRANSACTIONID' => $order->getRealOrderId()
682
+ );
683
+ // Add basket details in case of BillSafe or invoicing over heidelpay
684
+ $basket = array();
685
+ if ($completeBasket) {
686
+ $basket = $this->getBasket($order);
687
+ }
688
+
689
+ return array_merge($basket, $data);
690
+ }
691
+
692
+ /**
693
+ * Getter for the payment method backend title
694
+ *
695
+ * @return string payment method title
696
+ */
697
+ public function getAdminTitle()
698
+ {
699
+ return $this->getTitle();
700
+ }
701
+
702
+ /**
703
+ * Getter for the payment method frontend title
704
+ *
705
+ * @return string payment method title
706
+ */
707
+ public function getTitle()
708
+ {
709
+ $storeId = $this->getStore();
710
+ $path = "payment/" . $this->_code . "/";
711
+ return $this->_getHelper()->__(Mage::getStoreConfig($path . "title", $storeId));
712
+ }
713
+
714
+ /**
715
+ * Api call to capture a given amount on an invoice
716
+ *
717
+ * @param $payment Mage_Sales_Model_Order_Payment current payment object
718
+ * @param $amount float amount to capture
719
+ *
720
+ * @return $this
721
+ */
722
+ public function capture(Varien_Object $payment, $amount)
723
+ {
724
+ $criterion = array();
725
+
726
+ $order = $payment->getOrder();
727
+ $this->log('StoreId' . $order->getStoreId());
728
+ if ($this->canCapture()) {
729
+ $authorisationModel = Mage::getModel('hcd/transaction');
730
+ /**
731
+ * @var $authorisation HeidelpayCD_Edition_Model_Transaction
732
+ */
733
+ $authorisation = $authorisationModel->getOneTransactionByMethode(
734
+ $order->getRealOrderId(),
735
+ 'PA'
736
+ );
737
+
738
+
739
+ if ($authorisation === false) {
740
+ Mage::throwException(Mage::helper('hcd')->__('This Transaction could not be capture online.'));
741
+ return $this;
742
+ }
743
+
744
+ $config = $this->getMainConfig($this->_code, $authorisation['CRITERION_STOREID']);
745
+ $config['PAYMENT.TYPE'] = 'CP';
746
+
747
+
748
+ $frontend = $this->getFrontend($order->getRealOrderId(), $authorisation['CRITERION_STOREID']);
749
+ $frontend['FRONTEND.MODE'] = 'DEFAULT';
750
+ $frontend['FRONTEND.ENABLED'] = 'false';
751
+
752
+ $user = $this->getUser($order, true);
753
+ $basketdetails = ($this->_code == 'hcdbs') ? true : false; // If billsafe set to fin
754
+ $basketData = $this->getBasketData($order, $basketdetails, $amount);
755
+
756
+ $basketData['IDENTIFICATION.REFERENCEID'] = $authorisation['IDENTIFICATION_UNIQUEID'];
757
+ Mage::dispatchEvent(
758
+ 'heidelpay_capture_bevor_preparePostData', array(
759
+ 'payment' => $payment,
760
+ 'config' => $config,
761
+ 'frontend' => $frontend,
762
+ 'user' => $user,
763
+ 'basketData' => $basketData,
764
+ 'criterion' => $criterion
765
+ )
766
+ );
767
+ $params = Mage::helper('hcd/payment')->preparePostData(
768
+ $config, $frontend, $user, $basketData,
769
+ $criterion
770
+ );
771
+
772
+
773
+ $this->log("doRequest url : " . $config['URL']);
774
+ $this->log("doRequest params : " . json_encode($params));
775
+
776
+ $src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
777
+
778
+ $this->log("doRequest response : " . json_encode($src));
779
+
780
+
781
+
782
+ if ($src['PROCESSING_RESULT'] == "NOK") {
783
+ Mage::throwException('Heidelpay Error: ' . $src['PROCESSING_RETURN']);
784
+ return $this;
785
+ }
786
+
787
+ $payment->setTransactionId($src['IDENTIFICATION_UNIQUEID']);
788
+ Mage::getModel('hcd/transaction')->saveTransactionData($src);
789
+ }
790
+
791
+ return $this;
792
+ }
793
+
794
+ /**
795
+ * Calculate weather a order can be captured or not
796
+ *
797
+ * @return bool canCapture
798
+ */
799
+ public function canCapture()
800
+ {
801
+ //check weather this payment method supports capture
802
+
803
+ if ($this->_canCapture === false) {
804
+ return false;
805
+ }
806
+
807
+ // prevent frontend to capture an amount in case of direct booking with automatical invoice
808
+ if (Mage::app()->getStore()->getId() != 0) {
809
+ $this->log('try to capture amount in frontend ... this is not necessary !');
810
+ return false;
811
+ }
812
+
813
+ // loading order object to check wether this
814
+ $orderIncrementId = Mage::app()->getRequest()->getParam('order_id');
815
+ $this->log('$orderIncrementId ' . $orderIncrementId);
816
+ /**
817
+ * @var $order Mage_Sales_Model_Order order object
818
+ */
819
+ $order = Mage::getModel('sales/order');
820
+ $order->loadByAttribute('entity_id', (int)$orderIncrementId);
821
+ /**
822
+ * @var $transaction HeidelpayCD_Edition_Model_Transaction
823
+ */
824
+ $transaction = Mage::getModel('hcd/transaction');
825
+ if ($transaction->getOneTransactionByMethode($order->getRealOrderId(), 'PA') === false) {
826
+ $this->log('there is no preauthorisation for the order ' . $order->getRealOrderId());
827
+ return false;
828
+ }
829
+
830
+ return true;
831
+ }
832
+
833
+ /**
834
+ * Api call for refunding a given invoice
835
+ *
836
+ * @param Mage_Sales_Model_Order_Payment $payment current payment object
837
+ * @param float $amount amount to refund
838
+ *
839
+ * @return $this
840
+ */
841
+ public function refund(Varien_Object $payment, $amount)
842
+ {
843
+ /** @var $order Mage_Sales_Model_Order */
844
+ $order = $payment->getOrder();
845
+
846
+ /** @var $transaction HeidelpayCD_Edition_Model_Transaction */
847
+ $transaction = Mage::getModel('hcd/transaction');
848
+ $captureData = $transaction->loadLastTransactionDataByUniqeId((string)$payment->getRefundTransactionId());
849
+
850
+ $config = $this->getMainConfig($this->_code, $captureData['CRITERION_STOREID']);
851
+ $config['PAYMENT.TYPE'] = 'RF';
852
+ $frontend = $this->getFrontend($order->getRealOrderId(), $captureData['CRITERION_STOREID']);
853
+ $frontend['FRONTEND.MODE'] = 'DEFAULT';
854
+ $frontend['FRONTEND.ENABLED'] = 'false';
855
+ $user = $this->getUser($order, true);
856
+ $basketData = $this->getBasketData($order, false, $amount);
857
+ $basketData['IDENTIFICATION.REFERENCEID'] = (string)$payment->getRefundTransactionId();
858
+ $params = Mage::helper('hcd/payment')->preparePostData(
859
+ $config, $frontend, $user, $basketData,
860
+ $criterion = array()
861
+ );
862
+ $this->log("doRequest url : " . $config['URL']);
863
+ $this->log("doRequest params : " . json_encode($params));
864
+
865
+ $src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
866
+ $this->log("doRequest response : " . json_encode($src));
867
+ if ($src['PROCESSING_RESULT'] == "NOK") {
868
+ Mage::throwException('Heidelpay Error: ' . $src['PROCESSING_RETURN']);
869
+ return $this;
870
+ }
871
+
872
+ $payment->setTransactionId($src['IDENTIFICATION_UNIQUEID']);
873
+ Mage::getModel('hcd/transaction')->saveTransactionData($src);
874
+ return $this;
875
+ }
876
+
877
+ /**
878
+ * Getter for customer given plus family name
879
+ *
880
+ * @param $session Mage_Checkout_Model_Session checkout session
881
+ *
882
+ * @return string given plus family name
883
+ */
884
+ public function getCustomerName($session = false)
885
+ {
886
+ if ($session === true) {
887
+ $session = $this->getCheckout();
888
+ return $session->getQuote()->getBillingAddress()->getFirstname() . ' '
889
+ . $session->getQuote()->getBillingAddress()->getLastname();
890
+ }
891
+
892
+ return $this->getQuote()->getBillingAddress()->getFirstname() . ' '
893
+ . $this->getQuote()->getBillingAddress()->getLastname();
894
+ }
895
+
896
+ /**
897
+ * Save additional payment data of the customer to the database
898
+ *
899
+ * @param $data array additional payment information of the customer
900
+ * @param $uniqeID string payment reference of a account registration
901
+ */
902
+ public function saveCustomerData($data, $uniqeID = null)
903
+ {
904
+ /** @var $customerData HeidelpayCD_Edition_Model_Customer */
905
+ $customerData = Mage::getModel('hcd/customer');
906
+
907
+ if ($this->getCustomerData() !== false) {
908
+ $lastdata = $this->getCustomerData();
909
+ $customerData->load($lastdata['id']);
910
+ }
911
+
912
+ $this->log('StoreID :' . Mage::app()->getStore()->getId());
913
+ $customerId = $this->getQuote()->getBillingAddress()->getCustomerId();
914
+ $storeId = Mage::app()->getStore()->getId();
915
+ if ($customerId == 0) {
916
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
917
+ $customerId = $visitorData['visitor_id'];
918
+ $storeId = 0;
919
+ }
920
+
921
+ $customerData->setPaymentmethode($this->_code);
922
+ $customerData->setUniqeid($uniqeID);
923
+ $customerData->setCustomerid($customerId);
924
+ $customerData->setStoreid($storeId);
925
+ $data['SHIPPPING_HASH'] = $this->getShippingHash();
926
+ $customerData->setPaymentData(Mage::getModel('hcd/resource_encryption')->encrypt(json_encode($data)));
927
+
928
+ $customerData->save();
929
+ }
930
+
931
+ /**
932
+ * Generates a customer message for the success page
933
+ *
934
+ * Will be used for prepayment and direct debit to show the customer
935
+ * the billing information
936
+ *
937
+ * @param $paymentData transaction details form heidelpay api
938
+ *
939
+ * @return bool| string customer message for the success page
940
+ */
941
+ public function showPaymentInfo($paymentData)
942
+ {
943
+ /*
944
+ * This function should not be modified please overwrite this function
945
+ * in the class of the used payment method !!!
946
+ */
947
+ return false;
948
+ }
949
+
950
+ /**
951
+ * Handle charge back notices from heidelpay payment
952
+ *
953
+ * @param $order Mage_Sales_Model_Order
954
+ * @param $message string order history message
955
+ *
956
+ * @return Mage_Sales_Model_Order
957
+ */
958
+ public function chargeBackTransaction($order, $message="")
959
+ {
960
+ // message block for direct debit charge back
961
+ if ($order->hasInvoices()) {
962
+ $invIncrementIDs = array();
963
+ /** @var $invoice Mage_Sales_Model_Order_Invoice */
964
+ foreach ($order->getInvoiceCollection() as $invoice) {
965
+ $this->log('Invoice Number ' . (string)$invoice->getIncrementId());
966
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
967
+ $invoice->setIsPaid(false);
968
+ // @codingStandardsIgnoreLine use of save in a loop
969
+ $invoice->save();
970
+ }
971
+
972
+ $order->setIsInProcess(false);
973
+ $order->setTotalInvoiced(0);
974
+ $order->setTotalPaid(0);
975
+ }
976
+
977
+ $order->setState(
978
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
979
+ true,
980
+ $message
981
+ );
982
+
983
+ return $order;
984
+ }
985
+
986
+ /**
987
+ * Handle transaction with an not ok status
988
+ *
989
+ * @param $order Mage_Sales_Model_Order
990
+ * @param $message string order history message
991
+ *
992
+ * @return Mage_Sales_Model_Order
993
+ */
994
+ public function canceledTransaction($order, $message)
995
+ {
996
+ if ($order->canCancel()) {
997
+ $order->cancel();
998
+
999
+ $order->setState(
1000
+ $order->getPayment()->getMethodInstance()->getStatusError(false),
1001
+ $order->getPayment()->getMethodInstance()->getStatusError(true),
1002
+ $message
1003
+ );
1004
+ }
1005
+
1006
+ return $order;
1007
+ }
1008
+
1009
+ /**
1010
+ * Handle transaction with means processing
1011
+ *
1012
+ * @param $order Mage_Sales_Model_Order
1013
+ * @param $data HeidelpayCD_Edition_Model_Transaction
1014
+ * @param $message string order history message
1015
+ *
1016
+ * @return Mage_Sales_Model_Order
1017
+ */
1018
+ public function processingTransaction($order, $data, $message='')
1019
+ {
1020
+
1021
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
1022
+ $paymentHelper = Mage::helper('hcd/payment');
1023
+
1024
+
1025
+ $message = ($message === '') ? 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] : $message;
1026
+ $totallyPaid = false;
1027
+
1028
+ $order->getPayment()
1029
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
1030
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
1031
+ ->setIsTransactionClosed(true);
1032
+
1033
+ if ($paymentHelper->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and
1034
+ $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']
1035
+ ) {
1036
+ $order->setState(
1037
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
1038
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
1039
+ $message
1040
+ );
1041
+ $totallyPaid = true;
1042
+ } else {
1043
+ /*
1044
+ * in case rc is ack and amount is to low or currency miss match
1045
+ */
1046
+ $order->setState(
1047
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
1048
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
1049
+ $message
1050
+ );
1051
+ }
1052
+
1053
+ $code = $order->getPayment()->getMethodInstance()->getCode();
1054
+
1055
+ $path = "payment/" . $code . "/";
1056
+ $autoInvoice = (Mage::getStoreConfig($path . "invioce", $data['CRITERION_STOREID']) == 1) ? true : false;
1057
+
1058
+ $this->log('Auto invoiced :'. (string) $autoInvoice);
1059
+
1060
+ if ($order->canInvoice() and ($autoInvoice or $code == 'hcdbs') and $totallyPaid === true) {
1061
+ $invoice = $order->prepareInvoice();
1062
+ $invoice->register()->capture();
1063
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
1064
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
1065
+ $invoice->setIsPaid(true);
1066
+ $order->setIsInProcess(true);
1067
+ $order->addStatusHistoryComment(
1068
+ Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
1069
+ false
1070
+ );
1071
+ $invoice->save();
1072
+
1073
+ if ($this->_invoiceOrderEmail) {
1074
+ if ($code != 'hcdpp' and $code != 'hcdiv') {
1075
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
1076
+ $invoiceMailComment = ($info === false) ? '' : '<h3>'
1077
+ . $this->_getHelper()->__('Payment Information') . '</h3>' . $info . '<br/>';
1078
+ }
1079
+
1080
+ $invoice->sendEmail(true, $invoiceMailComment); // send invoice mail
1081
+ }
1082
+
1083
+
1084
+ $transactionSave = Mage::getModel('core/resource_transaction')
1085
+ ->addObject($invoice)
1086
+ ->addObject($invoice->getOrder());
1087
+ $transactionSave->save();
1088
+ }
1089
+
1090
+ $order->getPayment()->addTransaction(
1091
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
1092
+ null,
1093
+ true,
1094
+ $message
1095
+ );
1096
+
1097
+ $order->setIsInProcess(true);
1098
+
1099
+ return $order;
1100
+ }
1101
+
1102
+ /**
1103
+ * Handle transaction with means pending
1104
+ *
1105
+ * @param $order Mage_Sales_Model_Order
1106
+ * @param $data HeidelpayCD_Edition_Model_Transaction
1107
+ * @param $message string order history message
1108
+ *
1109
+ * @return Mage_Sales_Model_Order
1110
+ */
1111
+ public function pendingTransaction($order, $data, $message='')
1112
+ {
1113
+ $message = 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] .' '.$message;
1114
+
1115
+ $order->getPayment()->setTransactionId($data['IDENTIFICATION_UNIQUEID']);
1116
+
1117
+ $order->getPayment()->setIsTransactionClosed(0);
1118
+
1119
+ $order->getPayment()->setTransactionAdditionalInfo(
1120
+ Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
1121
+ null
1122
+ );
1123
+
1124
+ $this->log('Set Transaction to Pending : ');
1125
+ $order->setState(
1126
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
1127
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
1128
+ $message
1129
+ );
1130
+ $order->getPayment()->addTransaction(
1131
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
1132
+ null,
1133
+ true,
1134
+ $message
1135
+ );
1136
+ return $order;
1137
+ }
1138
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/AbstractSecuredPaymentMethods.php ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Abstract payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods extends HeidelpayCD_Edition_Model_Payment_Abstract
19
+ {
20
+ /**
21
+ * validation helper
22
+ *
23
+ * @var $_validatorHelper HeidelpayCD_Edition_Helper_Validator
24
+ */
25
+ protected $_validatorHelper;
26
+ /**
27
+ * send basket information to basket api
28
+ *
29
+ * @var bool send basket information to basket api
30
+ */
31
+ protected $_canBasketApi = false;
32
+
33
+ /**
34
+ * set checkout form block
35
+ *
36
+ * @var string checkout form block
37
+ */
38
+ protected $_formBlockType = 'hcd/form_invoiceSecured';
39
+
40
+ /**
41
+ * over write existing info block
42
+ *
43
+ * @var string
44
+ */
45
+ protected $_infoBlockType = 'hcd/info_invoice';
46
+
47
+ /**
48
+ * validated parameter
49
+ *
50
+ * @var array validated parameter
51
+ */
52
+ protected $_validatedParameters = array();
53
+
54
+ /**
55
+ * post data from checkout
56
+ *
57
+ * @var $_postPayload array post data from checkout
58
+ */
59
+ protected $_postPayload = array();
60
+
61
+ /**
62
+ * HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods constructor.
63
+ *
64
+ * @param $emptyArray array empty array from upstream
65
+ * @param HeidelpayCD_Edition_Helper_Validator $validatorHelper
66
+ */
67
+ // @codingStandardsIgnoreLine magento sets an empty array
68
+ public function __construct()
69
+ {
70
+ $this->_validatorHelper = Mage::helper('hcd/validator');
71
+ }
72
+
73
+ /**
74
+ * Over wright from block
75
+ *
76
+ * @return string
77
+ */
78
+ public function getFormBlockType()
79
+ {
80
+ return $this->_formBlockType;
81
+ }
82
+
83
+ /**
84
+ * is payment method available
85
+ *
86
+ * @param null $quote
87
+ *
88
+ * @return bool is payment method available
89
+ */
90
+ public function isAvailable($quote = null)
91
+ {
92
+ $billing = $this->getQuote()->getBillingAddress();
93
+ $shipping = $this->getQuote()->getShippingAddress();
94
+
95
+ /* billing and shipping address has to match */
96
+ if (($billing->getFirstname() != $shipping->getFirstname()) or
97
+ ($billing->getLastname() != $shipping->getLastname()) or
98
+ ($billing->getStreet() != $shipping->getStreet()) or
99
+ ($billing->getPostcode() != $shipping->getPostcode()) or
100
+ ($billing->getCity() != $shipping->getCity()) or
101
+ ($billing->getCountry() != $shipping->getCountry())
102
+ ) {
103
+ return false;
104
+ }
105
+
106
+ /* payment method is b2c only */
107
+ if (!empty($billing->getCompany())) {
108
+ return false;
109
+ }
110
+
111
+ return parent::isAvailable($quote);
112
+ }
113
+
114
+ /**
115
+ * Validate customer input on checkout
116
+ *
117
+ * @return $this
118
+ */
119
+ public function validate()
120
+ {
121
+ parent::validate();
122
+
123
+ if (isset($this->_postPayload['method']) and $this->_postPayload['method'] == $this->_code) {
124
+ if (array_key_exists($this->_code . '_salutation', $this->_postPayload)) {
125
+ $this->_validatedParameters['NAME.SALUTATION'] =
126
+ (
127
+ $this->_postPayload[$this->_code . '_salutation'] == 'MR' or
128
+ $this->_postPayload[$this->_code . '_salutation'] == 'MRS'
129
+ )
130
+ ? $this->_postPayload[$this->_code . '_salutation'] : '';
131
+ }
132
+
133
+ if (array_key_exists($this->_code . '_dobday', $this->_postPayload) &&
134
+ array_key_exists($this->_code . '_dobmonth', $this->_postPayload) &&
135
+ array_key_exists($this->_code . '_dobyear', $this->_postPayload)
136
+ ) {
137
+ $day = (int)$this->_postPayload[$this->_code . '_dobday'];
138
+ $mounth = (int)$this->_postPayload[$this->_code . '_dobmonth'];
139
+ $year = (int)$this->_postPayload[$this->_code . '_dobyear'];
140
+
141
+ if ($this->_validatorHelper->validateDateOfBirth($day, $mounth, $year)) {
142
+ $this->_validatedParameters['NAME.BIRTHDATE']
143
+ = $year . '-' . sprintf("%02d", $mounth) . '-' . sprintf("%02d", $day);
144
+ } else {
145
+ Mage::throwException(
146
+ $this->_getHelper()
147
+ ->__('The minimum age is 18 years for this payment methode.')
148
+ );
149
+ }
150
+ }
151
+
152
+
153
+ $this->saveCustomerData($this->_validatedParameters);
154
+ }
155
+
156
+ return $this;
157
+ }
158
+
159
+ /**
160
+ * Payment information for invoice mail
161
+ *
162
+ * @param array $paymentData transaction response
163
+ *
164
+ * @return string return payment information text
165
+ */
166
+ public function showPaymentInfo($paymentData)
167
+ {
168
+ $loadSnippet = $this->_getHelper()->__("Invoice Info Text");
169
+
170
+ $replace = array(
171
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
172
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
173
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CONNECTOR_ACCOUNT_HOLDER'],
174
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CONNECTOR_ACCOUNT_IBAN'],
175
+ '{CONNECTOR_ACCOUNT_BIC}' => $paymentData['CONNECTOR_ACCOUNT_BIC'],
176
+ '{IDENTIFICATION_SHORTID}' => $paymentData['IDENTIFICATION_SHORTID'],
177
+ );
178
+
179
+ return strtr($loadSnippet, $replace);
180
+ }
181
+
182
+ /**
183
+ * Handle transaction with means pending
184
+ *
185
+ * @param $order Mage_Sales_Model_Order
186
+ * @param $data HeidelpayCD_Edition_Model_Transaction
187
+ * @param $message string order history message
188
+ *
189
+ * @return Mage_Sales_Model_Order
190
+ */
191
+ public function pendingTransaction($order, $data, $message = '')
192
+ {
193
+ $message = 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] . ' ' . $message;
194
+
195
+ $order->getPayment()
196
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
197
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
198
+ ->setIsTransactionClosed(false);
199
+
200
+ $invoice = $order->prepareInvoice();
201
+ $invoice->register();
202
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
203
+ $order->setIsInProcess(true);
204
+ $invoice->setIsPaid(false);
205
+ $order->addStatusHistoryComment(
206
+ Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
207
+ false
208
+ );
209
+ $invoice->save();
210
+ if ($this->_invoiceOrderEmail) {
211
+ $code = $order->getPayment()->getMethodInstance()->getCode();
212
+ if ($code == 'hcdiv' or $code == 'hcdivsec') {
213
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
214
+ $invoiceMailComment = ($info === false) ? '' : '<h3>'
215
+ . $this->_getHelper()->__('payment information') . '</h3><p>' . $info . '</p>';
216
+ }
217
+
218
+ $invoice->sendEmail(true, $invoiceMailComment); // send invoice mail
219
+ }
220
+
221
+
222
+ $transactionSave = Mage::getModel('core/resource_transaction')
223
+ ->addObject($invoice)
224
+ ->addObject($invoice->getOrder());
225
+ $transactionSave->save();
226
+
227
+ $this->log('Set transaction to processed and generate invoice ');
228
+ $order->setState(
229
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
230
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
231
+ $message
232
+ );
233
+
234
+ $order->getPayment()->addTransaction(
235
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
236
+ null,
237
+ true,
238
+ $message
239
+ );
240
+
241
+ return $order;
242
+ }
243
+
244
+ /**
245
+ * Handle transaction with means processing
246
+ *
247
+ * @param $order Mage_Sales_Model_Order
248
+ * @param $data HeidelpayCD_Edition_Model_Transaction
249
+ * @param $message string order history message
250
+ *
251
+ * @return Mage_Sales_Model_Order
252
+ */
253
+ public function processingTransaction($order, $data, $message = '')
254
+ {
255
+
256
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
257
+ $paymentHelper = Mage::helper('hcd/payment');
258
+
259
+
260
+ $message = ($message === '') ? 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] : $message;
261
+ $totallyPaid = false;
262
+
263
+ $order->getPayment()
264
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
265
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
266
+ ->setIsTransactionClosed(true);
267
+
268
+ if ($paymentHelper->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and
269
+ $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']
270
+ ) {
271
+ $order->setState(
272
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
273
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
274
+ $message
275
+ );
276
+ $totallyPaid = true;
277
+ } else {
278
+ // in case rc is ack and amount is to low or currency miss match
279
+
280
+ $order->setState(
281
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
282
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
283
+ $message
284
+ );
285
+ }
286
+
287
+ // Set invoice to paid when the total amount matches
288
+ if ($order->hasInvoices() and $totallyPaid) {
289
+
290
+ /** @var $invoice Mage_Sales_Model_Order_Invoice */
291
+ foreach ($order->getInvoiceCollection() as $invoice) {
292
+ $this->log('Set invoice ' . (string)$invoice->getIncrementId() . ' to paid.');
293
+ $invoice
294
+ ->capture()
295
+ ->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID)
296
+ ->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
297
+ ->setIsPaid(true)
298
+ // @codingStandardsIgnoreLine use of save in a loop
299
+ ->save();
300
+
301
+ $transactionSave = Mage::getModel('core/resource_transaction')
302
+ ->addObject($invoice)
303
+ ->addObject($invoice->getOrder());
304
+ // @codingStandardsIgnoreLine use of save in a loop
305
+ $transactionSave->save();
306
+ }
307
+ }
308
+
309
+ // Set total paid and invoice to the connector amount
310
+ $order->setTotalInvoiced($data['PRESENTATION_AMOUNT']);
311
+ $order->setTotalPaid($data['PRESENTATION_AMOUNT']);
312
+
313
+
314
+ $order->getPayment()->addTransaction(
315
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
316
+ null,
317
+ true,
318
+ $message
319
+ );
320
+
321
+ $order->setIsInProcess(true);
322
+
323
+ return $order;
324
+ }
325
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/HcdDirectDebitSecured.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Direct debit secured payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_HcdDirectDebitSecured extends HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods
19
+ {
20
+ /**
21
+ * payment code
22
+ *
23
+ * @var string payment code
24
+ */
25
+ protected $_code = 'hcdddsec';
26
+
27
+ /**
28
+ * set checkout form block
29
+ *
30
+ * @var string checkout form block
31
+ */
32
+ protected $_formBlockType = 'hcd/form_directDebitSecured';
33
+
34
+ /**
35
+ * over write existing info block
36
+ *
37
+ * @var string
38
+ */
39
+ protected $_infoBlockType = 'hcd/info_directDebit';
40
+
41
+ /**
42
+ * Validate customer input on checkout
43
+ *
44
+ * @return $this
45
+ */
46
+ public function validate()
47
+ {
48
+ $this->_postPayload = Mage::app()->getRequest()->getPOST('payment');
49
+
50
+ if (isset($this->_postPayload['method']) and $this->_postPayload['method'] == $this->_code) {
51
+ parent::validate();
52
+
53
+ if (empty($this->_postPayload[$this->_code . '_holder'])) {
54
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
55
+ }
56
+
57
+ if (empty($this->_postPayload[$this->_code . '_iban'])) {
58
+ Mage::throwException($this->_getHelper()->__('Please specify a iban or account'));
59
+ }
60
+
61
+ $this->_validatedParameters['ACCOUNT.HOLDER'] = $this->_postPayload[$this->_code . '_holder'];
62
+
63
+ if (preg_match('#^[\d]#', $this->_postPayload[$this->_code . '_iban'])) {
64
+ $this->_validatedParameters['ACCOUNT.NUMBER'] = $this->_postPayload[$this->_code . '_iban'];
65
+ } else {
66
+ $this->_validatedParameters['ACCOUNT.IBAN'] = $this->_postPayload[$this->_code . '_iban'];
67
+ }
68
+
69
+ parent::validate();
70
+ }
71
+
72
+ return $this;
73
+ }
74
+
75
+ /**
76
+ * Payment information for invoice mail
77
+ *
78
+ * @param $paymentData array transaction response
79
+ *
80
+ * @return string return payment information text
81
+ */
82
+ public function showPaymentInfo($paymentData)
83
+ {
84
+ $loadSnippet = $this->_getHelper()->__("Direct Debit Info Text");
85
+
86
+ $repl = array(
87
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
88
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
89
+ '{Iban}' => $paymentData['ACCOUNT_IBAN'],
90
+ '{Ident}' => $paymentData['ACCOUNT_IDENTIFICATION'],
91
+ '{CreditorId}' => $paymentData['IDENTIFICATION_CREDITOR_ID'],
92
+ );
93
+
94
+ return strtr($loadSnippet, $repl);
95
+ }
96
+
97
+ /**
98
+ * @inheritdoc
99
+ */
100
+ public function chargeBack($order, $message = "")
101
+ {
102
+ $message = Mage::helper('hcd')->__('debit failed');
103
+ return parent::chargeBack($order, $message);
104
+ }
105
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/HcdInvoiceSecured.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Invoice secured payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_HcdInvoiceSecured extends HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods
19
+ {
20
+ /**
21
+ * payment code
22
+ *
23
+ * @var string payment code
24
+ */
25
+ protected $_code = 'hcdivsec';
26
+
27
+ /**
28
+ * @inheritdoc
29
+ */
30
+ public function validate()
31
+ {
32
+ $this->_postPayload = Mage::app()->getRequest()->getPOST('payment');
33
+ return parent::validate();
34
+ }
35
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdbs.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * BillSafe payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the License Agreement.
7
+ * @copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_Hcdbs extends HeidelpayCD_Edition_Model_Payment_Abstract
19
+ {
20
+ /** @var $_code string payment method code */
21
+ protected $_code = 'hcdbs';
22
+ /** @var $_canRefund bool */
23
+ protected $_canRefund = false;
24
+ /** @var $_canRefundInvoicePartial bool */
25
+ protected $_canRefundInvoicePartial = false;
26
+
27
+ /** @var $_basketApiHelper HeidelpayCD_Edition_Helper_BasketApi */
28
+ protected $_basketApiHelper;
29
+
30
+ /**
31
+ * HeidelpayCD_Edition_Model_Payment_Hcdbs constructor.
32
+ */
33
+ public function __construct()
34
+ {
35
+ parent::__construct();
36
+ $this->_basketApiHelper = Mage::helper('hcd/basketApi');
37
+ }
38
+
39
+ /**
40
+ * @inheritdoc
41
+ */
42
+ public function isAvailable($quote = null)
43
+ {
44
+ $billing = $this->getQuote()->getBillingAddress();
45
+ $shipping = $this->getQuote()->getShippingAddress();
46
+
47
+ if (($billing->getFirstname() != $shipping->getFirstname()) or
48
+ ($billing->getLastname() != $shipping->getLastname()) or
49
+ ($billing->getStreet() != $shipping->getStreet()) or
50
+ ($billing->getPostcode() != $shipping->getPostcode()) or
51
+ ($billing->getCity() != $shipping->getCity()) or
52
+ ($billing->getCountry() != $shipping->getCountry())
53
+ ) {
54
+ return false;
55
+ }
56
+
57
+ return parent::isAvailable($quote);
58
+ }
59
+
60
+ /**
61
+ * @inheritdoc
62
+ */
63
+ public function showPaymentInfo($paymentData)
64
+ {
65
+ $loadSnippet = $this->_getHelper()->__("BillSafe Info Text");
66
+
67
+ $replace = array(
68
+ '{LEGALNOTE}' => $paymentData['CRITERION_BILLSAFE_LEGALNOTE'],
69
+ '{AMOUNT}' => $paymentData['CRITERION_BILLSAFE_AMOUNT'],
70
+ '{CURRENCY}' => $paymentData['CRITERION_BILLSAFE_CURRENCY'],
71
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CRITERION_BILLSAFE_RECIPIENT'],
72
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CRITERION_BILLSAFE_IBAN'],
73
+ '{CONNECTOR_ACCOUNT_BIC}' => $paymentData['CRITERION_BILLSAFE_BIC'],
74
+ '{IDENTIFICATION_SHORTID}' => $paymentData['CRITERION_BILLSAFE_REFERENCE'],
75
+ '{PERIOD}' => $paymentData['CRITERION_BILLSAFE_PERIOD']
76
+ );
77
+
78
+ $loadSnippet = strtr($loadSnippet, $replace);
79
+
80
+
81
+ return $loadSnippet;
82
+ }
83
+
84
+ /**
85
+ * @inheritdoc
86
+ */
87
+ public function processingTransaction($order, $data, $message='')
88
+ {
89
+ $message = 'BillSafe Id: ' . $data['CRITERION_BILLSAFE_REFERENCE'];
90
+ parent::processingTransaction($order, $data, $message);
91
+ }
92
+
93
+ /**
94
+ * Prepare basket items for BillSafe
95
+ *
96
+ * @param $order Mage_Sales_Model_Order magento order object
97
+ *
98
+ * @return array basket details for heidelpay billSafe api call
99
+ */
100
+ public function getBasket($order)
101
+ {
102
+ $parameters =array();
103
+ $items = $order->getAllVisibleItems();
104
+ $itemCount = 0;
105
+
106
+ if ($items) {
107
+ foreach ($items as $item) {
108
+ $itemCount++;
109
+ $prefix = 'CRITERION.POS_' . sprintf('%02d', $itemCount);
110
+
111
+ /** @var $item Mage_Sales_Model_Order_Item */
112
+ $quantity = (int)$item->getQtyOrdered();
113
+ $parameters[$prefix . '.POSITION'] = $itemCount;
114
+ $parameters[$prefix . '.QUANTITY'] = $quantity;
115
+ $parameters[$prefix . '.UNIT'] = 'Stk.'; // Liter oder so
116
+ $parameters[$prefix . '.AMOUNT_UNIT_GROSS'] =
117
+ floor(bcmul($item->getPriceInclTax(), 100, 10));
118
+ $parameters[$prefix . '.AMOUNT_GROSS'] =
119
+ floor(bcmul($item->getPriceInclTax() * $quantity, 100, 10));
120
+
121
+
122
+ $parameters[$prefix . '.TEXT'] = $item->getName();
123
+ $parameters[$prefix . '.COL1'] = 'SKU:' . $item->getSku();
124
+ $parameters[$prefix . '.ARTICLE_NUMBER'] = $item->getProductId();
125
+ $parameters[$prefix . '.PERCENT_VAT'] = sprintf('%1.2f', $item->getTaxPercent());
126
+ $parameters[$prefix . '.ARTICLE_TYPE'] = 'goods';
127
+ }
128
+ }
129
+
130
+ if ($this->_basketApiHelper->getShippingNetPrice($order) > 0) {
131
+ $itemCount++;
132
+ $prefix = 'CRITERION.POS_' . sprintf('%02d', $itemCount);
133
+ $parameters[$prefix . '.POSITION'] = $itemCount;
134
+ $parameters[$prefix . '.QUANTITY'] = '1';
135
+ $parameters[$prefix . '.UNIT'] = 'Stk.'; // Liter oder so
136
+ $parameters[$prefix . '.AMOUNT_UNIT_GROSS'] = floor(
137
+ bcmul(
138
+ (($order->getShippingAmount() - $order->getShippingRefunded())
139
+ * (1 + $this->_basketApiHelper->getShippingTaxPercent($order) / 100)),
140
+ 100, 10
141
+ )
142
+ );
143
+ $parameters[$prefix . '.AMOUNT_GROSS'] = floor(
144
+ bcmul(
145
+ (($order->getShippingAmount() - $order->getShippingRefunded())
146
+ * (1 + $this->_basketApiHelper->getShippingTaxPercent($order) / 100)),
147
+ 100, 10
148
+ )
149
+ );
150
+
151
+ $parameters[$prefix . '.TEXT'] = 'Shipping';
152
+ $parameters[$prefix . '.ARTICLE_NUMBER'] = '0';
153
+ $parameters[$prefix . '.PERCENT_VAT'] = $this->_basketApiHelper->getShippingTaxPercent($order);
154
+ $parameters[$prefix . '.ARTICLE_TYPE'] = 'shipment';
155
+ }
156
+
157
+ if ($order->getDiscountAmount() < 0) {
158
+ $itemCount++;
159
+ $prefix = 'CRITERION.POS_' . sprintf('%02d', $itemCount);
160
+ $parameters[$prefix . '.POSITION'] = $itemCount;
161
+ $parameters[$prefix . '.QUANTITY'] = '1';
162
+ $parameters[$prefix . '.UNIT'] = 'Stk.'; // Liter oder so
163
+ $parameters[$prefix . '.AMOUNT_UNIT_GROSS'] = floor(bcmul($order->getDiscountAmount(), 100, 10));
164
+ $parameters[$prefix . '.AMOUNT_GROSS'] = floor(bcmul($order->getDiscountAmount(), 100, 10));
165
+
166
+ $parameters[$prefix . '.TEXT'] = 'Voucher';
167
+ $parameters[$prefix . '.ARTICLE_NUMBER'] = '0';
168
+ $parameters[$prefix . '.PERCENT_VAT'] = '0.00';
169
+ $parameters[$prefix . '.ARTICLE_TYPE'] = 'voucher';
170
+ }
171
+
172
+ return $parameters;
173
+ }
174
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdcc.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Credit card payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdcc extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * @var string payment code of the method
21
+ */
22
+ protected $_code = 'hcdcc';
23
+ /**
24
+ * @var bool this payment method is able to capture
25
+ */
26
+ protected $_canCapture = true;
27
+ /**
28
+ * @var bool this payment method is capable of partly capture
29
+ */
30
+ protected $_canCapturePartial = true;
31
+
32
+ /**
33
+ * @inheritdoc
34
+ */
35
+ public function isRecognition()
36
+ {
37
+ $path = "payment/".$this->_code."/";
38
+ $storeId = Mage::app()->getStore()->getId();
39
+ return Mage::getStoreConfig($path.'recognition', $storeId);
40
+ }
41
+
42
+ /**
43
+ * @inheritdoc
44
+ */
45
+ public function activeRedirect()
46
+ {
47
+ $recognition = $this->isRecognition();
48
+ if ($recognition > 0) {
49
+ return true;
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * @inheritdoc
57
+ */
58
+ protected $_formBlockType = 'hcd/form_creditcard';
59
+
60
+ /**
61
+ * @inheritdoc
62
+ */
63
+ public function getFormBlockType()
64
+ {
65
+ return $this->_formBlockType;
66
+ }
67
+
68
+ /**
69
+ * @inheritdoc
70
+ */
71
+ public function chargeBack($order, $message = "")
72
+ {
73
+ $message = Mage::helper('hcd')->__('chargeback');
74
+ return parent::chargeBack($order, $message);
75
+ }
76
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcddc.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Debit card payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcddc extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcddc';
20
+ protected $_canCapture = true;
21
+ protected $_canCapturePartial = true;
22
+
23
+ /**
24
+ * @inheritdoc
25
+ */
26
+ public function isRecognition()
27
+ {
28
+ $path = "payment/".$this->_code."/";
29
+ $storeId = Mage::app()->getStore()->getId();
30
+ return Mage::getStoreConfig($path.'recognition', $storeId);
31
+ }
32
+
33
+ /**
34
+ * @inheritdoc
35
+ */
36
+ public function activeRedirect()
37
+ {
38
+ $recognation = $this->isRecognition();
39
+ if ($recognation > 0) {
40
+ return true;
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ /**
47
+ * @inheritdoc
48
+ */
49
+ protected $_formBlockType = 'hcd/form_creditcard';
50
+
51
+ /**
52
+ * @inheritdoc
53
+ */
54
+ public function getFormBlockType()
55
+ {
56
+ return $this->_formBlockType;
57
+ }
58
+
59
+ /**
60
+ * @inheritdoc
61
+ */
62
+ public function chargeBack($order, $message = "")
63
+ {
64
+ $message = Mage::helper('hcd')->__('chargeback');
65
+ return parent::chargeBack($order, $message);
66
+ }
67
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcddd.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcddd extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcddd';
20
+ protected $_canCapture = true;
21
+ protected $_canCapturePartial = true;
22
+ protected $_formBlockType = 'hcd/form_debit';
23
+ /**
24
+ * over write existing info block
25
+ *
26
+ * @var string
27
+ */
28
+ protected $_infoBlockType = 'hcd/info_directDebit';
29
+
30
+ public function getFormBlockType()
31
+ {
32
+ return $this->_formBlockType;
33
+ }
34
+
35
+ public function validate()
36
+ {
37
+ parent::validate();
38
+ $payment = array();
39
+ $params = array();
40
+ $payment = Mage::app()->getRequest()->getPOST('payment');
41
+
42
+
43
+ if (isset($payment['method']) and $payment['method'] == $this->_code) {
44
+ if (empty($payment[$this->_code.'_holder'])) {
45
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
46
+ }
47
+
48
+ if (empty($payment[$this->_code.'_iban'])) {
49
+ Mage::throwException($this->_getHelper()->__('Please specify a iban or account'));
50
+ }
51
+
52
+ $params['ACCOUNT.HOLDER'] = $payment[$this->_code.'_holder'];
53
+
54
+ $params['ACCOUNT.IBAN'] = $payment[$this->_code.'_iban'];
55
+
56
+
57
+ $this->saveCustomerData($params);
58
+ }
59
+
60
+ return $this;
61
+ }
62
+
63
+ public function showPaymentInfo($paymentData)
64
+ {
65
+ $loadSnippet = $this->_getHelper()->__("Direct Debit Info Text");
66
+
67
+ $repl = array(
68
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
69
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
70
+ '{Iban}' => $paymentData['ACCOUNT_IBAN'],
71
+ '{Ident}' => $paymentData['ACCOUNT_IDENTIFICATION'],
72
+ '{CreditorId}' => $paymentData['IDENTIFICATION_CREDITOR_ID'],
73
+ );
74
+
75
+ return $loadSnippet= strtr($loadSnippet, $repl);
76
+ }
77
+
78
+ /**
79
+ * @inheritdoc
80
+ */
81
+ public function chargeBack($order, $message = "")
82
+ {
83
+ $message = Mage::helper('hcd')->__('debit failed');
84
+ return parent::chargeBack($order, $message);
85
+ }
86
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdeps.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * EPS payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdeps extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdeps';
20
+ protected $_canRefund = false;
21
+ protected $_canRefundInvoicePartial = false;
22
+
23
+ protected $_formBlockType = 'hcd/form_eps';
24
+
25
+ public function getFormBlockType()
26
+ {
27
+ return $this->_formBlockType;
28
+ }
29
+
30
+ public function validate()
31
+ {
32
+ parent::validate();
33
+ $payment = array();
34
+ $params = array();
35
+ $payment = Mage::app()->getRequest()->getPOST('payment');
36
+
37
+ if ($payment['method'] == $this->_code) {
38
+ if (empty($payment[$this->_code.'_holder'])) {
39
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
40
+ }
41
+
42
+ $params['ACCOUNT.HOLDER'] = $payment[$this->_code.'_holder'];
43
+
44
+ $params['ACCOUNT.BANKNAME'] = $payment[$this->_code.'_bank'];
45
+ $params['ACCOUNT.COUNTRY'] = $this->getQuote()->getBillingAddress()->getCountry();
46
+
47
+
48
+ $this->saveCustomerData($params);
49
+
50
+ return $this;
51
+ }
52
+
53
+ return $this;
54
+ }
55
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdgp.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Giropay payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdgp extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdgp';
20
+ protected $_canRefund = true;
21
+ protected $_canRefundInvoicePartial = true;
22
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdide.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ideal payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdide extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * unique internal payment method identifier
21
+ *
22
+ * @var string [a-z0-9_]
23
+ **/
24
+ protected $_code = 'hcdide';
25
+ protected $_canRefund = false;
26
+ protected $_canRefundInvoicePartial = false;
27
+
28
+ protected $_formBlockType = 'hcd/form_ideal';
29
+
30
+ public function getFormBlockType()
31
+ {
32
+ return $this->_formBlockType;
33
+ }
34
+
35
+ public function validate()
36
+ {
37
+ parent::validate();
38
+ $payment = array();
39
+ $params = array();
40
+ $payment = Mage::app()->getRequest()->getPOST('payment');
41
+
42
+ if ($payment['method'] == $this->_code) {
43
+ if (empty($payment[$this->_code.'_holder'])) {
44
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
45
+ }
46
+
47
+ $params['ACCOUNT.HOLDER'] = $payment[$this->_code.'_holder'];
48
+
49
+ $params['ACCOUNT.BANKNAME'] = $payment[$this->_code.'_bank'];
50
+ $params['ACCOUNT.COUNTRY'] = $this->getQuote()->getBillingAddress()->getCountry();
51
+
52
+
53
+ $this->saveCustomerData($params);
54
+
55
+ return $this;
56
+ }
57
+
58
+ return $this;
59
+ }
60
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdiv.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice unsecured payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdiv extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdiv';
20
+
21
+ /**
22
+ * over write existing info block
23
+ *
24
+ * @var string
25
+ */
26
+ protected $_infoBlockType = 'hcd/info_invoice';
27
+
28
+ /**
29
+ * Payment information for invoice mail
30
+ *
31
+ * @param array $paymentData transaction response
32
+ *
33
+ * @return string return payment information text
34
+ */
35
+ public function showPaymentInfo($paymentData)
36
+ {
37
+ $loadSnippet = $this->_getHelper()->__("Invoice Info Text");
38
+
39
+ $repl = array(
40
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
41
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
42
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CONNECTOR_ACCOUNT_HOLDER'],
43
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CONNECTOR_ACCOUNT_IBAN'],
44
+ '{CONNECTOR_ACCOUNT_BIC}' => $paymentData['CONNECTOR_ACCOUNT_BIC'],
45
+ '{IDENTIFICATION_SHORTID}' => $paymentData['IDENTIFICATION_SHORTID'],
46
+ );
47
+
48
+ return strtr($loadSnippet, $repl);
49
+ }
50
+
51
+ /**
52
+ * @inheritdoc
53
+ */
54
+ public function processingTransaction($order, $data, $message='')
55
+ {
56
+ $message = Mage::helper('hcd')->__('received amount ')
57
+ . $data['PRESENTATION_AMOUNT'] . ' ' . $data['PRESENTATION_CURRENCY'] . ' ' . $message;
58
+ parent::processingTransaction($order, $data, $message);
59
+ }
60
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdmk.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagirKart payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ *
16
+ * @deprecated This payment method is not longer available
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Payment_Hcdmk extends HeidelpayCD_Edition_Model_Payment_Abstract
20
+ {
21
+ protected $_code = 'hcdmk';
22
+ protected $_canRefund = false;
23
+ protected $_canRefundInvoicePartial = false;
24
+
25
+ public function isAvailable($quote=null)
26
+ {
27
+ $currencyCode=$this->getQuote()->getQuoteCurrencyCode();
28
+ if (!empty($currencyCode) && $currencyCode != 'TRY') {
29
+ return false;
30
+ }
31
+
32
+ return parent::isAvailable($quote);
33
+ }
34
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdmpa.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdmpa extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * unique internal payment method identifier
21
+ *
22
+ * @var string [a-z0-9_]
23
+ **/
24
+ protected $_code = 'hcdmpa';
25
+ protected $_canCapture = true;
26
+ protected $_canCapturePartial = true;
27
+ protected $_canRefund = true;
28
+ protected $_canRefundInvoicePartial = true;
29
+ protected $_canBasketApi = true;
30
+
31
+ protected $_formBlockType = 'hcd/form_masterpass';
32
+ protected $_infoBlockType = 'hcd/info_masterpass';
33
+
34
+ /**
35
+ public function isAvailable($quote=null) {
36
+ return true;
37
+ }
38
+ * @param mixed $code
39
+ * @param mixed $customerId
40
+ * @param mixed $storeId
41
+ */
42
+ public function getPaymentData()
43
+ {
44
+ $session = Mage::getSingleton('checkout/session');
45
+
46
+ if ($session->getHcdWallet() !== false) {
47
+ $hpdata = $session->getHcdWallet();
48
+
49
+ if ($hpdata['code'] != $this->_code) {
50
+ return '';
51
+ }
52
+
53
+ $html = (array_key_exists('mail', $hpdata)) ? $hpdata['mail'].'<br />' : '';
54
+ $html .= (array_key_exists('brand', $hpdata)) ? $this->_getHelper()->__($hpdata['brand']).' ' : '';
55
+ $html .= (array_key_exists('number', $hpdata)) ? $hpdata['number'].'<br/>' : '';
56
+ $html .= (array_key_exists('expiryMonth', $hpdata))
57
+ ? $this->_getHelper()->__('Expires').' '.$hpdata['expiryMonth'].'/' : '';
58
+ $html .= (array_key_exists('expiryYear', $hpdata)) ? $hpdata['expiryYear'] : '';
59
+
60
+ return $html;
61
+ }
62
+ }
63
+
64
+ /*
65
+ * MasterPass need shipping adress instead of billing (REV20150707 FullCheckout Adressen)
66
+ */
67
+ public function getUser($order, $isReg=false)
68
+ {
69
+ $user = array();
70
+
71
+ $user = parent::getUser($order, $isReg);
72
+ $adress = ($order->getShippingAddress() == false)
73
+ ? $order->getBillingAddress() : $order->getShippingAddress();
74
+ $email = ($adress->getEmail()) ? $adress->getEmail() : $order->getCustomerEmail();
75
+
76
+
77
+ $user['IDENTIFICATION.SHOPPERID'] = $adress->getCustomerId();
78
+ if ($adress->getCompany() == true) {
79
+ $user['NAME.COMPANY'] = trim($adress->getCompany());
80
+ }
81
+
82
+ $user['NAME.GIVEN'] = trim($adress->getFirstname());
83
+ $user['NAME.FAMILY'] = trim($adress->getLastname());
84
+ $user['ADDRESS.STREET'] = $adress->getStreet1()." ".$adress->getStreet2();
85
+ $user['ADDRESS.ZIP'] = $adress->getPostcode();
86
+ $user['ADDRESS.CITY'] = $adress->getCity();
87
+ $user['ADDRESS.COUNTRY'] = $adress->getCountry();
88
+ $user['CONTACT.EMAIL'] = $email;
89
+
90
+ return $user;
91
+ }
92
+
93
+ public function showPaymentInfo($paymentData)
94
+ {
95
+ $lang = Mage::app()->getLocale()->getLocaleCode();
96
+ switch ($lang) {
97
+ case 'de_DE':
98
+ case 'de_AT':
99
+ case 'de_CH':
100
+ $urlLang = 'de/DE';
101
+ break;
102
+ case 'fr_FR':
103
+ $urlLang = 'fr/FR';
104
+ break;
105
+ case 'en_GB':
106
+ case 'en_US':
107
+ default:
108
+ $urlLang = 'en/US';
109
+ break;
110
+ }
111
+
112
+ $html = '<center><button type="button" title="MasterPass"
113
+ class="btn-hcdmpa-payment-data" style="position: static"
114
+ onclick="window.open(\'https://www.mastercard.com/mc_us/wallet/learnmore/'.$urlLang.'\')">
115
+ </button>
116
+ <div sytle="margin-top: 10px !important;">';
117
+
118
+ $html .= (array_key_exists('CONTACT_EMAIL', $paymentData))
119
+ ? $paymentData['CONTACT_EMAIL'].'<br />' : '';
120
+ $html .= (array_key_exists('ACCOUNT_BRAND', $paymentData))
121
+ ? $this->_getHelper()->__($paymentData['ACCOUNT_BRAND']).' ' : '';
122
+ $html .= (array_key_exists('ACCOUNT_NUMBER', $paymentData))
123
+ ? $paymentData['ACCOUNT_NUMBER'].'<br/>' : '';
124
+ $html .= (array_key_exists('ACCOUNT_EXPIRY_MONTH', $paymentData))
125
+ ? $this->_getHelper()->__('Expires').' '.$paymentData['ACCOUNT_EXPIRY_MONTH'].'/' : '';
126
+ $html .= (array_key_exists('ACCOUNT_EXPIRY_YEAR', $paymentData))
127
+ ? $paymentData['ACCOUNT_EXPIRY_YEAR'] : '';
128
+
129
+ $html .= '</div></center>';
130
+
131
+ $this->getCheckout()->setHcdPaymentInfo($html);
132
+ }
133
+
134
+ /**
135
+ * @inheritdoc
136
+ */
137
+ public function chargeBack($order, $message = "")
138
+ {
139
+ $message = Mage::helper('hcd')->__('chargeback');
140
+ return parent::chargeBack($order, $message);
141
+ }
142
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdpal.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdpal extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * unique internal payment method identifier
21
+ *
22
+ * @var string [a-z0-9_]
23
+ **/
24
+ protected $_code = 'hcdpal';
25
+ protected $_canCapture = true;
26
+ protected $_canCapturePartial = true;
27
+
28
+ /*
29
+ * PayPal seller protection, need shipping adress instead of billing (PAYPAL REV 20141215)
30
+ */
31
+ public function getUser($order, $isReg=false)
32
+ {
33
+ $user = array();
34
+
35
+ $user = parent::getUser($order, $isReg);
36
+ $adress = ($order->getShippingAddress() == false)
37
+ ? $order->getBillingAddress() : $order->getShippingAddress();
38
+ $email = ($adress->getEmail()) ? $adress->getEmail() : $order->getCustomerEmail();
39
+
40
+
41
+ $user['IDENTIFICATION.SHOPPERID'] = $adress->getCustomerId();
42
+ if ($adress->getCompany() == true) {
43
+ $user['NAME.COMPANY'] = trim($adress->getCompany());
44
+ }
45
+
46
+ $user['NAME.GIVEN'] = trim($adress->getFirstname());
47
+ $user['NAME.FAMILY'] = trim($adress->getLastname());
48
+ $user['ADDRESS.STREET'] = $adress->getStreet1()." ".$adress->getStreet2();
49
+ $user['ADDRESS.ZIP'] = $adress->getPostcode();
50
+ $user['ADDRESS.CITY'] = $adress->getCity();
51
+ $user['ADDRESS.COUNTRY'] = $adress->getCountry();
52
+ $user['CONTACT.EMAIL'] = $email;
53
+
54
+ return $user;
55
+ }
56
+
57
+ /**
58
+ * @inheritdoc
59
+ */
60
+ public function chargeBack($order, $message = "")
61
+ {
62
+ $message = Mage::helper('hcd')->__('chargeback');
63
+ return parent::chargeBack($order, $message);
64
+ }
65
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdpf.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Postfinance payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdpf extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdpf';
20
+ protected $_canRefund = false;
21
+ protected $_canRefundInvoicePartial = false;
22
+ protected $_formBlockType = 'hcd/form_postfinance';
23
+
24
+ public function getFormBlockType()
25
+ {
26
+ return $this->_formBlockType;
27
+ }
28
+
29
+ public function isAvailable($quote=null)
30
+ {
31
+ $currencyCode=$this->getQuote()->getQuoteCurrencyCode();
32
+ if (!empty($currencyCode) && $currencyCode != 'CHF') {
33
+ return false;
34
+ }
35
+
36
+ return parent::isAvailable($quote);
37
+ }
38
+
39
+ public function validate()
40
+ {
41
+ parent::validate();
42
+ $payment = Mage::app()->getRequest()->getPOST('payment');
43
+
44
+
45
+ if (empty($payment[$this->_code.'_pf'])) {
46
+ $errorCode = 'invalid_data';
47
+ $errorMsg = $this->_getHelper()->__('No Postfinance method selected');
48
+ Mage::throwException($errorMsg);
49
+ return $this;
50
+ }
51
+
52
+ $this->saveCustomerData(array('ACCOUNT.BRAND' => $payment[$this->_code.'_pf']));
53
+
54
+ return $this;
55
+ }
56
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdpp.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Prepayment payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdpp extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdpp';
20
+
21
+ protected $_infoBlockType = 'hcd/info_prepayment';
22
+
23
+ public function showPaymentInfo($paymentData)
24
+ {
25
+ $loadSnippet = $this->_getHelper()->__("Prepayment Info Text");
26
+
27
+ $repl = array(
28
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
29
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
30
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CONNECTOR_ACCOUNT_HOLDER'],
31
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CONNECTOR_ACCOUNT_IBAN'],
32
+ '{IDENTIFICATION_SHORTID}' => $paymentData['IDENTIFICATION_SHORTID'],
33
+ );
34
+
35
+ $loadSnippet= strtr($loadSnippet, $repl);
36
+
37
+ return $loadSnippet;
38
+ }
39
+
40
+ /**
41
+ * Handle transaction with means pending
42
+ *
43
+ * @param $order Mage_Sales_Model_Order
44
+ * @param $data HeidelpayCD_Edition_Model_Transaction
45
+ * @param $message string order history message
46
+ *
47
+ * @return Mage_Sales_Model_Order
48
+ */
49
+ public function pendingTransaction($order, $data, $message = '')
50
+ {
51
+ $message = 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] . ' ' . $message;
52
+
53
+ $order->getPayment()
54
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
55
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
56
+ ->setIsTransactionClosed(false);
57
+
58
+ $invoice = $order->prepareInvoice();
59
+ $invoice->register();
60
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
61
+ $order->setIsInProcess(true);
62
+ $invoice->setIsPaid(false);
63
+ $order->addStatusHistoryComment(
64
+ Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
65
+ false
66
+ );
67
+ $invoice->save();
68
+ if ($this->_invoiceOrderEmail) {
69
+ $code = $order->getPayment()->getMethodInstance()->getCode();
70
+ if ($code == 'hcdiv' or $code == 'hcdivsec') {
71
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
72
+ $invoiceMailComment = ($info === false) ? '' : '<h3>'
73
+ . $this->_getHelper()->__('payment information') . '</h3><p>' . $info . '</p>';
74
+ }
75
+
76
+ $invoice->sendEmail(true, $invoiceMailComment); // send invoice mail
77
+ }
78
+
79
+
80
+ $transactionSave = Mage::getModel('core/resource_transaction')
81
+ ->addObject($invoice)
82
+ ->addObject($invoice->getOrder());
83
+ $transactionSave->save();
84
+
85
+ $this->log('Set transaction to processed and generate invoice ');
86
+ $order->setState(
87
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
88
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
89
+ $message
90
+ );
91
+
92
+ $order->getPayment()->addTransaction(
93
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
94
+ null,
95
+ true,
96
+ $message
97
+ );
98
+
99
+ return $order;
100
+ }
101
+
102
+ /**
103
+ * Handle transaction with means processing
104
+ *
105
+ * @param $order Mage_Sales_Model_Order
106
+ * @param $data HeidelpayCD_Edition_Model_Transaction
107
+ * @param $message string order history message
108
+ *
109
+ * @return Mage_Sales_Model_Order
110
+ */
111
+ public function processingTransaction($order, $data, $message = '')
112
+ {
113
+
114
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
115
+ $paymentHelper = Mage::helper('hcd/payment');
116
+
117
+
118
+ $message = ($message === '') ? 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] : $message;
119
+ $totallyPaid = false;
120
+
121
+ $order->getPayment()
122
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
123
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
124
+ ->setIsTransactionClosed(true);
125
+
126
+ if ($paymentHelper->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and
127
+ $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']
128
+ ) {
129
+ $order->setState(
130
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
131
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
132
+ $message
133
+ );
134
+ $totallyPaid = true;
135
+ } else {
136
+ // in case rc is ack and amount is to low or currency miss match
137
+
138
+ $order->setState(
139
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
140
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
141
+ $message
142
+ );
143
+ }
144
+
145
+ // Set invoice to paid when the total amount matches
146
+ if ($order->hasInvoices() and $totallyPaid) {
147
+
148
+ /** @var $invoice Mage_Sales_Model_Order_Invoice */
149
+ foreach ($order->getInvoiceCollection() as $invoice) {
150
+ $this->log('Set invoice ' . (string)$invoice->getIncrementId() . ' to paid.');
151
+ $invoice
152
+ ->capture()
153
+ ->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID)
154
+ ->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
155
+ ->setIsPaid(true)
156
+ // @codingStandardsIgnoreLine use of save in a loop
157
+ ->save();
158
+
159
+ $transactionSave = Mage::getModel('core/resource_transaction')
160
+ ->addObject($invoice)
161
+ ->addObject($invoice->getOrder());
162
+ // @codingStandardsIgnoreLine use of save in a loop
163
+ $transactionSave->save();
164
+ }
165
+ }
166
+
167
+ // Set total paid and invoice to the connector amount
168
+ $order->setTotalInvoiced($data['PRESENTATION_AMOUNT']);
169
+ $order->setTotalPaid($data['PRESENTATION_AMOUNT']);
170
+
171
+
172
+ $order->getPayment()->addTransaction(
173
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
174
+ null,
175
+ true,
176
+ $message
177
+ );
178
+
179
+ $order->setIsInProcess(true);
180
+
181
+ return $order;
182
+ }
183
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdsu.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sofort payment method
4
+ *
5
+ * Also called "Sofortüberweisung" in germany.
6
+ *
7
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
8
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
9
+ *
10
+ * @link https://dev.heidelpay.de/magento
11
+ *
12
+ * @author Jens Richter
13
+ *
14
+ * @package Heidelpay
15
+ * @subpackage Magento
16
+ * @category Magento
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Payment_Hcdsu extends HeidelpayCD_Edition_Model_Payment_Abstract
20
+ {
21
+ protected $_code = 'hcdsu';
22
+ protected $_canRefund = true;
23
+ protected $_canRefundInvoicePartial = true;
24
+
25
+ /**
26
+ * @inheritdoc
27
+ */
28
+ public function chargeBack($order, $message = "")
29
+ {
30
+ $message = Mage::helper('hcd')->__('chargeback');
31
+ return parent::chargeBack($order, $message);
32
+ }
33
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Payment/Hcdyt.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Yapital payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ *
16
+ * @deprecated This payment method is not longer available
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Payment_Hcdyt extends HeidelpayCD_Edition_Model_Payment_Abstract
20
+ {
21
+ protected $_code = 'hcdyt';
22
+ protected $_canRefund = false;
23
+ protected $_canRefundInvoicePartial = false;
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Resource/Encryption.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Heidelpay encryption model
4
+ *
5
+ * replace the magento md5 hashing with sha256
6
+ *
7
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
8
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
9
+ *
10
+ * @link https://dev.heidelpay.de/magento
11
+ *
12
+ * @author Jens Richter
13
+ *
14
+ * @package Heidelpay
15
+ * @subpackage Magento
16
+ * @category Magento
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Resource_Encryption extends Mage_Core_Model_Encryption
20
+ {
21
+ public function hash($data)
22
+ {
23
+ return hash('sha256', $data);
24
+ }
25
+
26
+ public function getHash($string, $salt = false)
27
+ {
28
+ if ($salt === false) {
29
+ $salt = (string)Mage::getConfig()->getNode('global/crypt/key');
30
+ }
31
+
32
+ return $this->hash($salt.(string)$string);
33
+ }
34
+
35
+ public function validateHash($string, $hash)
36
+ {
37
+ return $this->getHash((string)$string) === $hash;
38
+ }
39
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Resource/Setup.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * heidelpay resource model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Modul_Resource_Setup extends Mage_Core_Model_Resource_Setup
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/System/Config/Source/Bookingmode.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Booking mode configuration model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine
17
+ class HeidelpayCD_Edition_Model_System_Config_Source_Bookingmode
18
+ {
19
+ /**
20
+ * returns the available booking modes for backend configuration
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ array('value'=>'DB', 'label'=>Mage::helper('hcd')->__('Direct Booking')),
28
+ array('value'=>'PA', 'label'=>Mage::helper('hcd')->__('Preauthorisation'))
29
+ );
30
+ }
31
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/System/Config/Source/Recognition.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Recognition configuration model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine
17
+ class HeidelpayCD_Edition_Model_System_Config_Source_Recognition
18
+ {
19
+ /**
20
+ * Returns the recognition configuration option for the backend
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ array('value'=>'0', 'label'=>Mage::helper('hcd')->__('no recognition')),
28
+ array('value'=>'1', 'label'=>Mage::helper('hcd')->__('only if shippping adress is unchanged')),
29
+ array('value'=>'2', 'label'=>Mage::helper('hcd')->__('always'))
30
+ );
31
+ }
32
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/System/Config/Source/Returnurl.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Return url configuration model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine
17
+ class HeidelpayCD_Edition_Model_System_Config_Source_Returnurl
18
+ {
19
+ /**
20
+ * Return the configuration option for the return urk in case of a payment error
21
+ *
22
+ * @return array currently you can choose between basket and checkout page
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ array('value'=>'basket', 'label'=>Mage::helper('hcd')->__('Basket')),
28
+ array('value'=>'onepage', 'label'=>Mage::helper('hcd')->__('Onepage Checkout')),
29
+ );
30
+ }
31
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/Model/Transaction.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Transaction model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Transaction extends Mage_Core_Model_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/transaction');
22
+ parent::_construct();
23
+ }
24
+
25
+ public function saveTransactionData($data, $source='shop')
26
+ {
27
+ $paymentCode = Mage::helper('hcd/payment')->splitPaymentCode($data['PAYMENT_CODE']);
28
+
29
+ $this->setPaymentMethode($paymentCode[0]);
30
+ $this->setPaymentType($paymentCode[1]);
31
+ $this->setTransactionid($data['IDENTIFICATION_TRANSACTIONID']);
32
+ $this->setUniqeid($data['IDENTIFICATION_UNIQUEID']);
33
+ $this->setResult($data['PROCESSING_RESULT']);
34
+ $this->setShortid($data['IDENTIFICATION_SHORTID']);
35
+ $this->setStatuscode($data['PROCESSING_STATUS_CODE']);
36
+ $this->setReturn($data['PROCESSING_RETURN']);
37
+ $this->setReturncode($data['PROCESSING_RETURN_CODE']);
38
+ $this->setJsonresponse(Mage::getModel('hcd/resource_encryption')->encrypt(json_encode($data)));
39
+ // @codingStandardsIgnoreLine should be refactored - issue #2
40
+ $this->setDatetime(date('Y-m-d H:i:s'));
41
+ $this->setSource($source);
42
+ return $this->save();
43
+ }
44
+
45
+ public function loadTransactionDataByX($filter=array(), $sortby=false)
46
+ {
47
+ $data = array();
48
+ $trans = $this->getCollection();
49
+
50
+ foreach ($filter as $k => $v) {
51
+ $trans->addFieldToFilter($k, $v);
52
+ }
53
+
54
+ if ($sortby) {
55
+ $trans->getSelect()->order($sortby);
56
+ }
57
+
58
+ $trans->load();
59
+
60
+
61
+
62
+ $data = $trans->getData();
63
+ $temp = array();
64
+ foreach ($data as $k => $v) {
65
+ $temp[] = json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[$k]['jsonresponse']), true);
66
+ }
67
+
68
+ return $temp;
69
+ }
70
+
71
+ public function loadLastTransactionDataByTransactionnr($transid)
72
+ {
73
+ $data = array();
74
+ $trans = $this->getCollection();
75
+ $trans->addFieldToFilter('transactionid', $transid);
76
+ $trans->getSelect()->order('id DESC');
77
+ // @codingStandardsIgnoreLine
78
+ $trans->getSelect()->limit(1);
79
+ $trans->load();
80
+
81
+
82
+ $data = $trans->getData();
83
+
84
+ // @codingStandardsIgnoreLine seem to be a bug in marketplace ready
85
+ if (is_array($data)) {
86
+ return json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['jsonresponse']), true);
87
+ }
88
+
89
+ return false;
90
+ }
91
+
92
+ public function loadLastTransactionDataByUniqeId($id)
93
+ {
94
+ $data = array();
95
+ $trans = $this->getCollection();
96
+ $trans->addFieldToFilter('uniqeid', $id);
97
+ // @codingStandardsIgnoreLine should be refactored - issue #6
98
+ $trans->getSelect()->limit(1);
99
+ $trans->load();
100
+
101
+
102
+ $data = $trans->getData();
103
+ if (isset($data[0])) {
104
+ return json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['jsonresponse']), true);
105
+ } else {
106
+ return false;
107
+ }
108
+ }
109
+
110
+ public function getOneTransactionByMethode($transid, $methode)
111
+ {
112
+ $data = false;
113
+ $trans = $this->getCollection();
114
+ $trans->addFieldToFilter('transactionid', $transid)
115
+ ->addFieldToFilter('Payment_Type', $methode);
116
+ $trans->getSelect()->order('id DESC');
117
+ // @codingStandardsIgnoreLine should be refactored - issue #6
118
+ $trans->getSelect()->limit(1);
119
+ $trans->load();
120
+
121
+
122
+ $data = $trans->getData();
123
+
124
+ if (isset($data[0])) {
125
+ return json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['jsonresponse']), true);
126
+ } else {
127
+ return false;
128
+ }
129
+ }
130
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/controllers/CheckoutController.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout controller
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+
17
+ $modulePath = Mage::getModuleDir('', 'Mage_Checkout');
18
+ require_once($modulePath."/controllers/OnepageController.php");
19
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
20
+ class HeidelpayCD_Edition_CheckoutController extends Mage_Checkout_OnepageController
21
+ {
22
+ public function indexAction()
23
+ {
24
+ $session = Mage::getSingleton('checkout/session');
25
+ $checkout = $this->getOnepage();
26
+ $quote = $session->getQuote();
27
+
28
+ if (!$quote->hasItems() || $quote->getHasError()) {
29
+ $this->_redirect('checkout/cart');
30
+ return;
31
+ }
32
+
33
+
34
+ $data = false;
35
+ $this->loadLayout();
36
+ $this->getLayout()->getBlock('head')->setTitle($this->__('MasterPass Checkout'));
37
+
38
+ $session->setCurrency($quote->getGlobalCurrencyCode());
39
+ $session->setTotalamount($quote->getGrandTotal());
40
+
41
+ $data = Mage::getModel('hcd/transaction')
42
+ ->loadLastTransactionDataByTransactionnr(Mage::getSingleton('checkout/session')->getQuoteId());
43
+
44
+ Mage::getSingleton('checkout/session')->setCartWasUpdated(false);
45
+ Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure' => true)));
46
+ $this->getOnepage()->initCheckout();
47
+
48
+
49
+ // @codingStandardsIgnoreLine should be refactored - issue #4
50
+ $this->log('Data from wallet '.print_r($data, 1));
51
+
52
+
53
+
54
+ $this->getOnepage()->saveCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_GUEST);
55
+
56
+ $this->getOnepage()->getCheckout()->setStepData('login', 'complete', true);
57
+
58
+ $region = Mage::helper('hcd/payment')->getRegion($data['ADDRESS_COUNTRY'], $data['ADDRESS_STATE']);
59
+
60
+ $billingAddress = array(
61
+ "address_id" => '',
62
+ "firstname" => trim($data['NAME_GIVEN']),
63
+ "lastname" => trim($data['NAME_FAMILY']),
64
+ "company" => '',
65
+ "email" => trim($data['CONTACT_EMAIL']),
66
+ "street" => array(
67
+ "0" => $data['ADDRESS_STREET'],
68
+ "1" => '',
69
+ ),
70
+ "region_id" =>(string) $region,
71
+ "region" => $data['ADDRESS_STATE'],
72
+ "city" => $data['ADDRESS_CITY'],
73
+ "postcode" => $data['ADDRESS_ZIP'],
74
+ "country_id" => $data['ADDRESS_COUNTRY'],
75
+ "telephone" => preg_replace('/[A-z]-/', '', $data['CONTACT_PHONE']),
76
+ "customer_password" =>"",
77
+ "confirm_password" =>"",
78
+ "save_in_address_book" => 1
79
+ );
80
+ // @codingStandardsIgnoreLine should be refactored - issue #4
81
+ $this->log('adress'.print_r($billingAddress, 1));
82
+
83
+ $hpdata = array(
84
+ 'code' => 'hcdmpa',
85
+ 'brand' => (array_key_exists('ACCOUNT_BRAND', $data)) ? $data['ACCOUNT_BRAND'] : false ,
86
+ 'mail' => (array_key_exists('CONTACT_EMAIL', $data)) ? $data['CONTACT_EMAIL'] : false ,
87
+ 'number' => (array_key_exists('ACCOUNT_NUMBER', $data)) ? $data['ACCOUNT_NUMBER'] : false ,
88
+ 'expiryMonth' => (array_key_exists('ACCOUNT_EXPIRY_MONTH', $data))
89
+ ? $data['ACCOUNT_EXPIRY_MONTH'] : false ,
90
+ 'expiryYear' => (array_key_exists('ACCOUNT_EXPIRY_YEAR', $data))
91
+ ? $data['ACCOUNT_EXPIRY_YEAR'] : false ,
92
+ 'referenceId' => (array_key_exists('IDENTIFICATION_UNIQUEID', $data))
93
+ ? $data['IDENTIFICATION_UNIQUEID'] : false ,
94
+ 'adress' => $billingAddress
95
+ );
96
+
97
+ $session->setHcdWallet($hpdata);
98
+
99
+
100
+ $customAddress = Mage::getModel('customer/address');
101
+ $customAddress->setData($billingAddress);
102
+
103
+ $quote->setBillingAddress(
104
+ Mage::getSingleton('sales/quote_address')
105
+ ->importCustomerAddress($customAddress)
106
+ );
107
+
108
+ $quote->setShippingAddress(
109
+ Mage::getSingleton('sales/quote_address')
110
+ ->importCustomerAddress($customAddress)
111
+ );
112
+
113
+ $this->getOnepage()->getQuote()->collectTotals()->save();
114
+
115
+
116
+ $this->getOnepage()->getCheckout()->setStepData('billing', 'complete', true);
117
+ $this->getOnepage()->getCheckout()->setStepData('shipping', 'allow', true);
118
+
119
+ $this->getOnepage()->getCheckout()->setStepData('shipping', 'complete', true);
120
+ $this->getOnepage()->getCheckout()->setStepData('payment', 'allow', true);
121
+ $this->getOnepage()->savePayment(array('method'=>'hcdmpa'));
122
+
123
+
124
+
125
+ $this->renderLayout();
126
+ }
127
+
128
+ public function saveBillingAction()
129
+ {
130
+ if ($this->_expireAjax()) {
131
+ return;
132
+ }
133
+
134
+ if ($this->getRequest()->isPost()) {
135
+ $data = $this->getRequest()->getPost('billing', array());
136
+ $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
137
+
138
+ if (isset($data['email'])) {
139
+ $data['email'] = trim($data['email']);
140
+ }
141
+
142
+ $result = $this->getOnepage()->saveBilling($data, $customerAddressId);
143
+
144
+
145
+ if (!isset($result['error'])) {
146
+ if ($this->getOnepage()->getQuote()->isVirtual()) {
147
+ $result['goto_section'] = 'payment';
148
+ $result['update_section'] = array(
149
+ 'name' => 'payment-method',
150
+ 'html' => $this->_getPaymentMethodsHtml()
151
+ );
152
+ } else {
153
+ $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
154
+
155
+ $result = $this->getOnepage()->saveShipping($wallet['adress'], false);
156
+ $this->getOnepage()->getCheckout()->setStepData('shipping', 'allow', true)
157
+ ->setStepData('shipping', 'complete', true);
158
+
159
+ if (!isset($result['error'])) {
160
+ $result['goto_section'] = 'shipping_method';
161
+ $result['update_section'] = array(
162
+ 'name' => 'shipping-method',
163
+ 'html' => $this->_getShippingMethodsHtml()
164
+ );
165
+ }
166
+ }
167
+ }
168
+
169
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
170
+ }
171
+ }
172
+
173
+ public function savePayment($data)
174
+ {
175
+ try {
176
+ $result = $this->getOnepage()->savePayment($data);
177
+
178
+
179
+ $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
180
+ if (empty($result['error']) && !$redirectUrl) {
181
+ $this->loadLayout('checkout_onepage_review');
182
+ $result['goto_section'] = 'review';
183
+ $result['update_section'] = array(
184
+ 'name' => 'review',
185
+ 'html' => $this->_getReviewHtml()
186
+ );
187
+ }
188
+
189
+ if ($redirectUrl) {
190
+ $result['redirect'] = $redirectUrl;
191
+ }
192
+ } catch (Mage_Payment_Exception $e) {
193
+ if ($e->getFields()) {
194
+ $result['fields'] = $e->getFields();
195
+ }
196
+
197
+ $result['error'] = $e->getMessage();
198
+ } catch (Mage_Core_Exception $e) {
199
+ $result['error'] = $e->getMessage();
200
+ } catch (Exception $e) {
201
+ Mage::logException($e);
202
+ $result['error'] = $this->__('Unable to set Payment Method.');
203
+ }
204
+
205
+ $this->getOnepage()->getCheckout()->setStepData('payment', 'complete', true);
206
+ return $result;
207
+ }
208
+
209
+ public function savePaymentAction()
210
+ {
211
+ if ($this->_expireAjax()) {
212
+ return;
213
+ }
214
+
215
+ $result = $this->savePayment(array('method'=>'hcdmpa'));
216
+
217
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
218
+ }
219
+
220
+ protected function _getPaymentMethodsHtml()
221
+ {
222
+ $layout = $this->getLayout();
223
+ $update = $layout->getUpdate();
224
+ $update->load('hcd_checkout_paymentmethod');
225
+ $layout->generateXml();
226
+ $layout->generateBlocks();
227
+ $output = $layout->getOutput();
228
+ return $output;
229
+ }
230
+
231
+ public function saveShippingMethodAction()
232
+ {
233
+ if ($this->_expireAjax()) {
234
+ return;
235
+ }
236
+
237
+ if ($this->getRequest()->isPost()) {
238
+ $data = $this->getRequest()->getPost('shipping_method', '');
239
+ $result = $this->getOnepage()->saveShippingMethod($data);
240
+ // $result will contain error data if shipping method is empty
241
+ if (!$result) {
242
+ Mage::dispatchEvent(
243
+ 'checkout_controller_onepage_save_shipping_method',
244
+ array(
245
+ 'request' => $this->getRequest(),
246
+ 'quote' => $this->getOnepage()->getQuote())
247
+ );
248
+ $this->getOnepage()->getQuote()->collectTotals();
249
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
250
+
251
+ $result['goto_section'] = 'payment';
252
+ $result['update_section'] = array(
253
+ 'name' => 'payment-method',
254
+ 'html' => $this->_getPaymentMethodsHtml()
255
+ );
256
+ }
257
+
258
+ $this->getOnepage()->getQuote()->collectTotals()->save();
259
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
260
+ }
261
+ }
262
+
263
+ public function progressAction()
264
+ {
265
+ // previous step should never be null. We always start with billing and go forward
266
+ $prevStep = $this->getRequest()->getParam('prevStep', false);
267
+
268
+ if ($this->_expireAjax() || !$prevStep) {
269
+ return null;
270
+ }
271
+
272
+ $layout = $this->getLayout();
273
+ $update = $layout->getUpdate();
274
+ /* Load the block belonging to the current step*/
275
+ $update->load('hcd_checkout_progress_' . $prevStep);
276
+ $layout->generateXml();
277
+ $layout->generateBlocks();
278
+ $output = $layout->getOutput();
279
+ $this->getResponse()->setBody($output);
280
+ return $output;
281
+ }
282
+
283
+ protected function log($message, $level="DEBUG", $file=false)
284
+ {
285
+ $callers=debug_backtrace();
286
+ return Mage::helper('hcd/payment')->realLog($callers[1]['function'].' '.$message, $level, $file);
287
+ }
288
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/controllers/IndexController.php ADDED
@@ -0,0 +1,664 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Index controller
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_IndexController extends Mage_Core_Controller_Front_Action
18
+ {
19
+ protected $_sendNewOrderEmail = true;
20
+ protected $_invoiceOrderEmail = true;
21
+ protected $_order = null;
22
+ protected $_paymentInst = null;
23
+ protected $_debug = true;
24
+
25
+ protected $_liveUrl = 'https://heidelpay.hpcgw.net/ngw/post';
26
+ protected $_sandboxUrl = 'https://test-heidelpay.hpcgw.net/ngw/post';
27
+
28
+
29
+ protected $_liveBasketUrl = 'https://heidelpay.hpcgw.net/ngw/basket/';
30
+ protected $_sandboxBasketUrl = 'https://test-heidelpay.hpcgw.net/ngw/basket/';
31
+
32
+
33
+ public $importantPPFields = array(
34
+ 'PRESENTATION_AMOUNT',
35
+ 'PRESENTATION_CURRENCY',
36
+ 'CONNECTOR_ACCOUNT_COUNTRY',
37
+ 'CONNECTOR_ACCOUNT_HOLDER',
38
+ 'CONNECTOR_ACCOUNT_NUMBER',
39
+ 'CONNECTOR_ACCOUNT_BANK',
40
+ 'CONNECTOR_ACCOUNT_BIC',
41
+ 'CONNECTOR_ACCOUNT_IBAN',
42
+ 'IDENTIFICATION_SHORTID',
43
+ );
44
+
45
+ /** @var $_basketApiHelper HeidelpayCD_Edition_Helper_BasketApi */
46
+ protected $_basketApiHelper;
47
+
48
+ protected function _getHelper()
49
+ {
50
+ return Mage::helper('hcd');
51
+ }
52
+
53
+ /**
54
+ * HeidelpayCD_Edition_IndexController constructor.
55
+ *
56
+ * @param Zend_Controller_Request_Abstract $request
57
+ * @param Zend_Controller_Response_Abstract $response
58
+ * @param HeidelpayCD_Edition_Helper_BasketApi $basketApiHelper
59
+ * @param array $invokeArgs
60
+ */
61
+ // @codingStandardsIgnoreLine bug in multi line standard
62
+ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
63
+ {
64
+ parent::__construct($request, $response, $invokeArgs);
65
+ $this->_basketApiHelper = Mage::helper('hcd/basketApi');
66
+ }
67
+
68
+ protected function log($message, $level = "DEBUG", $file = false)
69
+ {
70
+ $callers = debug_backtrace();
71
+ return Mage::helper('hcd/payment')->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
72
+ }
73
+
74
+ protected function _expireAjax()
75
+ {
76
+ if (!$this->getCheckout()->getQuote()->hasItems()) {
77
+ $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
78
+ return false;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Get order model
84
+ *
85
+ * @return Mage_Sales_Model_Order
86
+ */
87
+ public function getOrder()
88
+ {
89
+ return Mage::getModel('sales/order');
90
+ }
91
+
92
+ /**
93
+ * Get checkout session namespace
94
+ *
95
+ * @return Mage_Checkout_Model_Session
96
+ */
97
+ public function getCheckout()
98
+ {
99
+ return Mage::getSingleton('checkout/session');
100
+ }
101
+
102
+ /**
103
+ * Get current quote
104
+ *
105
+ * @return Mage_Sales_Model_Quote
106
+ */
107
+ public function getQuote()
108
+ {
109
+ return $this->getCheckout()->getQuote();
110
+ }
111
+
112
+ /**
113
+ * Get hp session namespace
114
+ *
115
+ * @return Mage_Heidelpay_Model_Session
116
+ */
117
+ public function getSession()
118
+ {
119
+ return Mage::getSingleton('core/session');
120
+ }
121
+
122
+ protected function _getCheckout()
123
+ {
124
+ return Mage::getSingleton('checkout/session');
125
+ }
126
+
127
+ public function getOnepage()
128
+ {
129
+ return Mage::getSingleton('checkout/type_onepage');
130
+ }
131
+
132
+ public function getStore()
133
+ {
134
+ return Mage::app()->getStore()->getId();
135
+ }
136
+
137
+ /**
138
+ * successful return from Heidelpay payment
139
+ */
140
+ public function successAction()
141
+ {
142
+ $session = $this->getCheckout();
143
+ $order = Mage::getModel('sales/order');
144
+ $this->log('SuccessAction Session: '. json_encode($session->getLastRealOrderId()));
145
+ $order->loadByIncrementId($session->getLastRealOrderId());
146
+ if ($order->getPayment() === false) {
147
+ $this->_redirect('', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
148
+ return $this;
149
+ }
150
+
151
+ $noMail = (Mage::app()->getRequest()->getParam('no_mail') == 1) ? true : false;
152
+
153
+
154
+ $this->getCheckout()->getQuote()->setIsActive(false)->save();
155
+ $this->getCheckout()->clear();
156
+
157
+ $message = "";
158
+
159
+ $data = Mage::getModel('hcd/transaction')
160
+ ->loadLastTransactionDataByTransactionnr($session->getLastRealOrderId());
161
+
162
+ $this->log('SuccessAction Data: '. json_encode($data));
163
+
164
+ /*
165
+ * validate Hash to prevent manipulation
166
+ */
167
+ if (Mage::getModel('hcd/resource_encryption')
168
+ ->validateHash($data['IDENTIFICATION_TRANSACTIONID'], $data['CRITERION_SECRET']) === false
169
+ ) {
170
+ $this->log(
171
+ "Customer tries to redirect directly to success page. IP "
172
+ . Mage::app()->getRequest()->getServer('REMOTE_ADDR')
173
+ . " . This could be some kind of manipulation.", 'WARN'
174
+ );
175
+ $this->_redirect('', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
176
+ }
177
+
178
+ $session->unsHcdPaymentInfo();
179
+
180
+ if ($order->getPayment()->getMethodInstance()->getCode() != 'hcdiv' and
181
+ $order->getPayment()->getMethodInstance()->getCode() != 'hcdivsec') {
182
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
183
+ if ($info !== false) {
184
+ $session->setHcdPaymentInfo($info);
185
+ $order->setCustomerNote($info);
186
+ }
187
+ }
188
+
189
+ // last_quote_id workaround for trusted shop buyerprotection
190
+ $quoteID = ($session->getLastQuoteId() === false) ? $session->getQuoteId() : $session->getLastQuoteId();
191
+ $this->getCheckout()->setLastSuccessQuoteId($quoteID);
192
+ $this->log('LastQuteID :' . $quoteID);
193
+
194
+ if ($noMail === false) {
195
+ /** @var $orderStateHelper HeidelpayCD_Edition_Helper_OrderState */
196
+ $orderStateHelper = Mage::helper('hcd/orderState');
197
+ $orderStateHelper->mapStatus(
198
+ $data,
199
+ $order
200
+ );
201
+ }
202
+
203
+ if ($order->getId() and $noMail === false) {
204
+ $order->sendNewOrderEmail();
205
+ }
206
+
207
+ $order->save();
208
+ $this->_redirect('checkout/onepage/success', array('_secure' => true));
209
+ }
210
+
211
+ public function errorAction()
212
+ {
213
+ $session = $this->getCheckout();
214
+ $errorCode = null;
215
+ $order = Mage::getModel('sales/order');
216
+ $order->loadByIncrementId($session->getLastRealOrderId());
217
+ $this->log(' LastRealOrderId ' . json_encode($session->getLastRealOrderId()));
218
+
219
+ $request = Mage::app()->getRequest();
220
+ $getError = $request->getParam('HPError');
221
+
222
+
223
+ // in case of an error in the server to server request
224
+ $usersession = $this->getSession();
225
+ $data = Mage::getModel('hcd/transaction')
226
+ ->loadLastTransactionDataByTransactionnr($session->getLastRealOrderId());
227
+ $this->log(' data ' . json_encode($data));
228
+
229
+ if ($usersession->getHcdError() !== null) {
230
+ $message = Mage::helper('hcd/payment')
231
+ ->handleError($usersession->getHcdError(), $errorCode, (string)$order->getRealOrderId());
232
+ $intMessage = $usersession->getHcdError();
233
+ $data['PROCESSING_RESULT'] = 'NOK';
234
+ $usersession->unsHcdError();
235
+ } else {
236
+ if (isset($data['PROCESSING_RETURN_CODE'])) {
237
+ $errorCode = $data['PROCESSING_RETURN_CODE'];
238
+ }
239
+
240
+ if (isset($getError)) {
241
+ $errorCode = $getError;
242
+ $data['PROCESSING_RESULT'] = 'NOK';
243
+ }
244
+
245
+ $message = Mage::helper('hcd/payment')
246
+ ->handleError($data['PROCESSING_RETURN'], $errorCode, (string)$order->getRealOrderId());
247
+ $intMessage = (!empty($data['PROCESSING_RETURN'])) ? $data['PROCESSING_RETURN'] : $message;
248
+ }
249
+
250
+ $quoteId = ($session->getLastQuoteId() === false) ? $session->getQuoteId() : $session->getLastQuoteId();
251
+ // last_quote_id workaround for trusted shop buyerprotection
252
+
253
+ if ($quoteId) {
254
+ $quote = Mage::getModel('sales/quote')->load($quoteId);
255
+ if ($quote->getId()) {
256
+ $quote->setIsActive(true)->save();
257
+ $session->setQuoteId($quoteId);
258
+ }
259
+ }
260
+
261
+ /** @var $orderStateHelper HeidelpayCD_Edition_Helper_OrderState */
262
+ $orderStateHelper = Mage::helper('hcd/orderState');
263
+ $orderStateHelper->mapStatus(
264
+ $data,
265
+ $order,
266
+ $intMessage
267
+ );
268
+
269
+ $storeId = Mage::app()->getStore()->getId();
270
+ $redirectController = Mage::getStoreConfig("hcd/settings/returnurl", $storeId);
271
+
272
+ switch ($redirectController) {
273
+ case "basket":
274
+ $session->addError($message);
275
+ $this->_redirect('checkout/cart', array('_secure' => true));
276
+ break;
277
+ default:
278
+ $usersession->addError($message);
279
+ $this->_redirect('checkout/onepage', array('_secure' => true));
280
+ }
281
+ }
282
+
283
+ /**
284
+ * redirect return from Heidelpay payment (iframe)
285
+ */
286
+ public function indexAction()
287
+ {
288
+ $data = array();
289
+ $order = $this->getOrder();
290
+
291
+ $refId = false;
292
+ $basketId = false;
293
+
294
+ $session = $this->getCheckout();
295
+ $order->loadByIncrementId($session->getLastRealOrderId());
296
+ if ($order->getPayment() === false) {
297
+ $this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());
298
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
299
+ return $this;
300
+ }
301
+
302
+ $payment = $order->getPayment()->getMethodInstance();
303
+
304
+ if ($session->getHcdWallet() !== false) {
305
+ $wallet = $session->getHcdWallet();
306
+ $refId = (!empty($wallet['referenceId'])) ? $wallet['referenceId'] : false;
307
+ $this->log('Wallet reference id :' . $refId);
308
+ }
309
+
310
+
311
+ if ($payment->canBasketApi() and empty($refId)) {
312
+ $shoppingCart = $this->_basketApiHelper->basketItems($order, $this->getStore());
313
+
314
+ $url = (Mage::getStoreConfig('hcd/settings/transactionmode', $this->getStore()) == 0)
315
+ ? $this->_liveBasketUrl : $this->_sandboxBasketUrl;
316
+
317
+ $this->log("doRequest shoppingcart : " . json_encode($shoppingCart), 'DEBUG');
318
+
319
+ $result = Mage::helper('hcd/payment')->doRequest($url, array('raw' => $shoppingCart));
320
+
321
+ if (array_key_exists('result', $result) && $result['result'] == 'NOK') {
322
+ $this->log(
323
+ 'Send basket to payment fail, because of : ' .
324
+ json_encode($result), 'ERROR'
325
+ );
326
+ Mage::getSingleton('core/session')->setHcdError($result['basketErrors']['message']);
327
+ $this->_redirect(
328
+ 'hcd/index/error',
329
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
330
+ );
331
+ return;
332
+ }
333
+
334
+ $this->log(
335
+ "doRequest shopping cart response : " .
336
+ json_encode($result), 'DEBUG'
337
+ );
338
+ $basketId = (array_key_exists('basketId', $result)) ? $result['basketId'] : false;
339
+ }
340
+
341
+
342
+ // if order status is cancel redirect to cancel page
343
+ if ($order->getStatus() == $payment->getStatusError()) {
344
+ $this->_redirect(
345
+ 'hcd/index/error',
346
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
347
+ );
348
+ return;
349
+ }
350
+
351
+ // if order status is success redirect to success page
352
+ if ($order->getStatus() == $payment->getStatusSuccess() or $order->getStatus() == $payment->getStatusPendig()) {
353
+ $this->_redirect(
354
+ 'hcd/index/success',
355
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true, 'no_mail' => true)
356
+ );
357
+ return;
358
+ }
359
+
360
+
361
+ $data = $payment->getHeidelpayUrl(false, $basketId, $refId);
362
+
363
+ if ($data['POST_VALIDATION'] == 'ACK' and $data['PROCESSING_RESULT'] == 'ACK') {
364
+ if ($data['PAYMENT_CODE'] == "OT.PA") {
365
+ $quoteID = ($session->getLastQuoteId() === false) ? $session->getQuoteId() : $session->getLastQuoteId();
366
+ // last_quote_id workaround for trusted shop buyerprotection
367
+ $order->getPayment()->setTransactionId($quoteID);
368
+ $order->getPayment()->setIsTransactionClosed(true);
369
+ }
370
+
371
+ $order->setState(
372
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
373
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
374
+ Mage::helper('hcd')->__('Get payment url from Heidelpay -> ') . $data['FRONTEND_REDIRECT_URL']
375
+ );
376
+ $order->getPayment()->addTransaction(
377
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
378
+ null,
379
+ true
380
+ );
381
+ $order->save();
382
+
383
+ $session->getQuote()->setIsActive(true)->save();
384
+ $session->clear();
385
+
386
+ if ($payment->activeRedirect() === true) {
387
+ $this->_redirectUrl($data['FRONTEND_REDIRECT_URL']);
388
+ return;
389
+ }
390
+
391
+ $this->loadLayout();
392
+ $this->log('RedirectUrl ' . $data['FRONTEND_PAYMENT_FRAME_URL']);
393
+ $this->log('CCHolder ' . $payment->getCustomerName());
394
+ $this->getLayout()->getBlock('hcd_index')->setHcdUrl($data['FRONTEND_PAYMENT_FRAME_URL']);
395
+ $this->getLayout()->getBlock('hcd_index')->setHcdCode($payment->getCode());
396
+ } else {
397
+ Mage::getModel('hcd/transaction')->saveTransactionData($data);
398
+ Mage::getSingleton('core/session')->setHcdError($data['PROCESSING_RETURN']);
399
+ $this->_redirect(
400
+ 'hcd/index/error',
401
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
402
+ );
403
+ }
404
+
405
+
406
+ $this->renderLayout();
407
+ return $this;
408
+ }
409
+
410
+ /**
411
+ * masterpass wallet controller
412
+ */
413
+ public function walletAction()
414
+ {
415
+ $data = array();
416
+ $request = Mage::app()->getRequest();
417
+ $paymentCode = $request->getParam('_wallet');
418
+ $storeId = $this->getStore();
419
+ $code = false;
420
+ $mageBasketId = (string)$this->getCheckout()->getQuoteId();
421
+
422
+ if ($paymentCode == 'hcdmpa') {
423
+ $code = 'hcdmpa';
424
+ }
425
+
426
+ $quote = $this->getOnepage()->getQuote();
427
+ if (!$quote->hasItems() || $quote->getHasError() || $code === false) {
428
+ $this->_redirect('checkout/cart');
429
+ return;
430
+ }
431
+
432
+
433
+ $shoppingCart = $this->_basketApiHelper->basketItems($quote, $storeId, false);
434
+
435
+ $url = (Mage::getStoreConfig(
436
+ 'hcd/settings/transactionmode',
437
+ $storeId
438
+ ) == 0) ? $this->_liveBasketUrl : $this->_sandboxBasketUrl;
439
+
440
+ $this->log("doRequest shoppingcart : " . json_encode($shoppingCart), 'DEBUG');
441
+ $this->log("doRequest shoppingcart : " . json_encode($shoppingCart), 'DEBUG');
442
+
443
+ $result = Mage::helper('hcd/payment')->doRequest($url, array('raw' => $shoppingCart));
444
+
445
+ if (array_key_exists('result', $result) && $result['result'] == 'NOK') {
446
+ $this->log(
447
+ 'Send basket to payment fail, because of : ' .
448
+ json_encode($result), 'ERROR'
449
+ );
450
+ $message = $this->_getHelper()
451
+ ->__('An unexpected error occurred. Please contact us to get further information.');
452
+ Mage::getSingleton('core/session')->addError($message);
453
+ $this->_redirect('checkout/cart', array('_secure' => true));
454
+ return;
455
+ }
456
+
457
+ $this->log("doRequest shoppingcart response : " . json_encode($result), 'DEBUG');
458
+
459
+ $config = array(
460
+ 'PAYMENT.METHOD' => preg_replace('/^hcd/', '', $code),
461
+ 'SECURITY.SENDER' => Mage::getStoreConfig('hcd/settings/security_sender', $storeId),
462
+ 'TRANSACTION.MODE' => (Mage::getStoreConfig(
463
+ 'hcd/settings/transactionmode',
464
+ $storeId
465
+ ) == 0) ? 'LIVE' : 'CONNECTOR_TEST',
466
+ 'URL' => (Mage::getStoreConfig(
467
+ 'hcd/settings/transactionmode',
468
+ $storeId
469
+ ) == 0) ? $this->_liveUrl : $this->_sandboxUrl,
470
+ 'USER.LOGIN' => trim(Mage::getStoreConfig('hcd/settings/user_id', $storeId)),
471
+ 'USER.PWD' => trim(Mage::getStoreConfig('hcd/settings/user_pwd', $storeId)),
472
+ 'TRANSACTION.CHANNEL' => trim(Mage::getStoreConfig('payment/' . $code . '/channel', $storeId)),
473
+ 'PAYMENT.TYPE' => 'IN'
474
+ );
475
+ $frontend = array(
476
+ 'FRONTEND.LANGUAGE' => Mage::helper('hcd/payment')->getLang(),
477
+ 'FRONTEND.RESPONSE_URL' => Mage::getUrl(
478
+ 'hcd/index/response',
479
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
480
+ ),
481
+ 'CRITERION.SECRET' => Mage::getModel('hcd/resource_encryption')->getHash($mageBasketId),
482
+ 'CRITERION.LANGUAGE' => strtolower(Mage::helper('hcd/payment')->getLang()),
483
+ 'CRITERION.STOREID' => $storeId,
484
+ 'SHOP.TYPE' => 'Magento ' . Mage::getVersion(),
485
+ 'SHOPMODULE.VERSION' => 'HeidelpayCD Edition - '
486
+ . (string)Mage::getConfig()->getNode()->modules->HeidelpayCD_Edition->version,
487
+ 'WALLET.DIRECT_PAYMENT' => 'false'
488
+ );
489
+
490
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
491
+
492
+ $user = array(
493
+ 'IDENTIFICATION.SHOPPERID' => $visitorData['visitor_id'],
494
+ 'NAME.GIVEN' => ' - ',
495
+ 'NAME.FAMILY' => ' - ',
496
+ 'ADDRESS.STREET' => ' - ',
497
+ 'ADDRESS.ZIP' => ' - ',
498
+ 'ADDRESS.CITY' => ' - ',
499
+ 'ADDRESS.COUNTRY' => 'DE',
500
+ 'CONTACT.EMAIL' => 'dummy@heidelpay.de',
501
+ 'CONTACT.IP' => (filter_var(
502
+ trim(Mage::app()->getRequest()->getClientIp()),
503
+ FILTER_VALIDATE_IP
504
+ )) ? trim(Mage::app()->getRequest()->getClientIp()) : '127.0.0.1'
505
+ );
506
+
507
+ $basketData = array(
508
+ 'PRESENTATION.AMOUNT' => Mage::helper('hcd/payment')->format($quote->getGrandTotal()),
509
+ 'PRESENTATION.CURRENCY' => $quote->getGlobalCurrencyCode(),
510
+ 'IDENTIFICATION.TRANSACTIONID' => $mageBasketId,
511
+ 'BASKET.ID' => (array_key_exists('basketId', $result)) ? $result['basketId'] : ''
512
+ );
513
+
514
+ $params = Mage::helper('hcd/payment')->preparePostData(
515
+ $config, $frontend, $user, $basketData,
516
+ $criterion = array()
517
+ );
518
+
519
+
520
+ $this->log("doRequest url : " . $config['URL'], 'DEBUG');
521
+ $this->log("doRequest params : " . json_encode($params), 'DEBUG');
522
+ $data = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
523
+ $this->log("doRequest response : " . json_encode($data), 'DEBUG');
524
+
525
+
526
+ if ($data['POST_VALIDATION'] == 'ACK' and $data['PROCESSING_RESULT'] == 'ACK') {
527
+ /** Redirect on Success */
528
+ $this->_redirectUrl(trim($data['FRONTEND_REDIRECT_URL']));
529
+ return;
530
+ } else {
531
+ /** Error Case */
532
+ $this->log('Wallet Redirect for ' . $code . ' fail, because of : ' . $data['PROCESSING_RETURN'], 'ERROR');
533
+ $message = $this->_getHelper()
534
+ ->__('An unexpected error occurred. Please contact us to get further information.');
535
+ Mage::getSingleton('core/session')->addError($message);
536
+ $this->_redirect('checkout/cart', array('_secure' => true));
537
+ return;
538
+ }
539
+ }
540
+
541
+ /**
542
+ * Controller for push notification
543
+ */
544
+ public function pushAction()
545
+ {
546
+ $rawPost = false;
547
+ $lastdata = null;
548
+ $request = Mage::app()->getRequest();
549
+ $rawPost = $request->getRawBody();
550
+
551
+ if ($rawPost === false) {
552
+ $this->_redirect('', array('_secure' => true));
553
+ }
554
+
555
+ /** Hack to remove a structure problem in criterion node */
556
+ $rawPost = preg_replace('/<Criterion(\s+)name="(.+?)">(.+?)<\/Criterion>/', '<$2>$3</$2>', $rawPost);
557
+
558
+ $xml = simplexml_load_string($rawPost);
559
+
560
+ $this->log('XML Object from Push : ' . $rawPost);
561
+
562
+ // @codingStandardsIgnoreStart simplexml notation
563
+ list($type, $methode) = Mage::helper('hcd/payment')
564
+ ->splitPaymentCode((string)$xml->Transaction->Payment['code']);
565
+
566
+ if ($methode == 'RG') {
567
+ return;
568
+ }
569
+
570
+ $hash = (string)$xml->Transaction->Analysis->SECRET;
571
+ $orderID = (string)$xml->Transaction->Identification->TransactionID;
572
+ // @codingStandardsIgnoreEnd
573
+
574
+ if (Mage::getModel('hcd/resource_encryption')->validateHash($orderID, $hash) === false) {
575
+ $this->log(
576
+ "Get response form server " . Mage::app()->getRequest()->getServer('REMOTE_ADDR')
577
+ . " with an invalid hash. This could be some kind of manipulation.",
578
+ 'WARN'
579
+ );
580
+ $this->_redirect('', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
581
+ return;
582
+ }
583
+
584
+ // @codingStandardsIgnoreStart simplexml notation
585
+ $xmlData = array(
586
+ 'PAYMENT_CODE' => (string)$xml->Transaction->Payment['code'],
587
+ 'IDENTIFICATION_TRANSACTIONID' => (string)$orderID,
588
+ 'IDENTIFICATION_UNIQUEID' => (string)$xml->Transaction->Identification->UniqueID,
589
+ 'PROCESSING_RESULT' => (string)$xml->Transaction->Processing->Result,
590
+ 'IDENTIFICATION_SHORTID' => (string)$xml->Transaction->Identification->ShortID,
591
+ 'PROCESSING_STATUS_CODE' => (string)$xml->Transaction->Processing->Status['code'],
592
+ 'PROCESSING_RETURN' => (string)$xml->Transaction->Processing->Return,
593
+ 'PROCESSING_RETURN_CODE' => (string)$xml->Transaction->Processing->Return['code'],
594
+ 'PRESENTATION_AMOUNT' => (string)$xml->Transaction->Payment->Presentation->Amount,
595
+ 'PRESENTATION_CURRENCY' => (string)$xml->Transaction->Payment->Presentation->Currency,
596
+ 'IDENTIFICATION_REFERENCEID' => (string)$xml->Transaction->Identification->ReferenceID,
597
+ 'CRITERION_STOREID' => (int)$xml->Transaction->Analysis->STOREID,
598
+ 'ACCOUNT_BRAND' => false,
599
+ 'CRITERION_LANGUAGE' => strtoupper((string)$xml->Transaction->Analysis->LANGUAGE)
600
+ );
601
+ // @codingStandardsIgnoreEnd
602
+
603
+ $order = $this->getOrder();
604
+ $order->loadByIncrementId($orderID);
605
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
606
+
607
+ switch ($paymentCode) {
608
+ case 'hcddd':
609
+ // @codingStandardsIgnoreStart simplexml notation
610
+ $xmlData['CLEARING_AMOUNT'] = (string)$xml->Transaction->Payment->Clearing->Amount;
611
+ $xmlData['CLEARING_CURRENCY'] = (string)$xml->Transaction->Payment->Clearing->Currency;
612
+ $xmlData['ACCOUNT_IBAN'] = (string)$xml->Transaction->Account->Iban;
613
+ $xmlData['ACCOUNT_BIC'] = (string)$xml->Transaction->Account->Bic;
614
+ $xmlData['ACCOUNT_IDENTIFICATION'] = (string)$xml->Transaction->Account->Identification;
615
+ $xmlData['IDENTIFICATION_CREDITOR_ID'] = (string)$xml->Transaction->Identification->CreditorID;
616
+ // @codingStandardsIgnoreEnd
617
+ break;
618
+ case 'hcdbs':
619
+ if ($methode == 'FI') {
620
+ // @codingStandardsIgnoreStart simplexml notation
621
+ $xmlData['CRITERION_BILLSAFE_LEGALNOTE'] = (string)$xml->Transaction->Analysis->BILLSAFE_LEGALNOTE;
622
+ $xmlData['CRITERION_BILLSAFE_AMOUNT'] = (string)$xml->Transaction->Analysis->BILLSAFE_AMOUNT;
623
+ $xmlData['CRITERION_BILLSAFE_CURRENCY'] = (string)$xml->Transaction->Analysis->BILLSAFE_CURRENCY;
624
+ $xmlData['CRITERION_BILLSAFE_RECIPIENT'] = (string)$xml->Transaction->Analysis->BILLSAFE_RECIPIENT;
625
+ $xmlData['CRITERION_BILLSAFE_IBAN'] = (string)$xml->Transaction->Analysis->BILLSAFE_IBAN;
626
+ $xmlData['CRITERION_BILLSAFE_BIC'] = (string)$xml->Transaction->Analysis->BILLSAFE_BIC;
627
+ $xmlData['CRITERION_BILLSAFE_REFERENCE'] = (string)$xml->Transaction->Analysis->BILLSAFE_REFERENCE;
628
+ $xmlData['CRITERION_BILLSAFE_PERIOD'] = (string)$xml->Transaction->Analysis->BILLSAFE_PERIOD;
629
+ $xmlData['ACCOUNT_BRAND'] = 'BILLSAFE';
630
+ // @codingStandardsIgnoreEnd
631
+ }
632
+ break;
633
+ }
634
+
635
+ // @codingStandardsIgnoreLine simplexml notation
636
+ if (!empty($xml->Transaction->Identification->UniqueID)) {
637
+ $lastdata = Mage::getModel('hcd/transaction')
638
+ ->loadLastTransactionDataByUniqeId($xmlData['IDENTIFICATION_UNIQUEID']);
639
+ }
640
+
641
+ if ($lastdata === false) {
642
+ Mage::getModel('hcd/transaction')->saveTransactionData($xmlData, 'push');
643
+ }
644
+
645
+
646
+ $this->log('PaymentCode ' . $paymentCode);
647
+
648
+ $this->log($type . " " . $methode);
649
+
650
+ if ($methode == 'CB' or
651
+ $methode == 'RC' or
652
+ $methode == 'CP' or
653
+ $methode == 'DB' or
654
+ ($methode == 'FI' and $paymentCode == 'hcdbs')
655
+ ) {
656
+ /** @var $orderStateHelper HeidelpayCD_Edition_Helper_OrderState */
657
+ $orderStateHelper = Mage::helper('hcd/orderState');
658
+ $orderStateHelper->mapStatus(
659
+ $xmlData,
660
+ $order
661
+ );
662
+ }
663
+ }
664
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/controllers/ResponseController.php ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Index controller
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine
18
+ class HeidelpayCD_Edition_ResponseController extends Mage_Core_Controller_Front_Action
19
+ {
20
+ protected $_sendNewOrderEmail = true;
21
+ protected $_invoiceOrderEmail = true;
22
+ protected $_order = null;
23
+ protected $_paymentInst = null;
24
+ protected $_debug = true;
25
+
26
+ protected function _getHelper()
27
+ {
28
+ return Mage::helper('hcd');
29
+ }
30
+
31
+ protected function log($message, $level = "DEBUG", $file = false)
32
+ {
33
+ $callers = debug_backtrace();
34
+ return Mage::helper('hcd/payment')->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
35
+ }
36
+
37
+ protected function _expireAjax()
38
+ {
39
+ if (!$this->getCheckout()->getQuote()->hasItems()) {
40
+ $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
41
+ return false;
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Get order model
47
+ *
48
+ * @return Mage_Sales_Model_Order
49
+ */
50
+ public function getOrder()
51
+ {
52
+ return Mage::getModel('sales/order');
53
+ }
54
+
55
+ /**
56
+ * Get checkout session namespace
57
+ *
58
+ * @return Mage_Checkout_Model_Session
59
+ */
60
+ public function getCheckout()
61
+ {
62
+ return Mage::getSingleton('checkout/session');
63
+ }
64
+
65
+ /**
66
+ * Get current quote
67
+ *
68
+ * @return Mage_Sales_Model_Quote
69
+ */
70
+ public function getQuote()
71
+ {
72
+ return $this->getCheckout()->getQuote();
73
+ }
74
+
75
+ /**
76
+ * Get hp session namespace
77
+ *
78
+ * @return Mage_Core_Model_Abstract
79
+ */
80
+ public function getSession()
81
+ {
82
+ return Mage::getSingleton('core/session');
83
+ }
84
+
85
+ /**
86
+ * @return Mage_Checkout_Model_Session
87
+ */
88
+ protected function _getCheckout()
89
+ {
90
+ return Mage::getSingleton('checkout/session');
91
+ }
92
+
93
+ public function getOnepage()
94
+ {
95
+ return Mage::getSingleton('checkout/type_onepage');
96
+ }
97
+
98
+ public function getStore()
99
+ {
100
+ return Mage::app()->getStore()->getId();
101
+ }
102
+
103
+ public function indexAction()
104
+ {
105
+ $response = Mage::app()->getRequest();
106
+ $response->setParamSources(array('_POST'));
107
+ $data = array();
108
+
109
+ $this->log('ResponseController');
110
+
111
+ $securityHash = $response->getPost('CRITERION_SECRET');
112
+
113
+ $transactionId = $response->getPOST('IDENTIFICATION_TRANSACTIONID');
114
+ $data['IDENTIFICATION_TRANSACTIONID'] =
115
+ (!empty($transactionId))
116
+ ? $response->getPOST('IDENTIFICATION_TRANSACTIONID')
117
+ : $response->getPOST('IDENTIFICATION_SHOPPERID');
118
+ /*
119
+ * validate Hash to prevent manipulation
120
+ */
121
+ if (Mage::getModel('hcd/resource_encryption')
122
+ ->validateHash(
123
+ $data['IDENTIFICATION_TRANSACTIONID'],
124
+ $securityHash
125
+ ) === false
126
+ ) {
127
+ // @codingStandardsIgnoreLine should be refactored - issue #5
128
+ print Mage::getUrl(
129
+ 'hcd/index/error', array(
130
+ '_forced_secure' => true,
131
+ '_store_to_url' => true,
132
+ '_nosid' => true
133
+ )
134
+ );
135
+ $this->log(
136
+ "Get response form server "
137
+ . $response->getServer('REMOTE_ADDR')
138
+ . " with an invalid hash. This could be some kind of manipulation.",
139
+ 'WARN'
140
+ );
141
+ return;
142
+ }
143
+
144
+ $data= $response->getParams();
145
+
146
+
147
+ $paymentCode = Mage::helper('hcd/payment')->splitPaymentCode($data['PAYMENT_CODE']);
148
+
149
+ $this->log("Post params: " . json_encode($data));
150
+
151
+ if ($paymentCode[1] == 'RG') {
152
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
153
+ $message = Mage::helper('hcd/payment')->handleError(
154
+ $data['PROCESSING_RETURN'],
155
+ $data['PROCESSING_RETURN_CODE']
156
+ );
157
+ $checkout = $this->getCheckout()->addError($message);
158
+ $url = Mage::getUrl(
159
+ 'hcd/index/error', array(
160
+ '_forced_secure' => true,
161
+ '_store_to_url' => true,
162
+ '_nosid' => true,
163
+ 'HPError' => $data['PROCESSING_RETURN_CODE']
164
+ )
165
+ );
166
+ } else {
167
+ // save cc and dc registration data
168
+ $this->saveCustomerRegistration($data, $paymentCode);
169
+
170
+ $url = Mage::getUrl('hcd/', array('_secure' => true));
171
+ }
172
+ } elseif ($paymentCode[1] == 'IN' and $response->getPost('WALLET_DIRECT_PAYMENT') == 'false') {
173
+ // Back to checkout after wallet init
174
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
175
+ $this->log(
176
+ 'Wallet for basketId '
177
+ . $data['IDENTIFICATION_TRANSACTIONID']
178
+ . ' failed because of '
179
+ . $data['PROCESSING_RETURN'],
180
+ 'NOTICE'
181
+ );
182
+ $url = Mage::getUrl('checkout/cart', array('_secure' => true));
183
+ } else {
184
+ $url = Mage::getUrl('hcd/checkout/', array('_secure' => true, '_wallet' => 'hcdmpa'));
185
+ }
186
+
187
+ Mage::getModel('hcd/transaction')->saveTransactionData($data);
188
+ } else {
189
+ /* load order */
190
+ $order = $this->getOrder();
191
+ $order->loadByIncrementId($data['IDENTIFICATION_TRANSACTIONID']);
192
+ if ($order->getPayment() !== false) {
193
+ $payment = $order->getPayment()->getMethodInstance();
194
+ }
195
+
196
+ $this->log('UniqeID: ' . $data['IDENTIFICATION_UNIQUEID']);
197
+
198
+
199
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
200
+ if (isset($data['FRONTEND_REQUEST_CANCELLED'])) {
201
+ $url = $data['FRONTEND_FAILURE_URL'];
202
+ } else {
203
+ $url = $data['FRONTEND_FAILURE_URL'];
204
+ }
205
+ } elseif (($paymentCode[1] == 'CP' or
206
+ $paymentCode[1] == 'DB' or
207
+ $paymentCode[1] == 'FI' or
208
+ $paymentCode[1] == 'RC')
209
+ and ($data['PROCESSING_RESULT'] == 'ACK' and $data['PROCESSING_STATUS_CODE'] != 80)
210
+ ) {
211
+ $url = $data['FRONTEND_SUCCESS_URL'];
212
+ } else {
213
+ $url = $data['FRONTEND_SUCCESS_URL'];
214
+ }
215
+
216
+ Mage::getModel('hcd/transaction')->saveTransactionData($data);
217
+ }
218
+
219
+ $this->log('Url: ' . $url);
220
+
221
+ // @codingStandardsIgnoreLine should be refactored - issue #5
222
+ print $url;
223
+ }
224
+
225
+ /**
226
+ * Save customer registration
227
+ *
228
+ * @param $data HeidelpayCD_Edition_Model_Transaction
229
+ * @param $paymentCode array
230
+ *
231
+ * @return HeidelpayCD_Edition_Model_Customer
232
+ */
233
+ protected function saveCustomerRegistration($data, $paymentCode)
234
+ {
235
+ /** @var $customerData HeidelpayCD_Edition_Model_Customer */
236
+ $customerData = Mage::getModel('hcd/customer');
237
+ $currentPayment = 'hcd' . strtolower($paymentCode[0]);
238
+ $storeId = ($data['CRITERION_GUEST'] == 'true')
239
+ ? 0 : trim($data['CRITERION_STOREID']);
240
+ $registrationData = Mage::getModel('hcd/customer')
241
+ ->getCollection()
242
+ ->addFieldToFilter('Customerid', trim($data['IDENTIFICATION_SHOPPERID']))
243
+ ->addFieldToFilter('Storeid', $storeId)
244
+ ->addFieldToFilter('Paymentmethode', trim($currentPayment));
245
+ $registrationData->load();
246
+ $returnData = $registrationData->getData();
247
+ if (!empty($returnData[0]['id'])) {
248
+ $customerData->setId((int)$returnData[0]['id']);
249
+ }
250
+
251
+ $customerData->setPaymentmethode($currentPayment);
252
+ $customerData->setUniqeid($data['IDENTIFICATION_UNIQUEID']);
253
+ $customerData->setCustomerid($data['IDENTIFICATION_SHOPPERID']);
254
+ $customerData->setStoreid($storeId);
255
+ $customerData->setPaymentData(
256
+ Mage::getModel('hcd/resource_encryption')
257
+ ->encrypt(
258
+ json_encode(
259
+ array(
260
+ 'ACCOUNT.REGISTRATION' => $data['IDENTIFICATION_UNIQUEID'],
261
+ 'SHIPPPING_HASH' => $data['CRITERION_SHIPPPING_HASH'],
262
+ 'ACCOUNT_BRAND' => $data['ACCOUNT_BRAND'],
263
+ 'ACCOUNT_NUMBER' => $data['ACCOUNT_NUMBER'],
264
+ 'ACCOUNT_HOLDER' => $data['ACCOUNT_HOLDER'],
265
+ 'ACCOUNT_EXPIRY_MONTH' => $data['ACCOUNT_EXPIRY_MONTH'],
266
+ 'ACCOUNT_EXPIRY_YEAR' => $data['ACCOUNT_EXPIRY_YEAR']
267
+ )
268
+ )
269
+ )
270
+ );
271
+
272
+ return $customerData->save();
273
+ }
274
+ }
app/code/community/HeidelpayCD/Edition/Edition/Edition/etc/config.xml ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <HeidelpayCD_Edition>
5
+ <version>17.5.17</version>
6
+ </HeidelpayCD_Edition>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <hcd>
11
+ <class>HeidelpayCD_Edition_Helper</class>
12
+ </hcd>
13
+ </helpers>
14
+ <models>
15
+ <hcd>
16
+ <class>HeidelpayCD_Edition_Model</class>
17
+ <resourceModel>hcd_resource</resourceModel>
18
+ </hcd>
19
+ <hcd_resource>
20
+ <class>HeidelpayCD_Edition_Model_Mysql4</class>
21
+ <entities>
22
+ <transaction>
23
+ <table>heidelpay_transaction</table>
24
+ </transaction>
25
+ <customer>
26
+ <table>heidelpay_customer</table>
27
+ </customer>
28
+ </entities>
29
+ </hcd_resource>
30
+ </models>
31
+ <blocks>
32
+ <hcd>
33
+ <class>HeidelpayCD_Edition_Block</class>
34
+ </hcd>
35
+ </blocks>
36
+ <resources>
37
+ <hcd_setup>
38
+ <setup>
39
+ <module>HeidelpayCD_Edition</module>
40
+ </setup>
41
+ </hcd_setup>
42
+ <hcd_write>
43
+ <connection>
44
+ <use>core_write</use>
45
+ </connection>
46
+ </hcd_write>
47
+ <hcd_read>
48
+ <connection>
49
+ <use>core_read</use>
50
+ </connection>
51
+ </hcd_read>
52
+ </resources>
53
+ <payment>
54
+ <groups>
55
+ <hcd>Heidelpay CD-Edition</hcd>
56
+ </groups>
57
+ </payment>
58
+ <events>
59
+ <checkout_onepage_controller_success_action>
60
+ <observers>
61
+ <controller_action_before>
62
+ <class>hcd/observer</class>
63
+ <method>removeWalletDataFromCheckout</method>
64
+ </controller_action_before>
65
+ </observers>
66
+ </checkout_onepage_controller_success_action>
67
+ <controller_action_predispatch_checkout>
68
+ <observers>
69
+ <controller_action_before>
70
+ <class>hcd/observer</class>
71
+ <method>handleWalletDataDuringCheckout</method>
72
+ </controller_action_before>
73
+ </observers>
74
+ </controller_action_predispatch_checkout>
75
+ <sales_order_shipment_save_before>
76
+ <observers>
77
+ <reportShippingToHeidelpay>
78
+ <class>hcd/observer</class>
79
+ <method>reportShippingToHeidelpay</method>
80
+ </reportShippingToHeidelpay>
81
+ </observers>
82
+ </sales_order_shipment_save_before>
83
+ </events>
84
+ <template>
85
+ <email>
86
+ <hcd_payment_info>
87
+ <label>Heidelpay payment informations</label>
88
+ <file>sales/hcd_payment_info.html</file>
89
+ <type>html</type>
90
+ </hcd_payment_info>
91
+ </email>
92
+ </template>
93
+ </global>
94
+ <frontend>
95
+ <secure_url>
96
+ <hcd_payment>hcd/</hcd_payment>
97
+ </secure_url>
98
+ <routers>
99
+ <hcd>
100
+ <use>standard</use>
101
+ <args>
102
+ <module>HeidelpayCD_Edition</module>
103
+ <frontName>hcd</frontName>
104
+ </args>
105
+ </hcd>
106
+ </routers>
107
+ <translate>
108
+ <modules>
109
+ <HeidelpayCD_Edition>
110
+ <files>
111
+ <default>HeidelpayCD_Edition.csv</default>
112
+ </files>
113
+ </HeidelpayCD_Edition>
114
+ </modules>
115
+ </translate>
116
+ <layout>
117
+ <updates>
118
+ <hcd>
119
+ <file>hcd.xml</file>
120
+ </hcd>
121
+ </updates>
122
+ </layout>
123
+ </frontend>
124
+ <adminhtml>
125
+ <translate>
126
+ <modules>
127
+ <HeidelpayCD_Edition>
128
+ <files>
129
+ <default>HeidelpayCD_Edition.csv</default>
130
+ </files>
131
+ </HeidelpayCD_Edition>
132
+ </modules>
133
+ </translate>
134
+ <acl>
135
+ <resources>
136
+ <admin>
137
+ <children>
138
+ <system>
139
+ <children>
140
+ <config>
141
+ <children>
142
+ <hcd>
143
+ <title>HeidelpayCD Edition</title>
144
+ </hcd>
145
+ </children>
146
+ </config>
147
+ </children>
148
+ </system>
149
+ </children>
150
+ </admin>
151
+ </resources>
152
+ </acl>
153
+ </adminhtml>
154
+ <default>
155
+ <hcd>
156
+ <settings>
157
+ <transactionmode>1</transactionmode>
158
+ <security_sender>31HA07BC8142C5A171745D00AD63D182</security_sender>
159
+ <user_id>31ha07bc8142c5a171744e5aef11ffd3</user_id>
160
+ <user_pwd>93167DE7</user_pwd>
161
+ <log>0</log>
162
+ <invoicing>0</invoicing>
163
+ <returnurl>onepage</returnurl>
164
+ </settings>
165
+ </hcd>
166
+ <payment>
167
+ <hcdcc>
168
+ <group>hcd</group>
169
+ <title>Credit Card</title>
170
+ <active>0</active>
171
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
172
+ <bookingmode>DB</bookingmode>
173
+ <invioce>1</invioce>
174
+ <capture_on_delivery>0</capture_on_delivery>
175
+ <model>hcd/payment_hcdcc</model>
176
+ <sort_order>1</sort_order>
177
+ <min_amount>0</min_amount>
178
+ <max_amount>0</max_amount>
179
+ <allowspecific>0</allowspecific>
180
+ </hcdcc>
181
+ <hcddc>
182
+ <group>hcd</group>
183
+ <title>Debit Card</title>
184
+ <active>0</active>
185
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
186
+ <bookingmode>DB</bookingmode>
187
+ <invioce>1</invioce>
188
+ <capture_on_delivery>0</capture_on_delivery>
189
+ <model>hcd/payment_hcddc</model>
190
+ <sort_order>1</sort_order>
191
+ <min_amount>0</min_amount>
192
+ <max_amount>0</max_amount>
193
+ <allowspecific>0</allowspecific>
194
+ </hcddc>
195
+ <hcddd>
196
+ <group>hcd</group>
197
+ <title>Direct Debit - Lastschrift</title>
198
+ <active>0</active>
199
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
200
+ <bookingmode>DB</bookingmode>
201
+ <insurence>0</insurence>
202
+ <invioce>1</invioce>
203
+ <capture_on_delivery>0</capture_on_delivery>
204
+ <model>hcd/payment_hcddd</model>
205
+ <sort_order>1</sort_order>
206
+ <min_amount>0</min_amount>
207
+ <max_amount>0</max_amount>
208
+ <allowspecific>0</allowspecific>
209
+ </hcddd>
210
+ <hcdddsec>
211
+ <group>hcd</group>
212
+ <title>Direct debit secured</title>
213
+ <active>0</active>
214
+ <channel>31HA07BC81856CAD6D8E0B3A3100FBA3</channel>
215
+ <bookingmode>DB</bookingmode>
216
+ <insurence>0</insurence>
217
+ <invioce>1</invioce>
218
+ <capture_on_delivery>0</capture_on_delivery>
219
+ <model>hcd/payment_hcdDirectDebitSecured</model>
220
+ <sort_order>1</sort_order>
221
+ <min_amount>10</min_amount>
222
+ <max_amount>0</max_amount>
223
+ <allowspecific>0</allowspecific>
224
+ </hcdddsec>
225
+ <hcdsu>
226
+ <group>hcd</group>
227
+ <title>SOFORT Überweisung</title>
228
+ <active>0</active>
229
+ <channel>31HA07BC8142C5A171749CDAA43365D2</channel>
230
+ <invioce>1</invioce>
231
+ <model>hcd/payment_hcdsu</model>
232
+ <sort_order>1</sort_order>
233
+ <min_amount>0</min_amount>
234
+ <max_amount>0</max_amount>
235
+ <allowspecific>1</allowspecific>
236
+ <specificcountry>BE,DE,IT,NL,AT,SI,ES</specificcountry>
237
+ </hcdsu>
238
+ <hcdgp>
239
+ <group>hcd</group>
240
+ <title>Giropay</title>
241
+ <active>0</active>
242
+ <channel>31HA07BC8142C5A171740166AF277E03</channel>
243
+ <invioce>1</invioce>
244
+ <model>hcd/payment_hcdgp</model>
245
+ <sort_order>1</sort_order>
246
+ <min_amount>0</min_amount>
247
+ <max_amount>0</max_amount>
248
+ <allowspecific>0</allowspecific>
249
+ </hcdgp>
250
+ <hcdbs>
251
+ <group>hcd</group>
252
+ <title>Kauf auf Rechnung</title>
253
+ <active>0</active>
254
+ <channel>31HA07BC8142EE6D02715F4CA97DDD8B</channel>
255
+ <model>hcd/payment_hcdbs</model>
256
+ <invioce>1</invioce>
257
+ <sort_order>1</sort_order>
258
+ <min_amount>0</min_amount>
259
+ <max_amount>0</max_amount>
260
+ <allowspecific>1</allowspecific>
261
+ <specificcountry>DE</specificcountry>
262
+ </hcdbs>
263
+ <hcdpal>
264
+ <group>hcd</group>
265
+ <title>Pay Pal</title>
266
+ <active>0</active>
267
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
268
+ <bookingmode>DB</bookingmode>
269
+ <invioce>1</invioce>
270
+ <capture_on_delivery>0</capture_on_delivery>
271
+ <model>hcd/payment_hcdpal</model>
272
+ <payment_action>Authorization</payment_action>
273
+ <sort_order>1</sort_order>
274
+ <min_amount>0</min_amount>
275
+ <max_amount>0</max_amount>
276
+ <allowspecific>0</allowspecific>
277
+ </hcdpal>
278
+ <hcdpp>
279
+ <group>hcd</group>
280
+ <title>Prepayment</title>
281
+ <active>0</active>
282
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
283
+ <invioce>1</invioce>
284
+ <model>hcd/payment_hcdpp</model>
285
+ <sort_order>1</sort_order>
286
+ <min_amount>0</min_amount>
287
+ <max_amount>0</max_amount>
288
+ <allowspecific>0</allowspecific>
289
+ </hcdpp>
290
+ <hcdiv>
291
+ <group>hcd</group>
292
+ <title>Invoice</title>
293
+ <active>0</active>
294
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
295
+ <invioce>0</invioce>
296
+ <capture_on_delivery>0</capture_on_delivery>
297
+ <model>hcd/payment_hcdiv</model>
298
+ <sort_order>1</sort_order>
299
+ <min_amount>0</min_amount>
300
+ <max_amount>0</max_amount>
301
+ <allowspecific>0</allowspecific>
302
+ </hcdiv>
303
+ <hcdivsec>
304
+ <group>hcd</group>
305
+ <title>Invoice secured</title>
306
+ <active>0</active>
307
+ <channel>31HA07BC81856CAD6D8E05CDDE7E2AC8</channel>
308
+ <invioce>0</invioce>
309
+ <capture_on_delivery>0</capture_on_delivery>
310
+ <model>hcd/payment_hcdInvoiceSecured</model>
311
+ <sort_order>1</sort_order>
312
+ <min_amount>10</min_amount>
313
+ <max_amount>0</max_amount>
314
+ <allowspecific>0</allowspecific>
315
+ </hcdivsec>
316
+ <hcdpf>
317
+ <group>hcd</group>
318
+ <title>Postfinance</title>
319
+ <active>0</active>
320
+ <channel>31HA07BC811E8AEF9AB2733D80C21DA8</channel>
321
+ <invioce>1</invioce>
322
+ <model>hcd/payment_hcdpf</model>
323
+ <sort_order>1</sort_order>
324
+ <min_amount>0</min_amount>
325
+ <max_amount>0</max_amount>
326
+ <allowspecific>1</allowspecific>
327
+ <specificcountry>CH</specificcountry>
328
+ </hcdpf>
329
+ <hcdeps>
330
+ <group>hcd</group>
331
+ <title>EPS</title>
332
+ <active>0</active>
333
+ <channel></channel>
334
+ <invioce>1</invioce>
335
+ <model>hcd/payment_hcdeps</model>
336
+ <sort_order>1</sort_order>
337
+ <min_amount>0</min_amount>
338
+ <max_amount>0</max_amount>
339
+ <allowspecific>1</allowspecific>
340
+ <specificcountry>AT</specificcountry>
341
+ </hcdeps>
342
+ <hcdide>
343
+ <group>hcd</group>
344
+ <title>Ideal</title>
345
+ <active>0</active>
346
+ <channel>31HA07BC8142C5A171744B56E61281E5</channel>
347
+ <invioce>1</invioce>
348
+ <model>hcd/payment_hcdide</model>
349
+ <sort_order>1</sort_order>
350
+ <min_amount>0</min_amount>
351
+ <max_amount>0</max_amount>
352
+ <allowspecific>1</allowspecific>
353
+ <specificcountry>NL</specificcountry>
354
+ </hcdide>
355
+ <hcdmpa>
356
+ <group>hcd</group>
357
+ <title>MasterPass</title>
358
+ <active>0</active>
359
+ <channel>31HA07BC814948E72EF669CA3BB1431F</channel>
360
+ <invioce>1</invioce>
361
+ <capture_on_delivery>0</capture_on_delivery>
362
+ <model>hcd/payment_hcdmpa</model>
363
+ <sort_order>1</sort_order>
364
+ <min_amount>0</min_amount>
365
+ <max_amount>0</max_amount>
366
+ <allowspecific>0</allowspecific>
367
+ </hcdmpa>
368
+ </payment>
369
+ </default>
370
+ </config>
app/code/community/HeidelpayCD/Edition/Edition/Edition/etc/system.xml ADDED
@@ -0,0 +1,1539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <!--{{{ Global Settings-->
5
+ <hcd translate="label" module="hcd">
6
+ <label>
7
+ <![CDATA[<img alt="Heidelpay" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAADBQTFRFODg43d3dt7e3KCgoREREU1NTAQEBEhIS////scfeeXl57OzsqKioXV1dk5OTnZ2dfmcBJgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDgsIBJoD8v4AAABKSURBVAjXY5gJBQwzOsCgE53RCmM0AxknQIwGIMOiOyxBA8TgcFson9YCZIRzdHT0JQAZZSA1y4CMIhCjDaQGxOjtxGkFkAFzBgC9LkKOoh4LJgAAAABJRU5ErkJggg==" /> Heidelpay CD-Edition ]]></label>
8
+ <tab>sales</tab>
9
+ <frontend_type>text</frontend_type>
10
+ <sort_order>405</sort_order>
11
+ <show_in_default>1</show_in_default>
12
+ <show_in_website>1</show_in_website>
13
+ <show_in_store>1</show_in_store>
14
+ <groups>
15
+ <about_us>
16
+ <label>about Heidelpay</label>
17
+ <frontend_type>text</frontend_type>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ <comment><![CDATA[<br />
23
+ <div class="box">
24
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAA7BAMAAAAEMPCJAAAAAXNSR0IArs4c6QAAABhQTFRFPT09u7u7////k5OTDw8Pa2tr2dnZ7u7uGx/afwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kKFggjGov/KAYAAAJ5SURBVEjH7dW7l6IwFAfgOKK247s1l0PS+rYNy2NbRVxbZUZtncyq//7eCD6QeGYo9pwtlgb55TPkARcCuQ6SB7OXXJz++M//Mt/l4sz+N/npJHV83SWEzHdpzutT1xXz9iNnXZcsBgvDnd1zGrqktCCYyhRnoddSybFuFG6cGl4Lb8e3TbcoE67OPCxeBkjDwoVToxgl6ee5F8XV+dW5Tgdv1E/48C79MJYxdwBM75bjlZBnfvCiu/QgogtX/d0dq4ri3Einw3LCzYc9YUQi3zsPeyRkzIe1h01avSAPH9NG5czZQze4UA6zaSalzpl3gswz0Nja79k0XCveiDINVrkQZtPfBcWLmRyYQ5xsSj3kopJtgND9mQ25gdwNNLyhTYeKR5qGvVvTpO+KS02DJXRpB7mnyfG50aXWM071ncSPmIbr0/x8rGvgv7RpkKtGqk/ZKB3El6z8jE/TQXxJ7S85m+Tilp2v93Yu/s2xv2FZpIsJ8Daw0WQKvDlTPFq3cKWr7dMRbh8T5AQLypBgWfChgUUY9sLoU5vNZ80AXnujgSWBL688rFkVLAargPrck/goTiNqU5tj1Rzg5rIi7QPt342d+lblRH3qm/jGEe5wWcLecaMOn8gG2LUZ3XHmd4Rr2PivF4AudQ0hkOP9zTq+U3XowQZSvXcK1eou5lPqVKvbFD/IXpqj4zUcjK8Gg4WklQzmQw0GzHaQ5szbrSo4VbLbCBhOPp3LVGc4VWCDPqTGjisoIlqGlSgRrOTxQs5HS9jgQuJ85I0fgUf4haslJ9yUtzHwHVsm28TV8G/8ycGWt9/jXJwFubhZ+wafXH8e5Ndcf/wBKDObGG4GKXIAAAAASUVORK5CYII=" alt="Heidelpay" />
25
+ <p style="font-size:12px; font-weight: bold;">Heidelberger Payment GmbH - Ihr Full Service Payment Provider - alles aus einer Hand </p>
26
+ <p></p> <p style="font-size:12px">Die Heidelberger Payment GmbH kurz: heidelpay bietet als BaFin-zertifizierter Payment Service Provider alles was zum Online-Payment gehört.<br /><br />
27
+ <a href="http://testshops.heidelpay.de/contactform/?campaign=MagentoWL&amp;shop=Magento" target="_blank" style="font-size: 12px; color: #000; font-weight: bold;">&gt;&gt;&gt; Informationen anfordern &lt;&lt;&lt;</a>
28
+ <br /></p><p><br /> </p><p style="font-size:12px">Das Leistungsspektrum des PCI DSS zertifizierten Unternehmens reicht von weltweiten e-Payment Lösungen, inklusive eines vollständigen Debitorenmanagement-, Risk- und Fraud- Systems
29
+ bis hin zu einem breiten Angebot alternativer Bezahlverfahren - schnell, sicher, einfach und umfassend - alles aus einer Hand.</p><br />
30
+ <a href="http://www.heidelpay.de" target="_blank" style="font-size: 12px; color: #000; font-weight: bold;">www.heidelpay.de</a>
31
+ <br /><br /><p style="font-size:12px;"> Die Plugin wird bei der Installation mit Testdaten aktiviert.</p>
32
+ </div>
33
+ ]]>
34
+ </comment>
35
+ </about_us>
36
+ <settings translate="label">
37
+ <label>General Settings Heidelpay</label>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <fields>
44
+ <transactionmode translate="label">
45
+ <label>Use Testsystem</label>
46
+ <frontend_type>select</frontend_type>
47
+ <source_model>adminhtml/system_config_source_yesno</source_model>
48
+ <comment>If is set to yes, transactionis use the sandbox system and the
49
+ TRANSACTION.MODE=CONNECTOR_TEST, otherwise real payment will be used with mode LIVE. For
50
+ details see integration basisc documentation.
51
+ </comment>
52
+ <sort_order>5</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ </transactionmode>
57
+ <security_sender translate="label">
58
+ <label>Security Sender</label>
59
+ <frontend_type>text</frontend_type>
60
+ <sort_order>10</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ </security_sender>
65
+ <user_id translate="label">
66
+ <label>User Login</label>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>20</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </user_id>
73
+ <user_pwd translate="label">
74
+ <label>User Password</label>
75
+ <frontend_type>text</frontend_type>
76
+ <sort_order>30</sort_order>
77
+ <show_in_default>1</show_in_default>
78
+ <show_in_website>1</show_in_website>
79
+ <show_in_store>1</show_in_store>
80
+ </user_pwd>
81
+ <returnurl translate="label">
82
+ <label>Return in Errorcase</label>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>hcd/system_config_source_returnurl</source_model>
85
+ <comment>Please configurate where your costumer should be redirected to in case of an
86
+ payment error
87
+ </comment>
88
+ <sort_order>50</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ </returnurl>
93
+ <log translate="label">
94
+ <label>Debug Log</label>
95
+ <frontend_type>select</frontend_type>
96
+ <source_model>adminhtml/system_config_source_yesno</source_model>
97
+ <comment>If is set to yes, you can controll all neccessary conntetion Data in
98
+ /var/log/Heidelpay.log
99
+ </comment>
100
+ <sort_order>60</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
+ </log>
105
+ <invoicing translate="label">
106
+ <label>Invoicing over heidelpay</label>
107
+ <frontend_type>select</frontend_type>
108
+ <source_model>adminhtml/system_config_source_yesno</source_model>
109
+ <comment>Invoicing over heidelpay requires an extra contract. For more information, please
110
+ contact your key account manager.
111
+ </comment>
112
+ <sort_order>70</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </invoicing>
117
+ </fields>
118
+ </settings>
119
+ </groups>
120
+ </hcd>
121
+ </sections>
122
+ <sections>
123
+ <payment>
124
+ <groups id="hcd" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1"
125
+ showInStore="1">
126
+ <hcdcc translate="label">
127
+ <label>Heidelpay Credit Card (hcd)</label>
128
+ <frontend_type>text</frontend_type>
129
+ <sort_order>50</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
+ <fields>
134
+ <title translate="label">
135
+ <label>Title</label>
136
+ <frontend_type>text</frontend_type>
137
+ <sort_order>10</sort_order>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>1</show_in_store>
141
+ </title>
142
+ <active translate="label">
143
+ <label>Enabled</label>
144
+ <frontend_type>select</frontend_type>
145
+ <source_model>adminhtml/system_config_source_yesno</source_model>
146
+ <sort_order>20</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ </active>
151
+ <channel translate="label">
152
+ <label>Channel ID</label>
153
+ <frontend_type>text</frontend_type>
154
+ <sort_order>40</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ </channel>
159
+ <bookingmode translate="label">
160
+ <label>Bookingmode</label>
161
+ <frontend_type>select</frontend_type>
162
+ <source_model>hcd/system_config_source_bookingmode</source_model>
163
+ <sort_order>50</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>
167
+ </bookingmode>
168
+ <recognition translate="label">
169
+ <label>Recognition</label>
170
+ <frontend_type>select</frontend_type>
171
+ <source_model>hcd/system_config_source_recognition</source_model>
172
+ <sort_order>60</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>1</show_in_store>
176
+ </recognition>
177
+ <invioce translate="label">
178
+ <label>Automatically invoiced</label>
179
+ <frontend_type>select</frontend_type>
180
+ <source_model>adminhtml/system_config_source_yesno</source_model>
181
+ <sort_order>70</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
+ </invioce>
186
+ <!--<capture_on_delivery translate="label">
187
+ <label>Automatically capture on delivery</label>
188
+ <frontend_type>select</frontend_type>
189
+ <source_model>adminhtml/system_config_source_yesno</source_model>
190
+ <comment>please note that capture on delivery is only possible, when you set bookingmode to preauthorisation</comment>
191
+ <sort_order>80</sort_order>
192
+ <show_in_default>1</show_in_default>
193
+ <show_in_website>1</show_in_website>
194
+ <show_in_store>1</show_in_store>
195
+ </capture_on_delivery>-->
196
+ <sort_order translate="label">
197
+ <label>Sort order</label>
198
+ <frontend_type>text</frontend_type>
199
+ <sort_order>110</sort_order>
200
+ <show_in_default>1</show_in_default>
201
+ <show_in_website>1</show_in_website>
202
+ <show_in_store>1</show_in_store>
203
+ </sort_order>
204
+ <min_amount translate="label">
205
+ <label>Minimum Amount (CENT)</label>
206
+ <frontend_type>text</frontend_type>
207
+ <sort_order>120</sort_order>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>1</show_in_store>
211
+ </min_amount>
212
+ <max_amount translate="label">
213
+ <label>Maximum Amount (CENT)</label>
214
+ <frontend_type>text</frontend_type>
215
+ <sort_order>130</sort_order>
216
+ <show_in_default>1</show_in_default>
217
+ <show_in_website>1</show_in_website>
218
+ <show_in_store>1</show_in_store>
219
+ </max_amount>
220
+ <allowspecific translate="label">
221
+ <label>allow specific countries</label>
222
+ <frontend_type>allowspecific</frontend_type>
223
+ <sort_order>140</sort_order>
224
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
225
+ <show_in_default>1</show_in_default>
226
+ <show_in_website>1</show_in_website>
227
+ <show_in_store>1</show_in_store>
228
+ </allowspecific>
229
+ <specificcountry translate="label">
230
+ <label>specific countries</label>
231
+ <frontend_type>multiselect</frontend_type>
232
+ <sort_order>150</sort_order>
233
+ <source_model>adminhtml/system_config_source_country</source_model>
234
+ <show_in_default>1</show_in_default>
235
+ <show_in_website>1</show_in_website>
236
+ <show_in_store>1</show_in_store>
237
+ </specificcountry>
238
+ </fields>
239
+ </hcdcc>
240
+ <hcddc translate="label">
241
+ <label>Heidelpay Debit Card (hcd)</label>
242
+ <frontend_type>text</frontend_type>
243
+ <sort_order>130</sort_order>
244
+ <show_in_default>1</show_in_default>
245
+ <show_in_website>1</show_in_website>
246
+ <show_in_store>1</show_in_store>
247
+ <fields>
248
+ <title translate="label">
249
+ <label>Title</label>
250
+ <frontend_type>text</frontend_type>
251
+ <sort_order>10</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
+ </title>
256
+ <active translate="label">
257
+ <label>Enabled</label>
258
+ <frontend_type>select</frontend_type>
259
+ <source_model>adminhtml/system_config_source_yesno</source_model>
260
+ <sort_order>20</sort_order>
261
+ <show_in_default>1</show_in_default>
262
+ <show_in_website>1</show_in_website>
263
+ <show_in_store>1</show_in_store>
264
+ </active>
265
+ <channel translate="label">
266
+ <label>Channel ID</label>
267
+ <frontend_type>text</frontend_type>
268
+ <sort_order>40</sort_order>
269
+ <show_in_default>1</show_in_default>
270
+ <show_in_website>1</show_in_website>
271
+ <show_in_store>1</show_in_store>
272
+ </channel>
273
+ <bookingmode translate="label">
274
+ <label>Bookinnmode</label>
275
+ <frontend_type>select</frontend_type>
276
+ <source_model>hcd/system_config_source_bookingmode</source_model>
277
+ <sort_order>50</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ </bookingmode>
282
+ <recognition translate="label">
283
+ <label>Recognition</label>
284
+ <frontend_type>select</frontend_type>
285
+ <source_model>hcd/system_config_source_recognition</source_model>
286
+ <sort_order>60</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>
290
+ </recognition>
291
+ <invioce translate="label">
292
+ <label>Automatically invoiced</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>adminhtml/system_config_source_yesno</source_model>
295
+ <sort_order>70</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
+ </invioce>
300
+ <sort_order translate="label">
301
+ <label>Sort order</label>
302
+ <frontend_type>text</frontend_type>
303
+ <sort_order>110</sort_order>
304
+ <show_in_default>1</show_in_default>
305
+ <show_in_website>1</show_in_website>
306
+ <show_in_store>1</show_in_store>
307
+ </sort_order>
308
+ <min_amount translate="label">
309
+ <label>Minimum Amount (CENT)</label>
310
+ <frontend_type>text</frontend_type>
311
+ <sort_order>120</sort_order>
312
+ <show_in_default>1</show_in_default>
313
+ <show_in_website>1</show_in_website>
314
+ <show_in_store>1</show_in_store>
315
+ </min_amount>
316
+ <max_amount translate="label">
317
+ <label>Maximum Amount (CENT)</label>
318
+ <frontend_type>text</frontend_type>
319
+ <sort_order>130</sort_order>
320
+ <show_in_default>1</show_in_default>
321
+ <show_in_website>1</show_in_website>
322
+ <show_in_store>1</show_in_store>
323
+ </max_amount>
324
+ <allowspecific translate="label">
325
+ <label>allow specific countries</label>
326
+ <frontend_type>allowspecific</frontend_type>
327
+ <sort_order>140</sort_order>
328
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
329
+ <show_in_default>1</show_in_default>
330
+ <show_in_website>1</show_in_website>
331
+ <show_in_store>1</show_in_store>
332
+ </allowspecific>
333
+ <specificcountry translate="label">
334
+ <label>specific countries</label>
335
+ <frontend_type>multiselect</frontend_type>
336
+ <sort_order>150</sort_order>
337
+ <source_model>adminhtml/system_config_source_country</source_model>
338
+ <show_in_default>1</show_in_default>
339
+ <show_in_website>1</show_in_website>
340
+ <show_in_store>1</show_in_store>
341
+ </specificcountry>
342
+ </fields>
343
+ </hcddc>
344
+ <hcddd translate="label">
345
+ <label>Heidelpay Direct Debit (hcd)</label>
346
+ <frontend_type>text</frontend_type>
347
+ <sort_order>60</sort_order>
348
+ <show_in_default>1</show_in_default>
349
+ <show_in_website>1</show_in_website>
350
+ <show_in_store>1</show_in_store>
351
+ <fields>
352
+ <title translate="label">
353
+ <label>Title</label>
354
+ <frontend_type>text</frontend_type>
355
+ <sort_order>10</sort_order>
356
+ <show_in_default>1</show_in_default>
357
+ <show_in_website>1</show_in_website>
358
+ <show_in_store>1</show_in_store>
359
+ </title>
360
+ <active translate="label">
361
+ <label>Enabled</label>
362
+ <frontend_type>select</frontend_type>
363
+ <source_model>adminhtml/system_config_source_yesno</source_model>
364
+ <sort_order>20</sort_order>
365
+ <show_in_default>1</show_in_default>
366
+ <show_in_website>1</show_in_website>
367
+ <show_in_store>1</show_in_store>
368
+ </active>
369
+ <channel translate="label">
370
+ <label>Channel ID</label>
371
+ <frontend_type>text</frontend_type>
372
+ <sort_order>40</sort_order>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>1</show_in_website>
375
+ <show_in_store>1</show_in_store>
376
+ </channel>
377
+ <bookingmode translate="label">
378
+ <label>Bookingmode</label>
379
+ <frontend_type>select</frontend_type>
380
+ <source_model>hcd/system_config_source_bookingmode</source_model>
381
+ <sort_order>50</sort_order>
382
+ <show_in_default>1</show_in_default>
383
+ <show_in_website>1</show_in_website>
384
+ <show_in_store>1</show_in_store>
385
+ </bookingmode>
386
+ <recognition translate="label">
387
+ <label>Recognition</label>
388
+ <frontend_type>select</frontend_type>
389
+ <source_model>hcd/system_config_source_recognition</source_model>
390
+ <sort_order>60</sort_order>
391
+ <show_in_default>1</show_in_default>
392
+ <show_in_website>1</show_in_website>
393
+ <show_in_store>1</show_in_store>
394
+ </recognition>
395
+ <invioce translate="label">
396
+ <label>Automatically invoiced</label>
397
+ <frontend_type>select</frontend_type>
398
+ <source_model>adminhtml/system_config_source_yesno</source_model>
399
+ <sort_order>70</sort_order>
400
+ <show_in_default>1</show_in_default>
401
+ <show_in_website>1</show_in_website>
402
+ <show_in_store>1</show_in_store>
403
+ </invioce>
404
+ <sort_order translate="label">
405
+ <label>Sort order</label>
406
+ <frontend_type>text</frontend_type>
407
+ <sort_order>110</sort_order>
408
+ <show_in_default>1</show_in_default>
409
+ <show_in_website>1</show_in_website>
410
+ <show_in_store>1</show_in_store>
411
+ </sort_order>
412
+ <min_amount translate="label">
413
+ <label>Minimum Amount (CENT)</label>
414
+ <frontend_type>text</frontend_type>
415
+ <sort_order>120</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
+ </min_amount>
420
+ <max_amount translate="label">
421
+ <label>Maximum Amount (CENT)</label>
422
+ <frontend_type>text</frontend_type>
423
+ <sort_order>130</sort_order>
424
+ <show_in_default>1</show_in_default>
425
+ <show_in_website>1</show_in_website>
426
+ <show_in_store>1</show_in_store>
427
+ </max_amount>
428
+ <allowspecific translate="label">
429
+ <label>allow specific countries</label>
430
+ <frontend_type>allowspecific</frontend_type>
431
+ <sort_order>140</sort_order>
432
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
433
+ <show_in_default>1</show_in_default>
434
+ <show_in_website>1</show_in_website>
435
+ <show_in_store>1</show_in_store>
436
+ </allowspecific>
437
+ <specificcountry translate="label">
438
+ <label>specific countries</label>
439
+ <frontend_type>multiselect</frontend_type>
440
+ <sort_order>150</sort_order>
441
+ <source_model>adminhtml/system_config_source_country</source_model>
442
+ <show_in_default>1</show_in_default>
443
+ <show_in_website>1</show_in_website>
444
+ <show_in_store>1</show_in_store>
445
+ </specificcountry>
446
+ </fields>
447
+ </hcddd>
448
+ <hcdddsec translate="label">
449
+ <label>Heidelpay direct debit secured(hcd)</label>
450
+ <frontend_type>text</frontend_type>
451
+ <sort_order>65</sort_order>
452
+ <show_in_default>1</show_in_default>
453
+ <show_in_website>1</show_in_website>
454
+ <show_in_store>1</show_in_store>
455
+ <fields>
456
+ <title translate="label">
457
+ <label>Title</label>
458
+ <frontend_type>text</frontend_type>
459
+ <sort_order>10</sort_order>
460
+ <show_in_default>1</show_in_default>
461
+ <show_in_website>1</show_in_website>
462
+ <show_in_store>1</show_in_store>
463
+ </title>
464
+ <active translate="label">
465
+ <label>Enabled</label>
466
+ <frontend_type>select</frontend_type>
467
+ <source_model>adminhtml/system_config_source_yesno</source_model>
468
+ <sort_order>20</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
+ </active>
473
+ <channel translate="label">
474
+ <label>Channel ID</label>
475
+ <frontend_type>text</frontend_type>
476
+ <sort_order>40</sort_order>
477
+ <show_in_default>1</show_in_default>
478
+ <show_in_website>1</show_in_website>
479
+ <show_in_store>1</show_in_store>
480
+ </channel>
481
+ <recognition translate="label">
482
+ <label>Recognition</label>
483
+ <frontend_type>select</frontend_type>
484
+ <source_model>hcd/system_config_source_recognition</source_model>
485
+ <sort_order>60</sort_order>
486
+ <show_in_default>1</show_in_default>
487
+ <show_in_website>1</show_in_website>
488
+ <show_in_store>1</show_in_store>
489
+ </recognition>
490
+ <invioce translate="label">
491
+ <label>Automatically invoiced</label>
492
+ <frontend_type>select</frontend_type>
493
+ <source_model>adminhtml/system_config_source_yesno</source_model>
494
+ <sort_order>70</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <show_in_store>1</show_in_store>
498
+ </invioce>
499
+ <sort_order translate="label">
500
+ <label>Sort order</label>
501
+ <frontend_type>text</frontend_type>
502
+ <sort_order>110</sort_order>
503
+ <show_in_default>1</show_in_default>
504
+ <show_in_website>1</show_in_website>
505
+ <show_in_store>1</show_in_store>
506
+ </sort_order>
507
+ <min_amount translate="label">
508
+ <label>Minimum Amount (CENT)</label>
509
+ <frontend_type>text</frontend_type>
510
+ <sort_order>120</sort_order>
511
+ <show_in_default>1</show_in_default>
512
+ <show_in_website>1</show_in_website>
513
+ <show_in_store>1</show_in_store>
514
+ </min_amount>
515
+ <max_amount translate="label">
516
+ <label>Maximum Amount (CENT)</label>
517
+ <frontend_type>text</frontend_type>
518
+ <sort_order>130</sort_order>
519
+ <show_in_default>1</show_in_default>
520
+ <show_in_website>1</show_in_website>
521
+ <show_in_store>1</show_in_store>
522
+ </max_amount>
523
+ <allowspecific translate="label">
524
+ <label>allow specific countries</label>
525
+ <frontend_type>allowspecific</frontend_type>
526
+ <sort_order>140</sort_order>
527
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
528
+ <show_in_default>1</show_in_default>
529
+ <show_in_website>1</show_in_website>
530
+ <show_in_store>1</show_in_store>
531
+ </allowspecific>
532
+ <specificcountry translate="label">
533
+ <label>specific countries</label>
534
+ <frontend_type>multiselect</frontend_type>
535
+ <sort_order>150</sort_order>
536
+ <source_model>adminhtml/system_config_source_country</source_model>
537
+ <show_in_default>1</show_in_default>
538
+ <show_in_website>1</show_in_website>
539
+ <show_in_store>1</show_in_store>
540
+ </specificcountry>
541
+ </fields>
542
+ </hcdddsec>
543
+ <hcdsu translate="label">
544
+ <label><![CDATA[Heidelpay SOFORT &Uuml;berweisung (hcd)]]></label>
545
+ <frontend_type>text</frontend_type>
546
+ <sort_order>80</sort_order>
547
+ <show_in_default>1</show_in_default>
548
+ <show_in_website>1</show_in_website>
549
+ <show_in_store>1</show_in_store>
550
+ <fields>
551
+ <title translate="label">
552
+ <label>Title</label>
553
+ <frontend_type>text</frontend_type>
554
+ <sort_order>10</sort_order>
555
+ <show_in_default>1</show_in_default>
556
+ <show_in_website>1</show_in_website>
557
+ <show_in_store>1</show_in_store>
558
+ </title>
559
+ <active translate="label">
560
+ <label>Enabled</label>
561
+ <frontend_type>select</frontend_type>
562
+ <source_model>adminhtml/system_config_source_yesno</source_model>
563
+ <sort_order>20</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
+ </active>
568
+ <channel translate="label">
569
+ <label>Channel ID</label>
570
+ <frontend_type>text</frontend_type>
571
+ <sort_order>40</sort_order>
572
+ <show_in_default>1</show_in_default>
573
+ <show_in_website>1</show_in_website>
574
+ <show_in_store>1</show_in_store>
575
+ </channel>
576
+ <invioce translate="label">
577
+ <label>Automatically invoiced</label>
578
+ <frontend_type>select</frontend_type>
579
+ <source_model>adminhtml/system_config_source_yesno</source_model>
580
+ <sort_order>70</sort_order>
581
+ <show_in_default>1</show_in_default>
582
+ <show_in_website>1</show_in_website>
583
+ <show_in_store>1</show_in_store>
584
+ </invioce>
585
+ <sort_order translate="label">
586
+ <label>Sort order</label>
587
+ <frontend_type>text</frontend_type>
588
+ <sort_order>110</sort_order>
589
+ <show_in_default>1</show_in_default>
590
+ <show_in_website>1</show_in_website>
591
+ <show_in_store>1</show_in_store>
592
+ </sort_order>
593
+ <min_amount translate="label">
594
+ <label>Minimum Amount (CENT)</label>
595
+ <frontend_type>text</frontend_type>
596
+ <sort_order>120</sort_order>
597
+ <show_in_default>1</show_in_default>
598
+ <show_in_website>1</show_in_website>
599
+ <show_in_store>1</show_in_store>
600
+ </min_amount>
601
+ <max_amount translate="label">
602
+ <label>Maximum Amount (CENT)</label>
603
+ <frontend_type>text</frontend_type>
604
+ <sort_order>130</sort_order>
605
+ <show_in_default>1</show_in_default>
606
+ <show_in_website>1</show_in_website>
607
+ <show_in_store>1</show_in_store>
608
+ </max_amount>
609
+ <allowspecific translate="label">
610
+ <label>allow specific countries</label>
611
+ <frontend_type>allowspecific</frontend_type>
612
+ <sort_order>140</sort_order>
613
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
614
+ <show_in_default>1</show_in_default>
615
+ <show_in_website>1</show_in_website>
616
+ <show_in_store>1</show_in_store>
617
+ </allowspecific>
618
+ <specificcountry translate="label">
619
+ <label>specific countries</label>
620
+ <frontend_type>multiselect</frontend_type>
621
+ <sort_order>150</sort_order>
622
+ <source_model>adminhtml/system_config_source_country</source_model>
623
+ <show_in_default>1</show_in_default>
624
+ <show_in_website>1</show_in_website>
625
+ <show_in_store>1</show_in_store>
626
+ </specificcountry>
627
+ </fields>
628
+ </hcdsu>
629
+ <hcdgp translate="label">
630
+ <label>Heidelpay Giropay (hcd)</label>
631
+ <frontend_type>text</frontend_type>
632
+ <sort_order>90</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
+ <title translate="label">
638
+ <label>Title</label>
639
+ <frontend_type>text</frontend_type>
640
+ <sort_order>10</sort_order>
641
+ <show_in_default>1</show_in_default>
642
+ <show_in_website>1</show_in_website>
643
+ <show_in_store>1</show_in_store>
644
+ </title>
645
+ <active translate="label">
646
+ <label>Enabled</label>
647
+ <frontend_type>select</frontend_type>
648
+ <source_model>adminhtml/system_config_source_yesno</source_model>
649
+ <sort_order>20</sort_order>
650
+ <show_in_default>1</show_in_default>
651
+ <show_in_website>1</show_in_website>
652
+ <show_in_store>1</show_in_store>
653
+ </active>
654
+ <channel translate="label">
655
+ <label>Channel ID</label>
656
+ <frontend_type>text</frontend_type>
657
+ <sort_order>40</sort_order>
658
+ <show_in_default>1</show_in_default>
659
+ <show_in_website>1</show_in_website>
660
+ <show_in_store>1</show_in_store>
661
+ </channel>
662
+ <recognition translate="label">
663
+ <label>Recognition</label>
664
+ <frontend_type>select</frontend_type>
665
+ <source_model>hcd/system_config_source_recognition</source_model>
666
+ <sort_order>60</sort_order>
667
+ <show_in_default>1</show_in_default>
668
+ <show_in_website>1</show_in_website>
669
+ <show_in_store>1</show_in_store>
670
+ </recognition>
671
+ <invioce translate="label">
672
+ <label>Automatically invoiced</label>
673
+ <frontend_type>select</frontend_type>
674
+ <source_model>adminhtml/system_config_source_yesno</source_model>
675
+ <sort_order>70</sort_order>
676
+ <show_in_default>1</show_in_default>
677
+ <show_in_website>1</show_in_website>
678
+ <show_in_store>1</show_in_store>
679
+ </invioce>
680
+ <sort_order translate="label">
681
+ <label>Sort order</label>
682
+ <frontend_type>text</frontend_type>
683
+ <sort_order>110</sort_order>
684
+ <show_in_default>1</show_in_default>
685
+ <show_in_website>1</show_in_website>
686
+ <show_in_store>1</show_in_store>
687
+ </sort_order>
688
+ <min_amount translate="label">
689
+ <label>Minimum Amount (CENT)</label>
690
+ <frontend_type>text</frontend_type>
691
+ <sort_order>120</sort_order>
692
+ <show_in_default>1</show_in_default>
693
+ <show_in_website>1</show_in_website>
694
+ <show_in_store>1</show_in_store>
695
+ </min_amount>
696
+ <max_amount translate="label">
697
+ <label>Maximum Amount (CENT)</label>
698
+ <frontend_type>text</frontend_type>
699
+ <sort_order>130</sort_order>
700
+ <show_in_default>1</show_in_default>
701
+ <show_in_website>1</show_in_website>
702
+ <show_in_store>1</show_in_store>
703
+ </max_amount>
704
+ <allowspecific translate="label">
705
+ <label>allow specific countries</label>
706
+ <frontend_type>allowspecific</frontend_type>
707
+ <sort_order>140</sort_order>
708
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
709
+ <show_in_default>1</show_in_default>
710
+ <show_in_website>1</show_in_website>
711
+ <show_in_store>1</show_in_store>
712
+ </allowspecific>
713
+ <specificcountry translate="label">
714
+ <label>specific countries</label>
715
+ <frontend_type>multiselect</frontend_type>
716
+ <sort_order>150</sort_order>
717
+ <source_model>adminhtml/system_config_source_country</source_model>
718
+ <show_in_default>1</show_in_default>
719
+ <show_in_website>1</show_in_website>
720
+ <show_in_store>1</show_in_store>
721
+ </specificcountry>
722
+ </fields>
723
+ </hcdgp>
724
+ <hcdbs translate="label">
725
+ <label>Heidelpay Billsafe (hcd)</label>
726
+ <frontend_type>text</frontend_type>
727
+ <sort_order>100</sort_order>
728
+ <show_in_default>1</show_in_default>
729
+ <show_in_website>1</show_in_website>
730
+ <show_in_store>1</show_in_store>
731
+ <fields>
732
+ <title translate="label">
733
+ <label>Title</label>
734
+ <frontend_type>text</frontend_type>
735
+ <sort_order>10</sort_order>
736
+ <show_in_default>1</show_in_default>
737
+ <show_in_website>1</show_in_website>
738
+ <show_in_store>1</show_in_store>
739
+ </title>
740
+ <active translate="label">
741
+ <label>Enabled</label>
742
+ <frontend_type>select</frontend_type>
743
+ <source_model>adminhtml/system_config_source_yesno</source_model>
744
+ <sort_order>20</sort_order>
745
+ <show_in_default>1</show_in_default>
746
+ <show_in_website>1</show_in_website>
747
+ <show_in_store>1</show_in_store>
748
+ </active>
749
+ <channel translate="label">
750
+ <label>Channel ID</label>
751
+ <frontend_type>text</frontend_type>
752
+ <sort_order>40</sort_order>
753
+ <show_in_default>1</show_in_default>
754
+ <show_in_website>1</show_in_website>
755
+ <show_in_store>1</show_in_store>
756
+ </channel>
757
+ <sort_order translate="label">
758
+ <label>Sort order</label>
759
+ <frontend_type>text</frontend_type>
760
+ <sort_order>110</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
+ </sort_order>
765
+ <min_amount translate="label">
766
+ <label>Minimum Amount (CENT)</label>
767
+ <frontend_type>text</frontend_type>
768
+ <sort_order>120</sort_order>
769
+ <show_in_default>1</show_in_default>
770
+ <show_in_website>1</show_in_website>
771
+ <show_in_store>1</show_in_store>
772
+ </min_amount>
773
+ <max_amount translate="label">
774
+ <label>Maximum Amount (CENT)</label>
775
+ <frontend_type>text</frontend_type>
776
+ <sort_order>130</sort_order>
777
+ <show_in_default>1</show_in_default>
778
+ <show_in_website>1</show_in_website>
779
+ <show_in_store>1</show_in_store>
780
+ </max_amount>
781
+ <allowspecific translate="label">
782
+ <label>allow specific countries</label>
783
+ <frontend_type>allowspecific</frontend_type>
784
+ <sort_order>140</sort_order>
785
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
786
+ <show_in_default>1</show_in_default>
787
+ <show_in_website>1</show_in_website>
788
+ <show_in_store>1</show_in_store>
789
+ </allowspecific>
790
+ <specificcountry translate="label">
791
+ <label>specific countries</label>
792
+ <frontend_type>multiselect</frontend_type>
793
+ <sort_order>150</sort_order>
794
+ <source_model>adminhtml/system_config_source_country</source_model>
795
+ <show_in_default>1</show_in_default>
796
+ <show_in_website>1</show_in_website>
797
+ <show_in_store>1</show_in_store>
798
+ </specificcountry>
799
+ </fields>
800
+ </hcdbs>
801
+ <hcdpal translate="label">
802
+ <label>Heidelpay Pay Pal (hcd)</label>
803
+ <frontend_type>text</frontend_type>
804
+ <sort_order>70</sort_order>
805
+ <show_in_default>1</show_in_default>
806
+ <show_in_website>1</show_in_website>
807
+ <show_in_store>1</show_in_store>
808
+ <fields>
809
+ <title translate="label">
810
+ <label>Title</label>
811
+ <frontend_type>text</frontend_type>
812
+ <sort_order>10</sort_order>
813
+ <show_in_default>1</show_in_default>
814
+ <show_in_website>1</show_in_website>
815
+ <show_in_store>1</show_in_store>
816
+ </title>
817
+ <active translate="label">
818
+ <label>Enabled</label>
819
+ <frontend_type>select</frontend_type>
820
+ <source_model>adminhtml/system_config_source_yesno</source_model>
821
+ <sort_order>20</sort_order>
822
+ <show_in_default>1</show_in_default>
823
+ <show_in_website>1</show_in_website>
824
+ <show_in_store>1</show_in_store>
825
+ </active>
826
+ <channel translate="label">
827
+ <label>Channel ID</label>
828
+ <frontend_type>text</frontend_type>
829
+ <sort_order>40</sort_order>
830
+ <show_in_default>1</show_in_default>
831
+ <show_in_website>1</show_in_website>
832
+ <show_in_store>1</show_in_store>
833
+ </channel>
834
+ <bookingmode translate="label">
835
+ <label>Bookingmode</label>
836
+ <frontend_type>select</frontend_type>
837
+ <source_model>hcd/system_config_source_bookingmode</source_model>
838
+ <sort_order>50</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
+ </bookingmode>
843
+ <invioce translate="label">
844
+ <label>Automatically invoiced</label>
845
+ <frontend_type>select</frontend_type>
846
+ <source_model>adminhtml/system_config_source_yesno</source_model>
847
+ <sort_order>70</sort_order>
848
+ <show_in_default>1</show_in_default>
849
+ <show_in_website>1</show_in_website>
850
+ <show_in_store>1</show_in_store>
851
+ </invioce>
852
+ <!--<capture_on_delivery translate="label">
853
+ <label>Automatically capture on delivery</label>
854
+ <frontend_type>select</frontend_type>
855
+ <source_model>adminhtml/system_config_source_yesno</source_model>
856
+ <comment>please note that capture on delivery is only possible, when you set bookingmode to preauthorisation</comment>
857
+ <sort_order>80</sort_order>
858
+ <show_in_default>1</show_in_default>
859
+ <show_in_website>1</show_in_website>
860
+ <show_in_store>1</show_in_store>
861
+ </capture_on_delivery>-->
862
+ <sort_order translate="label">
863
+ <label>Sort order</label>
864
+ <frontend_type>text</frontend_type>
865
+ <sort_order>110</sort_order>
866
+ <show_in_default>1</show_in_default>
867
+ <show_in_website>1</show_in_website>
868
+ <show_in_store>1</show_in_store>
869
+ </sort_order>
870
+ <min_amount translate="label">
871
+ <label>Minimum Amount (CENT)</label>
872
+ <frontend_type>text</frontend_type>
873
+ <sort_order>120</sort_order>
874
+ <show_in_default>1</show_in_default>
875
+ <show_in_website>1</show_in_website>
876
+ <show_in_store>1</show_in_store>
877
+ </min_amount>
878
+ <max_amount translate="label">
879
+ <label>Maximum Amount (CENT)</label>
880
+ <frontend_type>text</frontend_type>
881
+ <sort_order>130</sort_order>
882
+ <show_in_default>1</show_in_default>
883
+ <show_in_website>1</show_in_website>
884
+ <show_in_store>1</show_in_store>
885
+ </max_amount>
886
+ <allowspecific translate="label">
887
+ <label>allow specific countries</label>
888
+ <frontend_type>allowspecific</frontend_type>
889
+ <sort_order>140</sort_order>
890
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
891
+ <show_in_default>1</show_in_default>
892
+ <show_in_website>1</show_in_website>
893
+ <show_in_store>1</show_in_store>
894
+ </allowspecific>
895
+ <specificcountry translate="label">
896
+ <label>specific countries</label>
897
+ <frontend_type>multiselect</frontend_type>
898
+ <sort_order>150</sort_order>
899
+ <source_model>adminhtml/system_config_source_country</source_model>
900
+ <show_in_default>1</show_in_default>
901
+ <show_in_website>1</show_in_website>
902
+ <show_in_store>1</show_in_store>
903
+ </specificcountry>
904
+ </fields>
905
+ </hcdpal>
906
+ <hcdeps translate="label">
907
+ <label>Heidelpay EPS (hcd)</label>
908
+ <frontend_type>text</frontend_type>
909
+ <sort_order>150</sort_order>
910
+ <show_in_default>1</show_in_default>
911
+ <show_in_website>1</show_in_website>
912
+ <show_in_store>1</show_in_store>
913
+ <fields>
914
+ <title translate="label">
915
+ <label>Title</label>
916
+ <frontend_type>text</frontend_type>
917
+ <sort_order>10</sort_order>
918
+ <show_in_default>1</show_in_default>
919
+ <show_in_website>1</show_in_website>
920
+ <show_in_store>1</show_in_store>
921
+ </title>
922
+ <active translate="label">
923
+ <label>Enabled</label>
924
+ <frontend_type>select</frontend_type>
925
+ <source_model>adminhtml/system_config_source_yesno</source_model>
926
+ <sort_order>20</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>
930
+ </active>
931
+ <channel translate="label">
932
+ <label>Channel ID</label>
933
+ <frontend_type>text</frontend_type>
934
+ <sort_order>40</sort_order>
935
+ <show_in_default>1</show_in_default>
936
+ <show_in_website>1</show_in_website>
937
+ <show_in_store>1</show_in_store>
938
+ </channel>
939
+ <invioce translate="label">
940
+ <label>Automatically invoiced</label>
941
+ <frontend_type>select</frontend_type>
942
+ <source_model>adminhtml/system_config_source_yesno</source_model>
943
+ <sort_order>70</sort_order>
944
+ <show_in_default>1</show_in_default>
945
+ <show_in_website>1</show_in_website>
946
+ <show_in_store>1</show_in_store>
947
+ </invioce>
948
+ <sort_order translate="label">
949
+ <label>Sort order</label>
950
+ <frontend_type>text</frontend_type>
951
+ <sort_order>110</sort_order>
952
+ <show_in_default>1</show_in_default>
953
+ <show_in_website>1</show_in_website>
954
+ <show_in_store>1</show_in_store>
955
+ </sort_order>
956
+ <min_amount translate="label">
957
+ <label>Minimum Amount (CENT)</label>
958
+ <frontend_type>text</frontend_type>
959
+ <sort_order>120</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>
963
+ </min_amount>
964
+ <max_amount translate="label">
965
+ <label>Maximum Amount (CENT)</label>
966
+ <frontend_type>text</frontend_type>
967
+ <sort_order>130</sort_order>
968
+ <show_in_default>1</show_in_default>
969
+ <show_in_website>1</show_in_website>
970
+ <show_in_store>1</show_in_store>
971
+ </max_amount>
972
+ <allowspecific translate="label">
973
+ <label>allow specific countries</label>
974
+ <frontend_type>allowspecific</frontend_type>
975
+ <sort_order>140</sort_order>
976
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
977
+ <show_in_default>1</show_in_default>
978
+ <show_in_website>1</show_in_website>
979
+ <show_in_store>1</show_in_store>
980
+ </allowspecific>
981
+ <specificcountry translate="label">
982
+ <label>specific countries</label>
983
+ <frontend_type>multiselect</frontend_type>
984
+ <sort_order>150</sort_order>
985
+ <source_model>adminhtml/system_config_source_country</source_model>
986
+ <show_in_default>1</show_in_default>
987
+ <show_in_website>1</show_in_website>
988
+ <show_in_store>1</show_in_store>
989
+ </specificcountry>
990
+ </fields>
991
+ </hcdeps>
992
+ <hcdide translate="label">
993
+ <label>Heidelpay iDeal (hcd)</label>
994
+ <frontend_type>text</frontend_type>
995
+ <sort_order>160</sort_order>
996
+ <show_in_default>1</show_in_default>
997
+ <show_in_website>1</show_in_website>
998
+ <show_in_store>1</show_in_store>
999
+ <fields>
1000
+ <title translate="label">
1001
+ <label>Title</label>
1002
+ <frontend_type>text</frontend_type>
1003
+ <sort_order>10</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
+ </title>
1008
+ <active translate="label">
1009
+ <label>Enabled</label>
1010
+ <frontend_type>select</frontend_type>
1011
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1012
+ <sort_order>20</sort_order>
1013
+ <show_in_default>1</show_in_default>
1014
+ <show_in_website>1</show_in_website>
1015
+ <show_in_store>1</show_in_store>
1016
+ </active>
1017
+ <channel translate="label">
1018
+ <label>Channel ID</label>
1019
+ <frontend_type>text</frontend_type>
1020
+ <sort_order>40</sort_order>
1021
+ <show_in_default>1</show_in_default>
1022
+ <show_in_website>1</show_in_website>
1023
+ <show_in_store>1</show_in_store>
1024
+ </channel>
1025
+ <invioce translate="label">
1026
+ <label>Automatically invoiced</label>
1027
+ <frontend_type>select</frontend_type>
1028
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1029
+ <sort_order>70</sort_order>
1030
+ <show_in_default>1</show_in_default>
1031
+ <show_in_website>1</show_in_website>
1032
+ <show_in_store>1</show_in_store>
1033
+ </invioce>
1034
+ <sort_order translate="label">
1035
+ <label>Sort order</label>
1036
+ <frontend_type>text</frontend_type>
1037
+ <sort_order>110</sort_order>
1038
+ <show_in_default>1</show_in_default>
1039
+ <show_in_website>1</show_in_website>
1040
+ <show_in_store>1</show_in_store>
1041
+ </sort_order>
1042
+ <min_amount translate="label">
1043
+ <label>Minimum Amount (CENT)</label>
1044
+ <frontend_type>text</frontend_type>
1045
+ <sort_order>120</sort_order>
1046
+ <show_in_default>1</show_in_default>
1047
+ <show_in_website>1</show_in_website>
1048
+ <show_in_store>1</show_in_store>
1049
+ </min_amount>
1050
+ <max_amount translate="label">
1051
+ <label>Maximum Amount (CENT)</label>
1052
+ <frontend_type>text</frontend_type>
1053
+ <sort_order>130</sort_order>
1054
+ <show_in_default>1</show_in_default>
1055
+ <show_in_website>1</show_in_website>
1056
+ <show_in_store>1</show_in_store>
1057
+ </max_amount>
1058
+ <allowspecific translate="label">
1059
+ <label>allow specific countries</label>
1060
+ <frontend_type>allowspecific</frontend_type>
1061
+ <sort_order>140</sort_order>
1062
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
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
+ </allowspecific>
1067
+ <specificcountry translate="label">
1068
+ <label>specific countries</label>
1069
+ <frontend_type>multiselect</frontend_type>
1070
+ <sort_order>150</sort_order>
1071
+ <source_model>adminhtml/system_config_source_country</source_model>
1072
+ <show_in_default>1</show_in_default>
1073
+ <show_in_website>1</show_in_website>
1074
+ <show_in_store>1</show_in_store>
1075
+ </specificcountry>
1076
+ </fields>
1077
+ </hcdide>
1078
+ <hcdpp translate="label">
1079
+ <label>Heidelpay Prepayment (hcd)</label>
1080
+ <frontend_type>text</frontend_type>
1081
+ <sort_order>100</sort_order>
1082
+ <show_in_default>1</show_in_default>
1083
+ <show_in_website>1</show_in_website>
1084
+ <show_in_store>1</show_in_store>
1085
+ <fields>
1086
+ <title translate="label">
1087
+ <label>Title</label>
1088
+ <frontend_type>text</frontend_type>
1089
+ <sort_order>10</sort_order>
1090
+ <show_in_default>1</show_in_default>
1091
+ <show_in_website>1</show_in_website>
1092
+ <show_in_store>1</show_in_store>
1093
+ </title>
1094
+ <active translate="label">
1095
+ <label>Enabled</label>
1096
+ <frontend_type>select</frontend_type>
1097
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1098
+ <sort_order>20</sort_order>
1099
+ <show_in_default>1</show_in_default>
1100
+ <show_in_website>1</show_in_website>
1101
+ <show_in_store>1</show_in_store>
1102
+ </active>
1103
+ <channel translate="label">
1104
+ <label>Channel ID</label>
1105
+ <frontend_type>text</frontend_type>
1106
+ <sort_order>40</sort_order>
1107
+ <show_in_default>1</show_in_default>
1108
+ <show_in_website>1</show_in_website>
1109
+ <show_in_store>1</show_in_store>
1110
+ </channel>
1111
+ <invioce translate="label">
1112
+ <label>Automatically invoiced</label>
1113
+ <frontend_type>select</frontend_type>
1114
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1115
+ <sort_order>70</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
+ </invioce>
1120
+ <sort_order translate="label">
1121
+ <label>Sort order</label>
1122
+ <frontend_type>text</frontend_type>
1123
+ <sort_order>110</sort_order>
1124
+ <show_in_default>1</show_in_default>
1125
+ <show_in_website>1</show_in_website>
1126
+ <show_in_store>1</show_in_store>
1127
+ </sort_order>
1128
+ <min_amount translate="label">
1129
+ <label>Minimum Amount (CENT)</label>
1130
+ <frontend_type>text</frontend_type>
1131
+ <sort_order>120</sort_order>
1132
+ <show_in_default>1</show_in_default>
1133
+ <show_in_website>1</show_in_website>
1134
+ <show_in_store>1</show_in_store>
1135
+ </min_amount>
1136
+ <max_amount translate="label">
1137
+ <label>Maximum Amount (CENT)</label>
1138
+ <frontend_type>text</frontend_type>
1139
+ <sort_order>130</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
+ </max_amount>
1144
+ <allowspecific translate="label">
1145
+ <label>allow specific countries</label>
1146
+ <frontend_type>allowspecific</frontend_type>
1147
+ <sort_order>140</sort_order>
1148
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1149
+ <show_in_default>1</show_in_default>
1150
+ <show_in_website>1</show_in_website>
1151
+ <show_in_store>1</show_in_store>
1152
+ </allowspecific>
1153
+ <specificcountry translate="label">
1154
+ <label>specific countries</label>
1155
+ <frontend_type>multiselect</frontend_type>
1156
+ <sort_order>150</sort_order>
1157
+ <source_model>adminhtml/system_config_source_country</source_model>
1158
+ <show_in_default>1</show_in_default>
1159
+ <show_in_website>1</show_in_website>
1160
+ <show_in_store>1</show_in_store>
1161
+ </specificcountry>
1162
+ </fields>
1163
+ </hcdpp>
1164
+ <hcdiv translate="label">
1165
+ <label>Heidelpay Invoice (hcd)</label>
1166
+ <frontend_type>text</frontend_type>
1167
+ <sort_order>110</sort_order>
1168
+ <show_in_default>1</show_in_default>
1169
+ <show_in_website>1</show_in_website>
1170
+ <show_in_store>1</show_in_store>
1171
+ <fields>
1172
+ <title translate="label">
1173
+ <label>Title</label>
1174
+ <frontend_type>text</frontend_type>
1175
+ <sort_order>10</sort_order>
1176
+ <show_in_default>1</show_in_default>
1177
+ <show_in_website>1</show_in_website>
1178
+ <show_in_store>1</show_in_store>
1179
+ </title>
1180
+ <active translate="label">
1181
+ <label>Enabled</label>
1182
+ <frontend_type>select</frontend_type>
1183
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1184
+ <sort_order>20</sort_order>
1185
+ <show_in_default>1</show_in_default>
1186
+ <show_in_website>1</show_in_website>
1187
+ <show_in_store>1</show_in_store>
1188
+ </active>
1189
+ <channel translate="label">
1190
+ <label>Channel ID</label>
1191
+ <frontend_type>text</frontend_type>
1192
+ <sort_order>40</sort_order>
1193
+ <show_in_default>1</show_in_default>
1194
+ <show_in_website>1</show_in_website>
1195
+ <show_in_store>1</show_in_store>
1196
+ </channel>
1197
+ <invioce translate="label">
1198
+ <label>Automatically invoiced</label>
1199
+ <frontend_type>select</frontend_type>
1200
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1201
+ <sort_order>70</sort_order>
1202
+ <show_in_default>1</show_in_default>
1203
+ <show_in_website>1</show_in_website>
1204
+ <show_in_store>1</show_in_store>
1205
+ </invioce>
1206
+ <sort_order translate="label">
1207
+ <label>Sort order</label>
1208
+ <frontend_type>text</frontend_type>
1209
+ <sort_order>110</sort_order>
1210
+ <show_in_default>1</show_in_default>
1211
+ <show_in_website>1</show_in_website>
1212
+ <show_in_store>1</show_in_store>
1213
+ </sort_order>
1214
+ <min_amount translate="label">
1215
+ <label>Minimum Amount (CENT)</label>
1216
+ <frontend_type>text</frontend_type>
1217
+ <sort_order>120</sort_order>
1218
+ <show_in_default>1</show_in_default>
1219
+ <show_in_website>1</show_in_website>
1220
+ <show_in_store>1</show_in_store>
1221
+ </min_amount>
1222
+ <max_amount translate="label">
1223
+ <label>Maximum Amount (CENT)</label>
1224
+ <frontend_type>text</frontend_type>
1225
+ <sort_order>130</sort_order>
1226
+ <show_in_default>1</show_in_default>
1227
+ <show_in_website>1</show_in_website>
1228
+ <show_in_store>1</show_in_store>
1229
+ </max_amount>
1230
+ <allowspecific translate="label">
1231
+ <label>allow specific countries</label>
1232
+ <frontend_type>allowspecific</frontend_type>
1233
+ <sort_order>140</sort_order>
1234
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1235
+ <show_in_default>1</show_in_default>
1236
+ <show_in_website>1</show_in_website>
1237
+ <show_in_store>1</show_in_store>
1238
+ </allowspecific>
1239
+ <specificcountry translate="label">
1240
+ <label>specific countries</label>
1241
+ <frontend_type>multiselect</frontend_type>
1242
+ <sort_order>150</sort_order>
1243
+ <source_model>adminhtml/system_config_source_country</source_model>
1244
+ <show_in_default>1</show_in_default>
1245
+ <show_in_website>1</show_in_website>
1246
+ <show_in_store>1</show_in_store>
1247
+ </specificcountry>
1248
+ </fields>
1249
+ </hcdiv>
1250
+ <hcdivsec translate="label">
1251
+ <label>Heidelpay invoice secured(hcd)</label>
1252
+ <frontend_type>text</frontend_type>
1253
+ <sort_order>115</sort_order>
1254
+ <show_in_default>1</show_in_default>
1255
+ <show_in_website>1</show_in_website>
1256
+ <show_in_store>1</show_in_store>
1257
+ <fields>
1258
+ <title translate="label">
1259
+ <label>Title</label>
1260
+ <frontend_type>text</frontend_type>
1261
+ <sort_order>10</sort_order>
1262
+ <show_in_default>1</show_in_default>
1263
+ <show_in_website>1</show_in_website>
1264
+ <show_in_store>1</show_in_store>
1265
+ </title>
1266
+ <active translate="label">
1267
+ <label>Enabled</label>
1268
+ <frontend_type>select</frontend_type>
1269
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1270
+ <sort_order>20</sort_order>
1271
+ <show_in_default>1</show_in_default>
1272
+ <show_in_website>1</show_in_website>
1273
+ <show_in_store>1</show_in_store>
1274
+ </active>
1275
+ <channel translate="label">
1276
+ <label>Channel ID</label>
1277
+ <frontend_type>text</frontend_type>
1278
+ <sort_order>40</sort_order>
1279
+ <show_in_default>1</show_in_default>
1280
+ <show_in_website>1</show_in_website>
1281
+ <show_in_store>1</show_in_store>
1282
+ </channel>
1283
+ <recognition translate="label">
1284
+ <label>Recognition</label>
1285
+ <frontend_type>select</frontend_type>
1286
+ <source_model>hcd/system_config_source_recognition</source_model>
1287
+ <sort_order>60</sort_order>
1288
+ <show_in_default>1</show_in_default>
1289
+ <show_in_website>1</show_in_website>
1290
+ <show_in_store>1</show_in_store>
1291
+ </recognition>
1292
+ <invioce translate="label">
1293
+ <label>Automatically invoiced</label>
1294
+ <frontend_type>select</frontend_type>
1295
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1296
+ <sort_order>70</sort_order>
1297
+ <show_in_default>1</show_in_default>
1298
+ <show_in_website>1</show_in_website>
1299
+ <show_in_store>1</show_in_store>
1300
+ </invioce>
1301
+ <sort_order translate="label">
1302
+ <label>Sort order</label>
1303
+ <frontend_type>text</frontend_type>
1304
+ <sort_order>110</sort_order>
1305
+ <show_in_default>1</show_in_default>
1306
+ <show_in_website>1</show_in_website>
1307
+ <show_in_store>1</show_in_store>
1308
+ </sort_order>
1309
+ <min_amount translate="label">
1310
+ <label>Minimum Amount (CENT)</label>
1311
+ <frontend_type>text</frontend_type>
1312
+ <sort_order>120</sort_order>
1313
+ <show_in_default>1</show_in_default>
1314
+ <show_in_website>1</show_in_website>
1315
+ <show_in_store>1</show_in_store>
1316
+ </min_amount>
1317
+ <max_amount translate="label">
1318
+ <label>Maximum Amount (CENT)</label>
1319
+ <frontend_type>text</frontend_type>
1320
+ <sort_order>130</sort_order>
1321
+ <show_in_default>1</show_in_default>
1322
+ <show_in_website>1</show_in_website>
1323
+ <show_in_store>1</show_in_store>
1324
+ </max_amount>
1325
+ <allowspecific translate="label">
1326
+ <label>allow specific countries</label>
1327
+ <frontend_type>allowspecific</frontend_type>
1328
+ <sort_order>140</sort_order>
1329
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1330
+ <show_in_default>1</show_in_default>
1331
+ <show_in_website>1</show_in_website>
1332
+ <show_in_store>1</show_in_store>
1333
+ </allowspecific>
1334
+ <specificcountry translate="label">
1335
+ <label>specific countries</label>
1336
+ <frontend_type>multiselect</frontend_type>
1337
+ <sort_order>150</sort_order>
1338
+ <source_model>adminhtml/system_config_source_country</source_model>
1339
+ <show_in_default>1</show_in_default>
1340
+ <show_in_website>1</show_in_website>
1341
+ <show_in_store>1</show_in_store>
1342
+ </specificcountry>
1343
+ </fields>
1344
+ </hcdivsec>
1345
+ <hcdpf translate="label">
1346
+ <label>Heidelpay Postfinance (hcd)</label>
1347
+ <frontend_type>text</frontend_type>
1348
+ <sort_order>140</sort_order>
1349
+ <show_in_default>1</show_in_default>
1350
+ <show_in_website>1</show_in_website>
1351
+ <show_in_store>1</show_in_store>
1352
+ <fields>
1353
+ <title translate="label">
1354
+ <label>Title</label>
1355
+ <frontend_type>text</frontend_type>
1356
+ <sort_order>10</sort_order>
1357
+ <show_in_default>1</show_in_default>
1358
+ <show_in_website>1</show_in_website>
1359
+ <show_in_store>1</show_in_store>
1360
+ </title>
1361
+ <active translate="label">
1362
+ <label>Enabled</label>
1363
+ <frontend_type>select</frontend_type>
1364
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1365
+ <sort_order>20</sort_order>
1366
+ <show_in_default>1</show_in_default>
1367
+ <show_in_website>1</show_in_website>
1368
+ <show_in_store>1</show_in_store>
1369
+ </active>
1370
+ <channel translate="label">
1371
+ <label>Channel ID</label>
1372
+ <frontend_type>text</frontend_type>
1373
+ <sort_order>40</sort_order>
1374
+ <show_in_default>1</show_in_default>
1375
+ <show_in_website>1</show_in_website>
1376
+ <show_in_store>1</show_in_store>
1377
+ </channel>
1378
+ <invioce translate="label">
1379
+ <label>Automatically invoiced</label>
1380
+ <frontend_type>select</frontend_type>
1381
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1382
+ <sort_order>70</sort_order>
1383
+ <show_in_default>1</show_in_default>
1384
+ <show_in_website>1</show_in_website>
1385
+ <show_in_store>1</show_in_store>
1386
+ </invioce>
1387
+ <sort_order translate="label">
1388
+ <label>Sort order</label>
1389
+ <frontend_type>text</frontend_type>
1390
+ <sort_order>110</sort_order>
1391
+ <show_in_default>1</show_in_default>
1392
+ <show_in_website>1</show_in_website>
1393
+ <show_in_store>1</show_in_store>
1394
+ </sort_order>
1395
+ <min_amount translate="label">
1396
+ <label>Minimum Amount (CENT)</label>
1397
+ <frontend_type>text</frontend_type>
1398
+ <sort_order>120</sort_order>
1399
+ <show_in_default>1</show_in_default>
1400
+ <show_in_website>1</show_in_website>
1401
+ <show_in_store>1</show_in_store>
1402
+ </min_amount>
1403
+ <max_amount translate="label">
1404
+ <label>Maximum Amount (CENT)</label>
1405
+ <frontend_type>text</frontend_type>
1406
+ <sort_order>130</sort_order>
1407
+ <show_in_default>1</show_in_default>
1408
+ <show_in_website>1</show_in_website>
1409
+ <show_in_store>1</show_in_store>
1410
+ </max_amount>
1411
+ <allowspecific translate="label">
1412
+ <label>allow specific countries</label>
1413
+ <frontend_type>allowspecific</frontend_type>
1414
+ <sort_order>140</sort_order>
1415
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1416
+ <show_in_default>1</show_in_default>
1417
+ <show_in_website>1</show_in_website>
1418
+ <show_in_store>1</show_in_store>
1419
+ </allowspecific>
1420
+ <specificcountry translate="label">
1421
+ <label>specific countries</label>
1422
+ <frontend_type>multiselect</frontend_type>
1423
+ <sort_order>150</sort_order>
1424
+ <source_model>adminhtml/system_config_source_country</source_model>
1425
+ <show_in_default>1</show_in_default>
1426
+ <show_in_website>1</show_in_website>
1427
+ <show_in_store>1</show_in_store>
1428
+ </specificcountry>
1429
+ </fields>
1430
+ </hcdpf>
1431
+ <hcdmpa translate="label">
1432
+ <label>Heidelpay MasterPass (hcd)</label>
1433
+ <frontend_type>text</frontend_type>
1434
+ <sort_order>140</sort_order>
1435
+ <show_in_default>1</show_in_default>
1436
+ <show_in_website>1</show_in_website>
1437
+ <show_in_store>1</show_in_store>
1438
+ <fields>
1439
+ <title translate="label">
1440
+ <label>Title</label>
1441
+ <frontend_type>text</frontend_type>
1442
+ <sort_order>10</sort_order>
1443
+ <show_in_default>1</show_in_default>
1444
+ <show_in_website>1</show_in_website>
1445
+ <show_in_store>1</show_in_store>
1446
+ </title>
1447
+ <active translate="label">
1448
+ <label>Enabled</label>
1449
+ <frontend_type>select</frontend_type>
1450
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1451
+ <sort_order>20</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
+ </active>
1456
+ <channel translate="label">
1457
+ <label>Channel ID</label>
1458
+ <frontend_type>text</frontend_type>
1459
+ <sort_order>40</sort_order>
1460
+ <show_in_default>1</show_in_default>
1461
+ <show_in_website>1</show_in_website>
1462
+ <show_in_store>1</show_in_store>
1463
+ </channel>
1464
+ <bookingmode translate="label">
1465
+ <label>Bookingmode</label>
1466
+ <frontend_type>select</frontend_type>
1467
+ <source_model>hcd/system_config_source_bookingmode</source_model>
1468
+ <sort_order>50</sort_order>
1469
+ <show_in_default>1</show_in_default>
1470
+ <show_in_website>1</show_in_website>
1471
+ <show_in_store>1</show_in_store>
1472
+ </bookingmode>
1473
+ <invioce translate="label">
1474
+ <label>Automatically invoiced</label>
1475
+ <frontend_type>select</frontend_type>
1476
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1477
+ <sort_order>70</sort_order>
1478
+ <show_in_default>1</show_in_default>
1479
+ <show_in_website>1</show_in_website>
1480
+ <show_in_store>1</show_in_store>
1481
+ </invioce>
1482
+ <!--<capture_on_delivery translate="label">
1483
+ <label>Automatically capture on delivery</label>
1484
+ <frontend_type>select</frontend_type>
1485
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1486
+ <comment>please note that capture on delivery is only possible, when you set bookingmode to preauthorisation</comment>
1487
+ <sort_order>80</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
+ </capture_on_delivery>-->
1492
+ <sort_order translate="label">
1493
+ <label>Sort order</label>
1494
+ <frontend_type>text</frontend_type>
1495
+ <sort_order>110</sort_order>
1496
+ <show_in_default>1</show_in_default>
1497
+ <show_in_website>1</show_in_website>
1498
+ <show_in_store>1</show_in_store>
1499
+ </sort_order>
1500
+ <min_amount translate="label">
1501
+ <label>Minimum Amount (CENT)</label>
1502
+ <frontend_type>text</frontend_type>
1503
+ <sort_order>120</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
+ </min_amount>
1508
+ <max_amount translate="label">
1509
+ <label>Maximum Amount (CENT)</label>
1510
+ <frontend_type>text</frontend_type>
1511
+ <sort_order>130</sort_order>
1512
+ <show_in_default>1</show_in_default>
1513
+ <show_in_website>1</show_in_website>
1514
+ <show_in_store>1</show_in_store>
1515
+ </max_amount>
1516
+ <allowspecific translate="label">
1517
+ <label>allow specific countries</label>
1518
+ <frontend_type>allowspecific</frontend_type>
1519
+ <sort_order>140</sort_order>
1520
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1521
+ <show_in_default>1</show_in_default>
1522
+ <show_in_website>1</show_in_website>
1523
+ <show_in_store>1</show_in_store>
1524
+ </allowspecific>
1525
+ <specificcountry translate="label">
1526
+ <label>specific countries</label>
1527
+ <frontend_type>multiselect</frontend_type>
1528
+ <sort_order>150</sort_order>
1529
+ <source_model>adminhtml/system_config_source_country</source_model>
1530
+ <show_in_default>1</show_in_default>
1531
+ <show_in_website>1</show_in_website>
1532
+ <show_in_store>1</show_in_store>
1533
+ </specificcountry>
1534
+ </fields>
1535
+ </hcdmpa>
1536
+ </groups>
1537
+ </payment>
1538
+ </sections>
1539
+ </config>
app/code/community/HeidelpayCD/Edition/Edition/Edition/sql/hcd_setup/install-15.1.30.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * install method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $installer = $this;
17
+ $installer->startSetup();
18
+
19
+ /**
20
+ * create transactions table
21
+ */
22
+ $tablerealname = 'hcd/transaction';
23
+ $tablename = $installer->getTable($tablerealname);
24
+ if ($installer->getConnection()->isTableExists($tablename) != true) {
25
+ $table = $installer->getConnection()
26
+ ->newTable($tablename)
27
+ ->addColumn(
28
+ 'id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
29
+ array(
30
+ 'unsigned' => true,
31
+ 'nullable' => false,
32
+ 'primary' => true,
33
+ 'identity' => true,
34
+ 'auto_increment' => true
35
+ )
36
+ )
37
+ ->addColumn(
38
+ 'payment_methode', Varien_Db_Ddl_Table::TYPE_VARCHAR, 2,
39
+ array(
40
+ 'nullable' => false)
41
+ )
42
+ ->addColumn(
43
+ 'payment_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 2,
44
+ array(
45
+ 'nullable' => false
46
+ )
47
+ )
48
+ ->addColumn(
49
+ 'transactionid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50,
50
+ array(
51
+ 'nullable' => false,
52
+ 'COMMENT' => "normaly the order or basketId"
53
+ )
54
+ )
55
+ ->addColumn(
56
+ 'uniqeid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 32,
57
+ array(
58
+ 'nullable' => false,
59
+ 'COMMENT' => "heidelpay uniqe identification number"
60
+ )
61
+ )
62
+ ->addColumn(
63
+ 'shortid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 14,
64
+ array(
65
+ 'nullable' => false,
66
+ 'COMMENT' => "heidelpay sort identification number"
67
+ )
68
+ )
69
+ ->addColumn(
70
+ 'result', Varien_Db_Ddl_Table::TYPE_VARCHAR, 3,
71
+ array(
72
+ 'nullable' => false,
73
+ 'COMMENT' => "heidelpay processing result"
74
+ )
75
+ )
76
+ ->addColumn(
77
+ 'statuscode', Varien_Db_Ddl_Table::TYPE_SMALLINT, null,
78
+ array(
79
+ 'unsigned' => true,
80
+ 'nullable' => false,
81
+ 'COMMENT' => "heidelpay processing status code"
82
+ )
83
+ )
84
+ ->addColumn(
85
+ 'return', Varien_Db_Ddl_Table::TYPE_VARCHAR, 100,
86
+ array(
87
+ 'nullable' => false,
88
+ 'COMMENT' => "heidelpay processing return message"
89
+ )
90
+ )
91
+ ->addColumn(
92
+ 'returncode', Varien_Db_Ddl_Table::TYPE_VARCHAR, 12,
93
+ array(
94
+ 'nullable' => false,
95
+ 'COMMENT' => "heidelpay processing return code"
96
+ )
97
+ )
98
+ ->addColumn(
99
+ 'jsonresponse', Varien_Db_Ddl_Table::TYPE_BLOB, null,
100
+ array(
101
+ 'nullable' => false,
102
+ 'COMMENT' => "heidelpay response as json"
103
+ )
104
+ )
105
+ ->addColumn(
106
+ 'datetime', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null,
107
+ array(
108
+ 'nullable' => false,
109
+ 'COMMENT' => "create date"
110
+ )
111
+ )
112
+ ->addColumn(
113
+ 'source', Varien_Db_Ddl_Table::TYPE_VARCHAR, 100,
114
+ array(
115
+ 'nullable' => false,
116
+ 'COMMENT' => "heidelpay processing return message"
117
+ )
118
+ )
119
+ ->addIndex($installer->getIdxName($tablerealname, array('uniqeid')), array('uniqeid'))
120
+ ->addIndex($installer->getIdxName($tablerealname, array('transactionid')), array('transactionid'))
121
+ ->addIndex($installer->getIdxName($tablerealname, array('returncode')), array('returncode'))
122
+ ->addIndex($installer->getIdxName($tablerealname, array('source')), array('source'));
123
+ $installer->getConnection()->createTable($table);
124
+ }
125
+
126
+ /**
127
+ * create customer data table
128
+ */
129
+ $tablerealname = 'hcd/customer';
130
+ $tablename = $installer->getTable($tablerealname);
131
+ if ($installer->getConnection()->isTableExists($tablename) != true) {
132
+ $table = $installer->getConnection()
133
+ ->newTable($tablename)
134
+ ->addColumn(
135
+ 'id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
136
+ array(
137
+ 'unsigned' => true,
138
+ 'nullable' => false,
139
+ 'primary' => true,
140
+ 'identity' => true,
141
+ 'auto_increment' => true
142
+ )
143
+ )
144
+ ->addColumn(
145
+ 'paymentmethode', Varien_Db_Ddl_Table::TYPE_VARCHAR, 10,
146
+ array(
147
+ 'nullable' => false)
148
+ )
149
+ ->addColumn(
150
+ 'uniqeid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50,
151
+ array(
152
+ 'nullable' => false,
153
+ 'COMMENT' => "Heidelpay transaction identifier"
154
+ )
155
+ )
156
+ ->addColumn(
157
+ 'customerid', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
158
+ array(
159
+ 'unsigned' => true,
160
+ 'nullable' => false,
161
+ 'COMMENT' => "magento customer id"
162
+ )
163
+ )
164
+ ->addColumn(
165
+ 'storeid', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
166
+ array(
167
+ 'unsigned' => true,
168
+ 'nullable' => false,
169
+ 'COMMENT' => "magento store id"
170
+ )
171
+ )
172
+ ->addColumn(
173
+ 'payment_data', Varien_Db_Ddl_Table::TYPE_BLOB, null,
174
+ array(
175
+ 'nullable' => false,
176
+ 'COMMENT' => "custumer payment data"
177
+ )
178
+ )
179
+ ->addIndex($installer->getIdxName($tablerealname, array('uniqeid')), array('uniqeid'))
180
+ ->addIndex($installer->getIdxName($tablerealname, array('customerid')), array('customerid'))
181
+ ->addIndex($installer->getIdxName($tablerealname, array('storeid')), array('storeid'))
182
+ ->addIndex($installer->getIdxName($tablerealname, array('paymentmethode')), array('paymentmethode'));
183
+ $installer->getConnection()->createTable($table);
184
+ }
185
+
186
+
187
+
188
+ $installer->endSetup();
app/code/community/HeidelpayCD/Edition/Edition/Helper/AbstractHelper.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Heidelpay abstract helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_AbstractHelper extends Mage_Core_Helper_Abstract
19
+ {
20
+ /**
21
+ * abstract log function because of backtrace
22
+ *
23
+ * @param mixed $message
24
+ * @param mixed $level
25
+ * @param mixed $file
26
+ */
27
+ public function log($message, $level = "DEBUG", $file = false)
28
+ {
29
+ $callers = debug_backtrace();
30
+ return $this->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
31
+ }
32
+
33
+ /**
34
+ * real log function which will be called from all controllers and models
35
+ *
36
+ * @param mixed $message
37
+ * @param mixed $level
38
+ * @param mixed $file
39
+ */
40
+ public function realLog($message, $level = "DEBUG", $file = false)
41
+ {
42
+ $storeId = Mage::app()->getStore()->getId();
43
+ $path = "hcd/settings/";
44
+
45
+
46
+ switch ($level) {
47
+ case "CRIT":
48
+ $lev = Zend_Log::CRIT;
49
+ break;
50
+ case "ERR":
51
+ case "ERROR":
52
+ $lev = Zend_Log::ERR;
53
+ break;
54
+ case "WARN":
55
+ $lev = Zend_Log::WARN;
56
+ break;
57
+ case "NOTICE":
58
+ $lev = Zend_Log::NOTICE;
59
+ break;
60
+ case "INFO":
61
+ $lev = Zend_Log::INFO;
62
+ break;
63
+ default:
64
+ $lev = Zend_Log::DEBUG;
65
+ if (Mage::getStoreConfig($path . "log", $storeId) == 0) {
66
+ return true;
67
+ }
68
+ break;
69
+ }
70
+
71
+ $file = ($file === false) ? "Heidelpay.log" : $file;
72
+
73
+ Mage::log($message, $lev, $file);
74
+ return true;
75
+ }
76
+
77
+ /**
78
+ * function to split paymentCode into code and method
79
+ *
80
+ * @param $paymentCode string payment code from response
81
+ *
82
+ * @return array payment code and method as an array
83
+ */
84
+ public function splitPaymentCode($paymentCode)
85
+ {
86
+ return preg_split('/\./', $paymentCode);
87
+ }
88
+
89
+ /**
90
+ * function to format amount
91
+ *
92
+ * @param mixed $number
93
+ */
94
+ public function format($number)
95
+ {
96
+ return number_format($number, 2, '.', '');
97
+ }
98
+ }
app/code/community/HeidelpayCD/Edition/Edition/Helper/BasketApi.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Payment Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_BasketApi extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * collect items for basket api
22
+ *
23
+ * @param $quote Mage_Sales_Model_Order quote object
24
+ * @param $storeId integer current store id
25
+ * @param $includingShipment boolean include
26
+ *
27
+ * @return array return basket api array
28
+ */
29
+ public function basketItems($quote, $storeId, $includingShipment = false)
30
+ {
31
+ $shoppingCartItems = $quote->getAllVisibleItems();
32
+
33
+ $shoppingCart = array(
34
+
35
+ 'authentication' => array(
36
+
37
+ 'login' => trim(Mage::getStoreConfig('hcd/settings/user_id', $storeId)),
38
+ 'sender' => trim(Mage::getStoreConfig('hcd/settings/security_sender', $storeId)),
39
+ 'password' => trim(Mage::getStoreConfig('hcd/settings/user_pwd', $storeId)),
40
+
41
+ ),
42
+
43
+
44
+ 'basket' => array(
45
+ 'amountTotalNet' => floor(bcmul($quote->getGrandTotal(), 100, 10)),
46
+ 'currencyCode' => $quote->getGlobalCurrencyCode(),
47
+ 'amountTotalDiscount' => floor(bcmul($quote->getDiscountAmount(), 100, 10)),
48
+ 'itemCount' => count($shoppingCartItems)
49
+ )
50
+
51
+
52
+ );
53
+
54
+ $count = 1;
55
+ /** @var $item Mage_Sales_Model_Order_Item */
56
+ foreach ($shoppingCartItems as $item) {
57
+ $shoppingCart['basket']['basketItems'][] = array(
58
+ 'position' => $count,
59
+ 'basketItemReferenceId' => $item->getItemId(),
60
+ 'quantity' => ($item->getQtyOrdered() !== false) ? floor($item->getQtyOrdered()) : $item->getQty(),
61
+ 'vat' => floor($item->getTaxPercent()),
62
+ 'amountVat' => floor(bcmul($item->getTaxAmount(), 100, 10)),
63
+ 'amountGross' => floor(bcmul($item->getRowTotalInclTax(), 100, 10)),
64
+ 'amountNet' => floor(bcmul($item->getRowTotal(), 100, 10)),
65
+ 'amountPerUnit' => floor(bcmul($item->getPrice(), 100, 10)),
66
+ 'amountDiscount' => floor(bcmul($item->getDiscountAmount(), 100, 10)),
67
+ 'type' => 'goods',
68
+ 'title' => $item->getName(),
69
+ 'imageUrl' => (string)Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail')
70
+ );
71
+ $count++;
72
+ }
73
+
74
+ if ($includingShipment and $this->getShippingNetPrice($quote) > 0) {
75
+ // Shipping amount including tax
76
+ $shippingAmountInclTax = floor(
77
+ bcmul(
78
+ (($quote->getShippingAmount() - $quote->getShippingRefunded())
79
+ * (1 + $this->getShippingTaxPercent($quote) / 100)),
80
+ 100, 10
81
+ )
82
+ );
83
+
84
+ $shoppingCart['basket']['basketItems'][] = array(
85
+ 'position' => $count,
86
+ 'basketItemReferenceId' => $count,
87
+ "type" => "shipment",
88
+ "title" => "Shipping",
89
+ 'quantity' => 1,
90
+ 'vat' => $this->getShippingTaxPercent($quote),
91
+ 'amountVat' => floor(
92
+ bcmul(
93
+ ($shippingAmountInclTax - $this->getShippingTaxPercent($quote)),
94
+ 100, 10
95
+ )
96
+ ),
97
+ 'amountGross' => $shippingAmountInclTax,
98
+ 'amountNet' => $this->getShippingNetPrice($quote) ,
99
+ 'amountPerUnit' => $shippingAmountInclTax,
100
+ 'amountDiscount' => ''
101
+ );
102
+ }
103
+
104
+
105
+ return $shoppingCart;
106
+ }
107
+
108
+ /**
109
+ * Calculate shipping net price
110
+ *
111
+ * @param $order Mage_Sales_Model_Order magento order object
112
+ *
113
+ * @return string shipping net price
114
+ */
115
+ public function getShippingNetPrice($order)
116
+ {
117
+ $shippingTax = $order->getShippingTaxAmount();
118
+ $price = $order->getShippingInclTax() - $shippingTax;
119
+ $price -= $order->getShippingRefunded();
120
+ $price -= $order->getShippingCanceled();
121
+ return $price;
122
+ }
123
+
124
+ /**
125
+ * Calculate shipping tax in percent for BillSafe
126
+ *
127
+ * @param $order Mage_Sales_Model_Order magentp order object
128
+ *
129
+ * @return string shipping tex in percent
130
+ */
131
+ public function getShippingTaxPercent($order)
132
+ {
133
+ $tax = ($order->getShippingTaxAmount() * 100) / $order->getShippingAmount();
134
+ return $this->format(round($tax));
135
+ }
136
+ }
app/code/community/HeidelpayCD/Edition/Edition/Helper/Data.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Helper data
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Helper_Data extends Mage_Core_Helper_Data
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Helper/OrderState.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Order state Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_OrderState extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * @param $data HeidelpayCD_Edition_Model_Transaction
22
+ * @param $order Mage_Sales_Model_Order
23
+ * @param string $message order history message
24
+ */
25
+ public function mapStatus($data, $order, $message = '')
26
+ {
27
+ $this->log('mapStatus' . json_encode($data));
28
+ $paymentCode = $this->splitPaymentCode($data['PAYMENT_CODE']);
29
+
30
+ $message = ($message === '') ? $data['PROCESSING_RETURN'] : $message;
31
+
32
+
33
+ // Set language for mail template etc
34
+ if (strtoupper($data['CRITERION_LANGUAGE']) == 'DE') {
35
+ $locale = 'de_DE';
36
+ Mage::app()->getLocale()->setLocaleCode($locale);
37
+ Mage::getSingleton('core/translate')->setLocale($locale)->init('frontend', true);
38
+ }
39
+
40
+
41
+ // handle charge back notifications for cc, dc and dd
42
+ if ($paymentCode[1] == 'CB') {
43
+ $this->log('charge back for order ' . $order->getIncrementId());
44
+
45
+ $order->getPayment()->getMethodInstance()->chargeBackTransaction($order);
46
+
47
+ Mage::dispatchEvent('heidelpay_after_map_status_chargeBack', array('order' => $order));
48
+ $this->log('Is this order protected ? ' . (string)$order->isStateProtected());
49
+ $order->save();
50
+ return;
51
+ }
52
+
53
+ // Do nothing if status is already successful
54
+ if ($order->getStatus() == $order->getPayment()->getMethodInstance()->getStatusSuccess()) {
55
+ return;
56
+ }
57
+
58
+ // If the order is canceled, closed or complete do not change order status
59
+ if ($order->getStatus() == Mage_Sales_Model_Order::STATE_CANCELED or
60
+ $order->getStatus() == Mage_Sales_Model_Order::STATE_CLOSED or
61
+ $order->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE
62
+ ) {
63
+ // you can use this event for example to get a notification when a canceled order has been paid
64
+ $this->log('Order '.$order->getRealOrderId().' is canceled, closed or complete.');
65
+ Mage::dispatchEvent('heidelpay_map_status_cancel', array('order' => $order, 'data' => $data));
66
+ return;
67
+ }
68
+
69
+ // Set status for transaction that are not ok
70
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
71
+ $order->getPayment()->getMethodInstance()->canceledTransaction($order, $message);
72
+ Mage::dispatchEvent('heidelpay_after_map_status_canceled', array('order' => $order));
73
+ $order->save();
74
+
75
+ return;
76
+ }
77
+
78
+ // Set status for transaction with payment transaction
79
+ $paidTransactionTypes = array('CP', 'DB', 'RC', 'FI');
80
+
81
+ if (in_array($paymentCode[1], $paidTransactionTypes)) {
82
+ // only Billsafe finalize will have impacted on the order status
83
+ if ($paymentCode[1] === 'FI' and $data['ACCOUNT_BRAND'] !== 'BILLSAFE') {
84
+ return;
85
+ }
86
+
87
+ $order->getPayment()->getMethodInstance()->processingTransaction($order, $data, $message);
88
+
89
+ Mage::dispatchEvent('heidelpay_after_map_status_processed', array('order' => $order));
90
+ $order->save();
91
+ return;
92
+ }
93
+
94
+ //
95
+ if ($order->getStatus() != $order->getPayment()->getMethodInstance()->getStatusSuccess() and
96
+ $order->getStatus() != $order->getPayment()->getMethodInstance()->getStatusError()
97
+ ) {
98
+ $order->getPayment()->getMethodInstance()->pendingTransaction($order, $data, $message);
99
+ }
100
+
101
+
102
+ Mage::dispatchEvent('heidelpay_after_map_status', array('order' => $order));
103
+ $order->save();
104
+ }
105
+ }
app/code/community/HeidelpayCD/Edition/Edition/Helper/Payment.php ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Payment Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_Payment extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * send request to heidelpay apo
22
+ *
23
+ * @param $url string url for the heidelpay api
24
+ * @param array $params post parameter
25
+ *
26
+ * @return mixed|null|Zend_Http_Response response from heidelpay api
27
+ */
28
+ public function doRequest($url, $params = array())
29
+ {
30
+ $client = new Zend_Http_Client(trim($url), array());
31
+
32
+ if (array_key_exists('raw', $params)) {
33
+ $client->setRawData(json_encode($params['raw']), 'application/json');
34
+ } else {
35
+ $client->setParameterPost($params);
36
+ }
37
+
38
+ if (extension_loaded('curl')) {
39
+ $adapter = new Zend_Http_Client_Adapter_Curl();
40
+ $adapter->setCurlOption(CURLOPT_SSL_VERIFYPEER, true);
41
+ $adapter->setCurlOption(CURLOPT_SSL_VERIFYHOST, 2);
42
+ $adapter->setCurlOption(CURLOPT_SSLVERSION, 6);
43
+ $client->setAdapter($adapter);
44
+ }
45
+
46
+ $response = $client->request('POST');
47
+ $res = $response->getBody();
48
+
49
+
50
+ if ($response->isError()) {
51
+ $this->log("Request fail. Http code : " . $response->getStatus() . ' Message : ' . $res, 'ERROR');
52
+ $this->log("Request data : " . json_encode($params), 'ERROR');
53
+ if (array_key_exists('raw', $params)) {
54
+ return $response;
55
+ }
56
+ }
57
+
58
+ if (array_key_exists('raw', $params)) {
59
+ return json_decode($res, true);
60
+ }
61
+
62
+ $result = null;
63
+ // @codingStandardsIgnoreLine parse_str is discouraged
64
+ parse_str($res, $result);
65
+ ksort($result);
66
+ return $result;
67
+ }
68
+
69
+ // @codingStandardsIgnoreLine more than 120 characters
70
+ public function preparePostData($config = array(), $front = array(), $customer = array(), $basket = array(), $criterion = array())
71
+ {
72
+ $params = array();
73
+ /*
74
+ * configuration part of this function
75
+ */
76
+ $params['SECURITY.SENDER'] = $config['SECURITY.SENDER'];
77
+ $params['USER.LOGIN'] = $config['USER.LOGIN'];
78
+ $params['USER.PWD'] = $config['USER.PWD'];
79
+
80
+ switch ($config['TRANSACTION.MODE']) {
81
+ case 'INTEGRATOR_TEST':
82
+ $params['TRANSACTION.MODE'] = 'INTEGRATOR_TEST';
83
+ break;
84
+ case 'CONNECTOR_TEST':
85
+ $params['TRANSACTION.MODE'] = 'CONNECTOR_TEST';
86
+ break;
87
+ default:
88
+ $params['TRANSACTION.MODE'] = 'LIVE';
89
+ }
90
+
91
+ $params['TRANSACTION.CHANNEL'] = $config['TRANSACTION.CHANNEL'];
92
+
93
+
94
+ $params = array_merge($params, $this->_setPaymentMethod($config, $customer));
95
+
96
+
97
+ /* debit on registration */
98
+ if (array_key_exists('ACCOUNT.REGISTRATION', $config)) {
99
+ $params['ACCOUNT.REGISTRATION'] = $config['ACCOUNT.REGISTRATION'];
100
+ $params['FRONTEND.ENABLED'] = "false";
101
+ }
102
+
103
+ if (array_key_exists('SHOP.TYPE', $config)) {
104
+ $params['SHOP.TYPE'] = $config['SHOP.TYPE'];
105
+ }
106
+
107
+ if (array_key_exists('SHOPMODUL.VERSION', $config)) {
108
+ $params['SHOPMODUL.VERSION'] = $config['SHOPMODUL.VERSION'];
109
+ }
110
+
111
+ /* frontend configuration */
112
+
113
+ /* override FRONTEND.ENABLED if necessary */
114
+ if (array_key_exists('FRONTEND.ENABLED', $front)) {
115
+ $params['FRONTEND.ENABLED'] = $front['FRONTEND.ENABLED'];
116
+ unset($front['FRONTEND.ENABLED']);
117
+ }
118
+
119
+ if (array_key_exists('FRONTEND.MODE', $front)) {
120
+ $params['FRONTEND.MODE'] = $front['FRONTEND.MODE'];
121
+ unset($front['FRONTEND.MODE']);
122
+ } else {
123
+ $params['FRONTEND.MODE'] = "WHITELABEL";
124
+ $params['TRANSACTION.RESPONSE'] = "SYNC";
125
+ $params['FRONTEND.ENABLED'] = 'true';
126
+ }
127
+
128
+
129
+ $params = array_merge($params, $front);
130
+
131
+ /* costumer data configuration */
132
+ $params = array_merge($params, $customer);
133
+
134
+ /* basket data configuration */
135
+ $params = array_merge($params, $basket);
136
+
137
+ /* criterion data configuration */
138
+ $params = array_merge($params, $criterion);
139
+
140
+ $params['REQUEST.VERSION'] = "1.0";
141
+
142
+ // sort the parameter
143
+ ksort($params);
144
+
145
+ return $params;
146
+ }
147
+
148
+ // @codingStandardsIgnoreLine should be refactored - issue #3
149
+ protected function _setPaymentMethod($config = array(), $customer = array())
150
+ {
151
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'PA' : $config['PAYMENT.TYPE'];
152
+ /* Set payment method */
153
+ switch ($config['PAYMENT.METHOD']) {
154
+ /* sofort */
155
+ case 'su':
156
+ $params['ACCOUNT.BRAND'] = "SOFORT";
157
+ $params['PAYMENT.CODE'] = "OT." . $type;
158
+ break;
159
+ /* griopay */
160
+ case 'gp':
161
+ $params['ACCOUNT.BRAND'] = "GIROPAY";
162
+ $params['PAYMENT.CODE'] = "OT." . $type;
163
+ break;
164
+ /* ideal */
165
+ case 'ide':
166
+ $params['ACCOUNT.BRAND'] = "IDEAL";
167
+ $params['PAYMENT.CODE'] = "OT." . $type;
168
+ break;
169
+ /* eps */
170
+ case 'eps':
171
+ $params['ACCOUNT.BRAND'] = "EPS";
172
+ $params['PAYMENT.CODE'] = "OT." . $type;
173
+ break;
174
+ /* postfinance */
175
+ case 'pf':
176
+ $params['PAYMENT.CODE'] = "OT." . $type;
177
+ break;
178
+ /* paypal */
179
+ case 'pal':
180
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'DB' : $config['PAYMENT.TYPE'];
181
+ $params['PAYMENT.CODE'] = "VA." . $type;
182
+ $params['ACCOUNT.BRAND'] = "PAYPAL";
183
+ break;
184
+ /* prepayment */
185
+ case 'pp':
186
+ $params['PAYMENT.CODE'] = "PP." . $type;
187
+ break;
188
+ /* invoce */
189
+ case 'iv':
190
+ $params['PAYMENT.CODE'] = "IV." . $type;
191
+ break;
192
+ /* invoice secured */
193
+ case 'ivsec':
194
+ $params['PAYMENT.CODE'] = "IV." . $type;
195
+ break;
196
+ /* direct debit secured */
197
+ case 'ddsec':
198
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'DB' : $config['PAYMENT.TYPE'];
199
+ $params['PAYMENT.CODE'] = "DD." . $type;
200
+ break;
201
+ /* BillSafe */
202
+ case 'bs':
203
+ $params['PAYMENT.CODE'] = "IV." . $type;
204
+ $params['ACCOUNT.BRAND'] = "BILLSAFE";
205
+ $params['FRONTEND.ENABLED'] = "false";
206
+ break;
207
+ /* MasterPass */
208
+ case 'mpa':
209
+ $type = (!array_key_exists('PAYMENT.TYPE', $config)) ? 'DB' : $config['PAYMENT.TYPE'];
210
+
211
+ // masterpass as a payment method
212
+ if (!array_key_exists('IDENTIFICATION.REFERENCEID', $customer) and ($type == 'DB' or $type == 'PA')) {
213
+ $params['WALLET.DIRECT_PAYMENT'] = "true";
214
+ $params['WALLET.DIRECT_PAYMENT_CODE'] = "WT." . $type;
215
+ $type = 'IN';
216
+ }
217
+
218
+ $params['PAYMENT.CODE'] = "WT." . $type;
219
+ $params['ACCOUNT.BRAND'] = "MASTERPASS";
220
+ break;
221
+ default:
222
+ $params['PAYMENT.CODE'] = strtoupper($config['PAYMENT.METHOD']) . '.' . $type;
223
+ break;
224
+ }
225
+
226
+ return $params;
227
+ }
228
+
229
+ /**
230
+ * get language code
231
+ *
232
+ * @param string $default default language code
233
+ *
234
+ * @return string return current lang code
235
+ */
236
+ public function getLang($default = 'en')
237
+ {
238
+ $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());
239
+ if (!empty($locale)) {
240
+ return strtoupper($locale[0]);
241
+ }
242
+
243
+ return strtoupper($default);
244
+ }
245
+
246
+ /**
247
+ * helper to generate customer payment error messages
248
+ *
249
+ * @param mixed $errorMsg
250
+ * @param null|mixed $errorCode
251
+ * @param null|mixed $orderNumber
252
+ */
253
+ public function handleError($errorMsg, $errorCode = null, $orderNumber = null)
254
+ {
255
+ // default is return generic error message
256
+ if ($orderNumber != null) {
257
+ $this->log('Ordernumber ' . $orderNumber . ' -> ' . $errorMsg . ' [' . $errorCode . ']', 'NOTICE');
258
+ }
259
+
260
+ if ($errorCode) {
261
+ if (!preg_match(
262
+ '/HPError-[0-9]{3}\.[0-9]{3}\.[0-9]{3}/', $this->_getHelper()->__('HPError-' . $errorCode),
263
+ $matches
264
+ )
265
+ ) { //JUST return when snipet exists
266
+ return $this->_getHelper()->__('HPError-' . $errorCode);
267
+ }
268
+ }
269
+
270
+ return $this->_getHelper()->__('An unexpected error occurred. Please contact us to get further information.');
271
+ }
272
+
273
+ /**
274
+ * get helper instance
275
+ *
276
+ * @return Mage_Core_Helper_Abstract
277
+ */
278
+ protected function _getHelper()
279
+ {
280
+ return Mage::helper('hcd');
281
+ }
282
+
283
+ /**
284
+ * Get region code
285
+ *
286
+ * @param $countryCode string country code
287
+ * @param $stateByName string state name
288
+ *
289
+ * @return mixed regionId
290
+ */
291
+ public function getRegion($countryCode, $stateByName)
292
+ {
293
+ $regionData = Mage::getModel('directory/region')->getResourceCollection()
294
+ ->addCountryFilter($countryCode)
295
+ ->load();
296
+
297
+
298
+ $regionId = null;
299
+
300
+ foreach ($regionData as $region) {
301
+ if (strtolower($stateByName) == strtolower($region['name']) or $stateByName == $region['code']) {
302
+ return $region['region_id'];
303
+ }
304
+ }
305
+
306
+ // Return last region if mapping fails
307
+ return $region['region_id'];
308
+ }
309
+ }
app/code/community/HeidelpayCD/Edition/Edition/Helper/Validator.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Validator Helper
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Helper_Validator extends HeidelpayCD_Edition_Helper_AbstractHelper
19
+ {
20
+ /**
21
+ * Validates the age of the customer
22
+ *
23
+ * It will return true if the costumer is older then 18 years
24
+ *
25
+ * @param $day integer day of the customers birth
26
+ * @param $mount integer month of the customers birth
27
+ * @param $year integer year of the customers birth
28
+ * @param mixed $month
29
+ *
30
+ * @return bool return true if the costumer is older then 18 years
31
+ */
32
+ public function validateDateOfBirth($day, $month, $year)
33
+ {
34
+ // @codingStandardsIgnoreLine should be refactored - issue #2
35
+ if (strtotime("$year/$month/$day") < (time() - (18 * 60 * 60 * 24 * 365))) {
36
+ return true;
37
+ }
38
+
39
+ return false;
40
+ }
41
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Customer.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer Model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Customer extends Mage_Core_Model_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/customer');
22
+ parent::_construct();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Customer.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer mysql driver
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Customer extends Mage_Core_Model_Mysql4_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/customer', 'id');
22
+ }
23
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Customer/Collection.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer collection
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Customer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/customer');
22
+ parent::_construct();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Transaction.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Transaction mysql driver
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Transaction extends Mage_Core_Model_Mysql4_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/transaction', 'id');
22
+ }
23
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Mysql4/Transaction/Collection.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Transaction collection
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Mysql4_Transaction_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/transaction');
22
+ parent::_construct();
23
+ }
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Observer.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * heidelpay observer model
4
+ *
5
+ * @license Use of this software requires acceptance of the License Agreement.
6
+ * @copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Observer
18
+ {
19
+ public $invoiceOrderEmail = true;
20
+
21
+ /**
22
+ * Unset session variable hcdWallet if the customers return to backet
23
+ *
24
+ * @param $observer
25
+ */
26
+ public function removeWalletDataFromCheckout()
27
+ {
28
+ // unset wallet data from session
29
+ if ($session = Mage::getSingleton('checkout/session')) {
30
+ $session->unsHcdWallet();
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Unset session variable hcdWallet if the customers return to backet
36
+ *
37
+ * @param $observer
38
+ */
39
+ public function handleWalletDataDuringCheckout($observer)
40
+ {
41
+ $controller = $observer->getControllerAction();
42
+
43
+ $controllerName = $controller->getRequest()->getControllerName();
44
+
45
+ $actionName = $controller->getRequest()->getActionName();
46
+
47
+ if (($controllerName == "cart" and $actionName == "index")
48
+ or ($controllerName == "onepage" and $actionName == "index")
49
+ ) {
50
+
51
+ /**
52
+ * remove wallet information from session (currently only masterpass)
53
+ */
54
+ if ($session = Mage::getSingleton('checkout/session')) {
55
+ $session->unsHcdWallet();
56
+ }
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Observer on save shipment to report the shipment to heidelpay
62
+ *
63
+ * @param $observer
64
+ */
65
+ public function reportShippingToHeidelpay($observer)
66
+ {
67
+ $shipment = $observer->getEvent()->getShipment();
68
+ $order = $shipment->getOrder();
69
+ if (empty($order)) {
70
+ return $this;
71
+ }
72
+
73
+ $payment = $order->getPayment()->getMethodInstance();
74
+
75
+ $paymentCode = $payment->getCode();
76
+
77
+
78
+ $paymentMethod = array('hcdivsec', 'hcdbs');
79
+
80
+
81
+ // return $this when reporting shipment is not needed
82
+ if (!in_array($paymentCode, $paymentMethod)) {
83
+ return $this;
84
+ }
85
+
86
+ /** @var $transactionModel HeidelpayCD_Edition_Model_Transaction */
87
+ $transactionModel = Mage::getModel('hcd/transaction');
88
+ /** @var $sessionModel Mage_Core_Model_Session */
89
+ $sessionModel = Mage::getSingleton('core/session');
90
+ /** @var $heidelpayHelper HeidelpayCD_Edition_Helper_Data */
91
+ $heidelpayHelper = Mage::helper('hcd');
92
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
93
+ $paymentHelper = Mage::helper('hcd/payment');
94
+
95
+ // load authorisation form database
96
+ $authorisation = $transactionModel->getOneTransactionByMethode($order->getRealOrderId(), 'PA');
97
+ // no authorisation found
98
+ if ($authorisation === false) {
99
+ $sessionModel->addError(
100
+ $heidelpayHelper->__(
101
+ 'Delivery notes to Heidelpay fail, because of no initial authorisation'
102
+ )
103
+ );
104
+ return $this;
105
+ }
106
+
107
+ // set config parameter for request
108
+ $config = $payment->getMainConfig($paymentCode, $order->getStoreId());
109
+ $config['PAYMENT.TYPE'] = 'FI';
110
+
111
+ // set frontend parameter for request
112
+ $frontend = $payment->getFrontend($order->getRealOrderId(), $authorisation['CRITERION_STOREID']);
113
+ $frontend['FRONTEND.MODE'] = 'DEFAULT';
114
+ $frontend['FRONTEND.ENABLED'] = 'false';
115
+
116
+ // set user parameter for request
117
+ $user = $payment->getUser($order, true);
118
+
119
+ $basketData = $payment->getBasketData($order);
120
+ $basketData['IDENTIFICATION.REFERENCEID'] = $authorisation['IDENTIFICATION_UNIQUEID'];#
121
+
122
+ $criterion = array();
123
+
124
+ Mage::dispatchEvent(
125
+ 'heidelpay_reportShippingToHeidelpay_bevor_preparePostData',
126
+ array(
127
+ 'payment' => $payment,
128
+ 'config' => $config,
129
+ 'frontend' => $frontend,
130
+ 'user' => $user,
131
+ 'basketData' => $basketData,
132
+ 'criterion' => $criterion
133
+ )
134
+ );
135
+
136
+ // prepare shipment report
137
+ $params = $paymentHelper->preparePostData($config, $frontend, $user, $basketData, $criterion);
138
+
139
+ $this->log("doRequest url : " . $config['URL']);
140
+ $this->log("doRequest params : " . json_encode($params));
141
+ // send shipment report to heidelpay api
142
+ $src = $paymentHelper->doRequest($config['URL'], $params);
143
+
144
+ $this->log("doRequest response : " . json_encode($src));
145
+
146
+ // generate error message in case of api error
147
+ if ($src['PROCESSING_RESULT'] == "NOK") {
148
+ $sessionModel
149
+ ->addError(
150
+ $heidelpayHelper
151
+ ->__(
152
+ 'Delivery notes to Heidelpay fail, because of :
153
+ '
154
+ )
155
+ . $src['PROCESSING_RETURN']
156
+ );
157
+ $shipment->_dataSaveAllowed = false;
158
+ Mage::app()->getResponse()
159
+ // @codingStandardsIgnoreLine use of S_SERVER is discouraged
160
+ ->setRedirect($_SERVER['HTTP_REFERER'])
161
+ ->sendResponse();
162
+ return;
163
+ }
164
+
165
+ $message = $heidelpayHelper->__('report shipment to heidelpay successful. Waiting for receipt of money');
166
+ $order->setState(
167
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
168
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
169
+ $message
170
+ )->save();
171
+
172
+
173
+ // successful send shipment report to heidelpay
174
+ $sessionModel
175
+ ->addSuccess(
176
+ $heidelpayHelper
177
+ ->__('Successfully report delivery to Heidelpay.')
178
+ );
179
+ }
180
+
181
+ /**
182
+ * log function
183
+ *
184
+ * @param $message string log message
185
+ * @param $level string log level
186
+ * @param $file string log file
187
+ *
188
+ * @return mixed
189
+ */
190
+ protected function log($message, $level = "DEBUG", $file = false)
191
+ {
192
+ $callers = debug_backtrace();
193
+ return Mage::helper('hcd/payment')
194
+ ->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
195
+ }
196
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Order/Pdf/Invoice.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Order pdf invoice
4
+ *
5
+ * this is now handled by pdf templates
6
+ *
7
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
8
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
9
+ *
10
+ * @link https://dev.heidelpay.de/magento
11
+ *
12
+ * @author Jens Richter
13
+ *
14
+ * @package Heidelpay
15
+ * @subpackage Magento
16
+ * @category Magento
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Invoice
20
+ {
21
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Abstract.php ADDED
@@ -0,0 +1,1138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Abstract payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Method_Abstract
19
+ {
20
+ /**
21
+ * @var string payment code of the method
22
+ */
23
+ protected $_code = 'abstract';
24
+ /**
25
+ * @var Mage_Sales_Model_Order magento order object
26
+ */
27
+ protected $_order;
28
+ /**
29
+ * @var bool weather this payment method is a gateway method
30
+ */
31
+ protected $_isGateway = true;
32
+ /**
33
+ * @var bool this payment method allows authorisation
34
+ */
35
+ protected $_canAuthorize = false;
36
+ /**
37
+ * @var bool this payment method is able to capture
38
+ */
39
+ protected $_canCapture = false;
40
+ /**
41
+ * @var bool this payment method is capable of partly capture
42
+ */
43
+ protected $_canCapturePartial = false;
44
+ /**
45
+ * @var bool the chard amount can be reverted to the given account
46
+ */
47
+ protected $_canRefund = true;
48
+ /**
49
+ * @var bool even spear invoice can be reverted
50
+ */
51
+ protected $_canRefundInvoicePartial = true;
52
+
53
+ protected $_canVoid = true;
54
+ /**
55
+ * @var bool payment method can be used from backend
56
+ */
57
+ protected $_canUseInternal = false;
58
+ /**
59
+ * @var bool payment method can be used for checkout
60
+ */
61
+ protected $_canUseCheckout = true;
62
+ /**
63
+ * @var bool payment method supports multishipping checkout
64
+ */
65
+ protected $_canUseForMultishipping = false;
66
+ /**
67
+ * @var bool Basket details will be send to the payment server
68
+ */
69
+ protected $_canBasketApi = false;
70
+ /**
71
+ * @var bool payment method needs to be initialized
72
+ */
73
+ protected $_isInitializeNeeded = true;
74
+ /**
75
+ * @var bool invoice order mail send
76
+ */
77
+ protected $_invoiceOrderEmail = true;
78
+
79
+ /**
80
+ * @var string productive payment server url
81
+ */
82
+ protected $_liveUrl = 'https://heidelpay.hpcgw.net/ngw/post';
83
+ /**
84
+ * @var string sandbox payment server url
85
+ */
86
+ protected $_sandboxUrl = 'https://test-heidelpay.hpcgw.net/ngw/post';
87
+ /**
88
+ * @var string checkout information and form
89
+ */
90
+ protected $_formBlockType = 'hcd/form_desconly';
91
+
92
+ /**
93
+ * @return bool payment method will redirect the customer directly to heidelpay
94
+ */
95
+ public function activeRedirect()
96
+ {
97
+ return true;
98
+ }
99
+
100
+ /**
101
+ * Inject template for checkout
102
+ *
103
+ * @return string template form
104
+ */
105
+ public function getFormBlockType()
106
+ {
107
+ return $this->_formBlockType;
108
+ }
109
+
110
+ /**
111
+ * This payment method supports basket api
112
+ *
113
+ * @return bool
114
+ */
115
+ public function canBasketApi()
116
+ {
117
+ return $this->_canBasketApi;
118
+ }
119
+
120
+ /**
121
+ * Getter for pending status
122
+ *
123
+ * @param bool $param return state or status
124
+ *
125
+ * @return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
126
+ */
127
+ public function getStatusPendig($param = false)
128
+ {
129
+ if ($param == false) {
130
+ return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
131
+ } // status
132
+
133
+ return Mage_Sales_Model_Order::STATE_PENDING_PAYMENT; //state
134
+ }
135
+
136
+ /**
137
+ * Getter for error status
138
+ *
139
+ * @param bool $param return state or status
140
+ *
141
+ * @return Mage_Sales_Model_Order::STATE_CANCELED;
142
+ */
143
+ public function getStatusError($param = false)
144
+ {
145
+ if ($param == false) {
146
+ return Mage_Sales_Model_Order::STATE_CANCELED;
147
+ } // status
148
+
149
+ return Mage_Sales_Model_Order::STATE_CANCELED; //state
150
+ }
151
+
152
+ /**
153
+ * Getter for success status
154
+ *
155
+ * @param bool $param return state or status
156
+ *
157
+ * @return Mage_Sales_Model_Order::STATE_PROCESSING;
158
+ */
159
+ public function getStatusSuccess($param = false)
160
+ {
161
+ if ($param == false) {
162
+ return Mage_Sales_Model_Order::STATE_PROCESSING;
163
+ } // status
164
+
165
+ return Mage_Sales_Model_Order::STATE_PROCESSING; //state
166
+ }
167
+
168
+ /**
169
+ * Getter for partly paid status
170
+ *
171
+ * @param bool $param return state or status
172
+ *
173
+ * @return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
174
+ */
175
+ public function getStatusPartlyPaid($param = false)
176
+ {
177
+ if ($param == false) {
178
+ return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
179
+ } // status
180
+
181
+ return Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW; //state
182
+ }
183
+
184
+ /**
185
+ * Getter for core session
186
+ *
187
+ * @return Mage_Heidelpay_Model_Session
188
+ */
189
+ public function getSession()
190
+ {
191
+ return Mage::getSingleton('core/session');
192
+ }
193
+
194
+ /**
195
+ * Validate input data from checkout
196
+ *
197
+ * @return HeidelpayCD_Edition_Model_Payment_Abstract
198
+ */
199
+ public function validate()
200
+ {
201
+ parent::validate();
202
+ return $this;
203
+ }
204
+
205
+ /**
206
+ * Inject information template
207
+ *
208
+ * @return string
209
+ */
210
+ public function getInfoBlockType()
211
+ {
212
+ return $this->_infoBlockType;
213
+ }
214
+
215
+ /**
216
+ * Deactivate payment method in case of wrong currency or other credentials
217
+ *
218
+ * @param Mage_Quote
219
+ * @param null|mixed $quote
220
+ *
221
+ * @return bool
222
+ */
223
+ public function isAvailable($quote = null)
224
+ {
225
+ # Minimum and maximum amount
226
+ $totals = $this->getQuote()->getTotals();
227
+ if (!isset($totals['grand_total'])) {
228
+ return false;
229
+ }
230
+
231
+ $storeId = Mage::app()->getStore()->getId();
232
+
233
+ $amount = sprintf('%1.2f', $totals['grand_total']->getData('value'));
234
+ $amount = $amount * 100;
235
+ $path = "payment/" . $this->_code . "/";
236
+ $minamount = Mage::getStoreConfig($path . 'min_amount', $storeId);
237
+ $maxamount = Mage::getStoreConfig($path . 'max_amount', $storeId);
238
+ if (is_numeric($minamount) && $minamount > 0 && $minamount > $amount) {
239
+ return false;
240
+ }
241
+
242
+ if (is_numeric($maxamount) && $maxamount > 0 && $maxamount < $amount) {
243
+ return false;
244
+ }
245
+
246
+ return parent::isAvailable($quote);
247
+ }
248
+
249
+ /**
250
+ * Get current quote
251
+ *
252
+ * @return Mage_Sales_Model_Quote
253
+ */
254
+ public function getQuote()
255
+ {
256
+ return $this->getCheckout()->getQuote();
257
+ }
258
+
259
+ /**
260
+ * Get current checkout session
261
+ *
262
+ * @return Mage_Core_Model_Abstract::getSingleton('checkout/session')
263
+ */
264
+ public function getCheckout()
265
+ {
266
+ return Mage::getSingleton('checkout/session');
267
+ }
268
+
269
+ /**
270
+ * Redirect to heidelpay index controller in case of placing the order
271
+ *
272
+ * @return string controller url
273
+ */
274
+ public function getOrderPlaceRedirectUrl()
275
+ {
276
+ return Mage::getUrl('hcd/', array('_secure' => true));
277
+ }
278
+
279
+ /**
280
+ * Call heidelpay api for a payment request
281
+ *
282
+ * @param bool $isRegistration payment method supports registration
283
+ * @param bool $BasketI Id of a heidelpay basket api call
284
+ * @param bool $refId payment reference id for debit/authorize on a registration
285
+ * @param mixed $basketId
286
+ *
287
+ * @return mixed
288
+ */
289
+ public function getHeidelpayUrl($isRegistration = false, $basketId = false, $refId = false)
290
+ {
291
+ $config = $frontend = $user = $basketData = array();
292
+ $criterion = array();
293
+
294
+ if ($isRegistration === false) {
295
+ $order = Mage::getModel('sales/order');
296
+ $session = $this->getCheckout();
297
+ $order->loadByIncrementId($session->getLastRealOrderId());
298
+ $ordernr = $order->getRealOrderId();
299
+ } else {
300
+ $customerId = $this->getCustomerId();
301
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
302
+ $ordernr = ($customerId == 0) ? $visitorData['visitor_id'] : $customerId;
303
+ $order = $this->getQuote();
304
+ }
305
+
306
+ $this->log("Heidelpay Payment Code : " . $this->_code);
307
+ $config = $this->getMainConfig($this->_code);
308
+ if ($isRegistration === true) {
309
+ $config['PAYMENT.TYPE'] = 'RG';
310
+ }
311
+
312
+ if ($isRegistration === true) {
313
+ $basketData['PRESENTATION.CURRENCY'] =
314
+ $this->getQuote()->getQuoteCurrencyCode();
315
+ }
316
+
317
+ // add parameters for pci 3 iframe
318
+
319
+ if ($this->_code == 'hcdcc' or $this->_code == 'hcddc') {
320
+ $url = explode('/', Mage::getUrl('/', array('_secure' => true)));
321
+ $criterion['FRONTEND.PAYMENT_FRAME_ORIGIN'] = $url[0] . '//' . $url[2];
322
+ $criterion['FRONTEND.CSS_PATH'] =
323
+ Mage::getDesign()->getSkinUrl(
324
+ 'css/' . $this->_code . '_payment_frame.css',
325
+ array('_secure' => true)
326
+ );
327
+ // set frame to sync modus if frame is used in befor order mode
328
+ // (this is the registration case)
329
+ $criterion['FRONTEND.PREVENT_ASYNC_REDIRECT'] =
330
+ ($isRegistration === true) ? 'TRUE' : 'FALSE';
331
+ }
332
+
333
+ $frontend = $this->getFrontend($ordernr);
334
+ if ($isRegistration === true) {
335
+ $frontend['FRONTEND.SUCCESS_URL'] =
336
+ Mage::getUrl('hcd/', array('_secure' => true));
337
+ }
338
+
339
+ if ($isRegistration === true) {
340
+ $frontend['CRITERION.SHIPPPING_HASH'] = $this->getShippingHash();
341
+ }
342
+
343
+ $user = $this->getUser($order, $isRegistration);
344
+
345
+
346
+ if ($isRegistration === false) {
347
+ $completeBasket =
348
+ ($config['INVOICEING'] == 1
349
+ or $this->_code == "hcdbs") ? true : false;
350
+ $basketData = $this->getBasketData($order, $completeBasket);
351
+ }
352
+
353
+ if ($refId !== false) {
354
+ $user['IDENTIFICATION.REFERENCEID'] = $refId;
355
+ }
356
+
357
+ if ($basketId !== false) {
358
+ $basketData['BASKET.ID'] = $basketId;
359
+ }
360
+
361
+ Mage::dispatchEvent(
362
+ 'heidelpay_getHeidelpayUrl_bevor_preparePostData',
363
+ array(
364
+ 'order' => $order,
365
+ 'config' => $config,
366
+ 'frontend' => $frontend,
367
+ 'user' => $user,
368
+ 'basketData' => $basketData,
369
+ 'criterion' => $criterion
370
+ )
371
+ );
372
+
373
+ $params = Mage::helper('hcd/payment')->preparePostData(
374
+ $config, $frontend, $user, $basketData,
375
+ $criterion
376
+ );
377
+ $this->log("doRequest url : " . $config['URL'], 'DEBUG');
378
+ $this->log("doRequest params : " . json_encode($params), 'DEBUG');
379
+ $src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
380
+ $this->log("doRequest response : " . json_encode($src), 'DEBUG');
381
+
382
+ return $src;
383
+ }
384
+
385
+ /**
386
+ * Getter for customer identification number
387
+ *
388
+ * @return int customer identification number
389
+ */
390
+ public function getCustomerId()
391
+ {
392
+ return $this->getQuote()->getBillingAddress()->getCustomerId();
393
+ }
394
+
395
+ /**
396
+ * logger
397
+ *
398
+ * @param $message string message that should be logged
399
+ * @param string $level message level (like debug,info or warning)
400
+ * @param bool $file name of the logfile
401
+ *
402
+ * @return mixed
403
+ */
404
+ public function log($message, $level = "DEBUG", $file = false)
405
+ {
406
+ $callers = debug_backtrace();
407
+ $paymentHelper = Mage::helper('hcd/payment');
408
+ return $paymentHelper->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
409
+ }
410
+
411
+ /**
412
+ * Load configuration parameter for the given payment method
413
+ *
414
+ * @param mixed $code payment method code
415
+ * @param mixed $storeId magento store identification number
416
+ *
417
+ * @return mixed
418
+ */
419
+ public function getMainConfig($code, $storeId = false)
420
+ {
421
+ $storeId = ($storeId) ? $storeId : $this->getStore();
422
+ $path = "hcd/settings/";
423
+ $config = array();
424
+ $config['PAYMENT.METHOD'] = preg_replace('/^hcd/', '', $code);
425
+ $config['SECURITY.SENDER'] = Mage::getStoreConfig($path . "security_sender", $storeId);
426
+ if (Mage::getStoreConfig($path . "transactionmode", $storeId) == 0) {
427
+ $config['TRANSACTION.MODE'] = 'LIVE';
428
+ $config['URL'] = $this->_liveUrl;
429
+ } else {
430
+ $config['TRANSACTION.MODE'] = 'CONNECTOR_TEST';
431
+ $config['URL'] = $this->_sandboxUrl;
432
+ }
433
+
434
+ $config['USER.LOGIN'] = trim(Mage::getStoreConfig($path . "user_id", $storeId));
435
+ $config['USER.PWD'] = trim(Mage::getStoreConfig($path . "user_pwd", $storeId));
436
+ $config['INVOICEING'] = (Mage::getStoreConfig($path . "invoicing", $storeId) == 1) ? 1 : 0;
437
+ $config['USER.PWD'] = trim(Mage::getStoreConfig($path . "user_pwd", $storeId));
438
+
439
+ $path = "payment/" . $code . "/";
440
+ $config['TRANSACTION.CHANNEL'] = trim(Mage::getStoreConfig($path . "channel", $storeId));
441
+ (Mage::getStoreConfig(
442
+ $path . "bookingmode",
443
+ $storeId
444
+ ) == true) ? $config['PAYMENT.TYPE'] = Mage::getStoreConfig(
445
+ $path . "bookingmode",
446
+ $storeId
447
+ ) : false;
448
+
449
+ return $config;
450
+ }
451
+
452
+ /**
453
+ * Prepare frontend parameter for heidelpay api call
454
+ *
455
+ * @param $orderNumber order identification number
456
+ * @param bool $storeId shore identification number
457
+ *
458
+ * @return array
459
+ */
460
+ public function getFrontend($orderNumber, $storeId = false)
461
+ {
462
+ return array(
463
+ 'FRONTEND.LANGUAGE' => Mage::helper('hcd/payment')->getLang(),
464
+ 'FRONTEND.RESPONSE_URL' => Mage::getUrl(
465
+ 'hcd/response/',
466
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
467
+ ),
468
+ 'FRONTEND.SUCCESS_URL' => Mage::getUrl(
469
+ 'hcd/index/success',
470
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
471
+ ),
472
+ 'FRONTEND.FAILURE_URL' => Mage::getUrl(
473
+ 'hcd/index/error',
474
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
475
+ ),
476
+ 'CRITERION.PUSH_URL' => Mage::getUrl(
477
+ 'hcd/index/push',
478
+ array('_forced_secure' => true,'_store_to_url' => true,'_nosid' => true)
479
+ ),
480
+ 'CRITERION.SECRET' => Mage::getModel('hcd/resource_encryption')
481
+ ->getHash((string)$orderNumber),
482
+ 'CRITERION.LANGUAGE' => strtolower(Mage::helper('hcd/payment')->getLang()),
483
+ 'CRITERION.STOREID' => ($storeId) ? $storeId : Mage::app()->getStore()->getId(),
484
+ 'SHOP.TYPE' => 'Magento ' . Mage::getVersion(),
485
+ 'SHOPMODULE.VERSION' => 'HeidelpayCD Edition - ' .
486
+ (string)Mage::getConfig()->getNode()->modules->HeidelpayCD_Edition->version
487
+ );
488
+ }
489
+
490
+ /**
491
+ * ShippingHash Getter
492
+ *
493
+ * A hash of the customers shipping details
494
+ *
495
+ * @return string hash
496
+ *
497
+ */
498
+ public function getShippingHash()
499
+ {
500
+ $shipping = $this->getQuote()->getShippingAddress();
501
+ // @codingStandardsIgnoreStart can not be replace because of backwards compatiblity
502
+ return md5(
503
+ $shipping->getFirstname() .
504
+ $shipping->getLastname() .
505
+ $shipping->getStreet1() . " " . $shipping->getStreet2() .
506
+ $shipping->getPostcode() .
507
+ $shipping->getCity() .
508
+ $shipping->getCountry()
509
+ );
510
+ // @codingStandardsIgnoreEnd
511
+ }
512
+
513
+ /**
514
+ * Customer parameter for heidelpay api call
515
+ *
516
+ * @param $order Mage_Sales_Model_Order magento order object
517
+ * @param bool $isReg in case of registration
518
+ *
519
+ * @return array
520
+ *
521
+ */
522
+ // @codingStandardsIgnoreLine should be refactored - issue #1
523
+ public function getUser($order, $isReg = false)
524
+ {
525
+ $user = array();
526
+ $billing = $order->getBillingAddress();
527
+ $email = ($order->getBillingAddress()->getEmail())
528
+ ? $order->getBillingAddress()->getEmail() : $order->getCustomerEmail();
529
+ $customerId = $billing->getCustomerId();
530
+ $user['CRITERION.GUEST'] = 'false';
531
+ if ($customerId == 0) {
532
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
533
+ $customerId = $visitorData['visitor_id'];
534
+ $user['CRITERION.GUEST'] = 'true';
535
+ }
536
+
537
+ $user['IDENTIFICATION.SHOPPERID'] = $customerId;
538
+ if ($billing->getCompany() == true) {
539
+ $user['NAME.COMPANY'] = trim($billing->getCompany());
540
+ }
541
+
542
+ $user['NAME.GIVEN'] = trim($billing->getFirstname());
543
+ $user['NAME.FAMILY'] = trim($billing->getLastname());
544
+ $user['ADDRESS.STREET'] =
545
+ trim($billing->getStreet1() . " " . $billing->getStreet2());
546
+ $user['ADDRESS.ZIP'] = trim($billing->getPostcode());
547
+ $user['ADDRESS.CITY'] = trim($billing->getCity());
548
+ $user['ADDRESS.COUNTRY'] = trim($billing->getCountry());
549
+ $user['CONTACT.EMAIL'] = trim($email);
550
+ $user['CONTACT.IP'] =
551
+ (filter_var(
552
+ trim(Mage::app()->getRequest()->getClientIp()), FILTER_VALIDATE_IP
553
+ )) ? trim(Mage::app()->getRequest()->getClientIp()) : '127.0.0.1';
554
+
555
+
556
+ //load recognized data
557
+
558
+ if ($isReg === false
559
+ and $order->getPayment()->getMethodInstance()
560
+ ->activeRedirect() === true
561
+ ) {
562
+ if ($this->getCustomerData($this->_code, $billing->getCustomerId())) {
563
+ $paymentData =
564
+ $this->getCustomerData($this->_code, $billing->getCustomerId());
565
+
566
+
567
+ $this->log('getUser Customer: ' . json_encode($paymentData), 'DEBUG');
568
+
569
+ if (isset($paymentData['payment_data']['ACCOUNT.IBAN'])) {
570
+ $paymentData['payment_data']['ACCOUNT.IBAN'] =
571
+ strtoupper($paymentData['payment_data']['ACCOUNT.IBAN']);
572
+ }
573
+
574
+ // remove SHIPPING_HASH from parameters
575
+ if (isset($paymentData['payment_data']['SHIPPPING_HASH'])) {
576
+ unset($paymentData['payment_data']['SHIPPPING_HASH']);
577
+ }
578
+
579
+ // remove cc or dc reference data
580
+ if ($this->_code == 'hcdcc' or $this->_code == 'hcddc') {
581
+ if (isset($paymentData['payment_data']['ACCOUNT_BRAND'])) {
582
+ unset($paymentData['payment_data']['ACCOUNT_BRAND']);
583
+ }
584
+
585
+ if (isset($paymentData['payment_data']['ACCOUNT_NUMBER'])) {
586
+ unset($paymentData['payment_data']['ACCOUNT_NUMBER']);
587
+ }
588
+
589
+ if (isset($paymentData['payment_data']['ACCOUNT_HOLDER'])) {
590
+ unset($paymentData['payment_data']['ACCOUNT_HOLDER']);
591
+ }
592
+
593
+ if (isset($paymentData['payment_data']['ACCOUNT_EXPIRY_MONTH'])
594
+ ) {
595
+ unset($paymentData['payment_data']['ACCOUNT_EXPIRY_MONTH']);
596
+ }
597
+
598
+ if (isset($paymentData['payment_data']['ACCOUNT_EXPIRY_YEAR'])) {
599
+ unset($paymentData['payment_data']['ACCOUNT_EXPIRY_YEAR']);
600
+ }
601
+ }
602
+
603
+ foreach ($paymentData['payment_data'] as $k => $v) {
604
+ $user[$k] = $v;
605
+ }
606
+ }
607
+ }
608
+
609
+ return $user;
610
+ }
611
+
612
+ /**
613
+ * Load additional payment information
614
+ *
615
+ * @param bool $code current payment method
616
+ * @param bool $customerId the customers identification number
617
+ * @param bool $storeId magento store id
618
+ *
619
+ * @return array|bool additional payment information
620
+ */
621
+ public function getCustomerData($code = false, $customerId = false, $storeId = false)
622
+ {
623
+ $paymentCode = ($code) ? $code : $this->_code;
624
+ $customerId = ($customerId) ? $customerId : $this->getQuote()->getBillingAddress()->getCustomerId();
625
+ $storeId = ($storeId) ? $storeId : Mage::app()->getStore()->getId();
626
+ if ($customerId == 0) {
627
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
628
+ $customerId = $visitorData['visitor_id'];
629
+ $storeId = 0;
630
+ }
631
+
632
+ $this->log('StoreID :' . Mage::app()->getStore()->getId());
633
+
634
+ $customerData = Mage::getModel('hcd/customer')
635
+ ->getCollection()
636
+ ->addFieldToFilter('Customerid', $customerId)
637
+ ->addFieldToFilter('Storeid', $storeId)
638
+ ->addFieldToFilter('Paymentmethode', $paymentCode);
639
+
640
+ $customerData->load();
641
+ $data = $customerData->getData();
642
+
643
+ /* retun false if not */
644
+ if (empty($data[0]['id'])) {
645
+ return false;
646
+ }
647
+
648
+ $return = array();
649
+
650
+ $return['id'] = $data[0]['id'];
651
+
652
+ if (!empty($data[0]['uniqeid'])) {
653
+ $return['uniqeid'] = $data[0]['uniqeid'];
654
+ }
655
+
656
+ if (!empty($data[0]['payment_data'])) {
657
+ $return['payment_data'] = json_decode(
658
+ Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['payment_data']),
659
+ true
660
+ );
661
+ }
662
+
663
+ return $return;
664
+ }
665
+
666
+ /**
667
+ * Prepare basket details for heidelpay basket call
668
+ *
669
+ * @param $order Mage_Sales_Model_Order magento order object
670
+ * @param bool $completeBasket
671
+ * @param bool $amount order amount
672
+ *
673
+ * @return array
674
+ */
675
+ public function getBasketData($order, $completeBasket = false, $amount = false)
676
+ {
677
+ $data = array(
678
+ 'PRESENTATION.AMOUNT' => ($amount) ? $amount : Mage::helper('hcd/payment')
679
+ ->format($order->getGrandTotal()),
680
+ 'PRESENTATION.CURRENCY' => $order->getOrderCurrencyCode(),
681
+ 'IDENTIFICATION.TRANSACTIONID' => $order->getRealOrderId()
682
+ );
683
+ // Add basket details in case of BillSafe or invoicing over heidelpay
684
+ $basket = array();
685
+ if ($completeBasket) {
686
+ $basket = $this->getBasket($order);
687
+ }
688
+
689
+ return array_merge($basket, $data);
690
+ }
691
+
692
+ /**
693
+ * Getter for the payment method backend title
694
+ *
695
+ * @return string payment method title
696
+ */
697
+ public function getAdminTitle()
698
+ {
699
+ return $this->getTitle();
700
+ }
701
+
702
+ /**
703
+ * Getter for the payment method frontend title
704
+ *
705
+ * @return string payment method title
706
+ */
707
+ public function getTitle()
708
+ {
709
+ $storeId = $this->getStore();
710
+ $path = "payment/" . $this->_code . "/";
711
+ return $this->_getHelper()->__(Mage::getStoreConfig($path . "title", $storeId));
712
+ }
713
+
714
+ /**
715
+ * Api call to capture a given amount on an invoice
716
+ *
717
+ * @param $payment Mage_Sales_Model_Order_Payment current payment object
718
+ * @param $amount float amount to capture
719
+ *
720
+ * @return $this
721
+ */
722
+ public function capture(Varien_Object $payment, $amount)
723
+ {
724
+ $criterion = array();
725
+
726
+ $order = $payment->getOrder();
727
+ $this->log('StoreId' . $order->getStoreId());
728
+ if ($this->canCapture()) {
729
+ $authorisationModel = Mage::getModel('hcd/transaction');
730
+ /**
731
+ * @var $authorisation HeidelpayCD_Edition_Model_Transaction
732
+ */
733
+ $authorisation = $authorisationModel->getOneTransactionByMethode(
734
+ $order->getRealOrderId(),
735
+ 'PA'
736
+ );
737
+
738
+
739
+ if ($authorisation === false) {
740
+ Mage::throwException(Mage::helper('hcd')->__('This Transaction could not be capture online.'));
741
+ return $this;
742
+ }
743
+
744
+ $config = $this->getMainConfig($this->_code, $authorisation['CRITERION_STOREID']);
745
+ $config['PAYMENT.TYPE'] = 'CP';
746
+
747
+
748
+ $frontend = $this->getFrontend($order->getRealOrderId(), $authorisation['CRITERION_STOREID']);
749
+ $frontend['FRONTEND.MODE'] = 'DEFAULT';
750
+ $frontend['FRONTEND.ENABLED'] = 'false';
751
+
752
+ $user = $this->getUser($order, true);
753
+ $basketdetails = ($this->_code == 'hcdbs') ? true : false; // If billsafe set to fin
754
+ $basketData = $this->getBasketData($order, $basketdetails, $amount);
755
+
756
+ $basketData['IDENTIFICATION.REFERENCEID'] = $authorisation['IDENTIFICATION_UNIQUEID'];
757
+ Mage::dispatchEvent(
758
+ 'heidelpay_capture_bevor_preparePostData', array(
759
+ 'payment' => $payment,
760
+ 'config' => $config,
761
+ 'frontend' => $frontend,
762
+ 'user' => $user,
763
+ 'basketData' => $basketData,
764
+ 'criterion' => $criterion
765
+ )
766
+ );
767
+ $params = Mage::helper('hcd/payment')->preparePostData(
768
+ $config, $frontend, $user, $basketData,
769
+ $criterion
770
+ );
771
+
772
+
773
+ $this->log("doRequest url : " . $config['URL']);
774
+ $this->log("doRequest params : " . json_encode($params));
775
+
776
+ $src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
777
+
778
+ $this->log("doRequest response : " . json_encode($src));
779
+
780
+
781
+
782
+ if ($src['PROCESSING_RESULT'] == "NOK") {
783
+ Mage::throwException('Heidelpay Error: ' . $src['PROCESSING_RETURN']);
784
+ return $this;
785
+ }
786
+
787
+ $payment->setTransactionId($src['IDENTIFICATION_UNIQUEID']);
788
+ Mage::getModel('hcd/transaction')->saveTransactionData($src);
789
+ }
790
+
791
+ return $this;
792
+ }
793
+
794
+ /**
795
+ * Calculate weather a order can be captured or not
796
+ *
797
+ * @return bool canCapture
798
+ */
799
+ public function canCapture()
800
+ {
801
+ //check weather this payment method supports capture
802
+
803
+ if ($this->_canCapture === false) {
804
+ return false;
805
+ }
806
+
807
+ // prevent frontend to capture an amount in case of direct booking with automatical invoice
808
+ if (Mage::app()->getStore()->getId() != 0) {
809
+ $this->log('try to capture amount in frontend ... this is not necessary !');
810
+ return false;
811
+ }
812
+
813
+ // loading order object to check wether this
814
+ $orderIncrementId = Mage::app()->getRequest()->getParam('order_id');
815
+ $this->log('$orderIncrementId ' . $orderIncrementId);
816
+ /**
817
+ * @var $order Mage_Sales_Model_Order order object
818
+ */
819
+ $order = Mage::getModel('sales/order');
820
+ $order->loadByAttribute('entity_id', (int)$orderIncrementId);
821
+ /**
822
+ * @var $transaction HeidelpayCD_Edition_Model_Transaction
823
+ */
824
+ $transaction = Mage::getModel('hcd/transaction');
825
+ if ($transaction->getOneTransactionByMethode($order->getRealOrderId(), 'PA') === false) {
826
+ $this->log('there is no preauthorisation for the order ' . $order->getRealOrderId());
827
+ return false;
828
+ }
829
+
830
+ return true;
831
+ }
832
+
833
+ /**
834
+ * Api call for refunding a given invoice
835
+ *
836
+ * @param Mage_Sales_Model_Order_Payment $payment current payment object
837
+ * @param float $amount amount to refund
838
+ *
839
+ * @return $this
840
+ */
841
+ public function refund(Varien_Object $payment, $amount)
842
+ {
843
+ /** @var $order Mage_Sales_Model_Order */
844
+ $order = $payment->getOrder();
845
+
846
+ /** @var $transaction HeidelpayCD_Edition_Model_Transaction */
847
+ $transaction = Mage::getModel('hcd/transaction');
848
+ $captureData = $transaction->loadLastTransactionDataByUniqeId((string)$payment->getRefundTransactionId());
849
+
850
+ $config = $this->getMainConfig($this->_code, $captureData['CRITERION_STOREID']);
851
+ $config['PAYMENT.TYPE'] = 'RF';
852
+ $frontend = $this->getFrontend($order->getRealOrderId(), $captureData['CRITERION_STOREID']);
853
+ $frontend['FRONTEND.MODE'] = 'DEFAULT';
854
+ $frontend['FRONTEND.ENABLED'] = 'false';
855
+ $user = $this->getUser($order, true);
856
+ $basketData = $this->getBasketData($order, false, $amount);
857
+ $basketData['IDENTIFICATION.REFERENCEID'] = (string)$payment->getRefundTransactionId();
858
+ $params = Mage::helper('hcd/payment')->preparePostData(
859
+ $config, $frontend, $user, $basketData,
860
+ $criterion = array()
861
+ );
862
+ $this->log("doRequest url : " . $config['URL']);
863
+ $this->log("doRequest params : " . json_encode($params));
864
+
865
+ $src = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
866
+ $this->log("doRequest response : " . json_encode($src));
867
+ if ($src['PROCESSING_RESULT'] == "NOK") {
868
+ Mage::throwException('Heidelpay Error: ' . $src['PROCESSING_RETURN']);
869
+ return $this;
870
+ }
871
+
872
+ $payment->setTransactionId($src['IDENTIFICATION_UNIQUEID']);
873
+ Mage::getModel('hcd/transaction')->saveTransactionData($src);
874
+ return $this;
875
+ }
876
+
877
+ /**
878
+ * Getter for customer given plus family name
879
+ *
880
+ * @param $session Mage_Checkout_Model_Session checkout session
881
+ *
882
+ * @return string given plus family name
883
+ */
884
+ public function getCustomerName($session = false)
885
+ {
886
+ if ($session === true) {
887
+ $session = $this->getCheckout();
888
+ return $session->getQuote()->getBillingAddress()->getFirstname() . ' '
889
+ . $session->getQuote()->getBillingAddress()->getLastname();
890
+ }
891
+
892
+ return $this->getQuote()->getBillingAddress()->getFirstname() . ' '
893
+ . $this->getQuote()->getBillingAddress()->getLastname();
894
+ }
895
+
896
+ /**
897
+ * Save additional payment data of the customer to the database
898
+ *
899
+ * @param $data array additional payment information of the customer
900
+ * @param $uniqeID string payment reference of a account registration
901
+ */
902
+ public function saveCustomerData($data, $uniqeID = null)
903
+ {
904
+ /** @var $customerData HeidelpayCD_Edition_Model_Customer */
905
+ $customerData = Mage::getModel('hcd/customer');
906
+
907
+ if ($this->getCustomerData() !== false) {
908
+ $lastdata = $this->getCustomerData();
909
+ $customerData->load($lastdata['id']);
910
+ }
911
+
912
+ $this->log('StoreID :' . Mage::app()->getStore()->getId());
913
+ $customerId = $this->getQuote()->getBillingAddress()->getCustomerId();
914
+ $storeId = Mage::app()->getStore()->getId();
915
+ if ($customerId == 0) {
916
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
917
+ $customerId = $visitorData['visitor_id'];
918
+ $storeId = 0;
919
+ }
920
+
921
+ $customerData->setPaymentmethode($this->_code);
922
+ $customerData->setUniqeid($uniqeID);
923
+ $customerData->setCustomerid($customerId);
924
+ $customerData->setStoreid($storeId);
925
+ $data['SHIPPPING_HASH'] = $this->getShippingHash();
926
+ $customerData->setPaymentData(Mage::getModel('hcd/resource_encryption')->encrypt(json_encode($data)));
927
+
928
+ $customerData->save();
929
+ }
930
+
931
+ /**
932
+ * Generates a customer message for the success page
933
+ *
934
+ * Will be used for prepayment and direct debit to show the customer
935
+ * the billing information
936
+ *
937
+ * @param $paymentData transaction details form heidelpay api
938
+ *
939
+ * @return bool| string customer message for the success page
940
+ */
941
+ public function showPaymentInfo($paymentData)
942
+ {
943
+ /*
944
+ * This function should not be modified please overwrite this function
945
+ * in the class of the used payment method !!!
946
+ */
947
+ return false;
948
+ }
949
+
950
+ /**
951
+ * Handle charge back notices from heidelpay payment
952
+ *
953
+ * @param $order Mage_Sales_Model_Order
954
+ * @param $message string order history message
955
+ *
956
+ * @return Mage_Sales_Model_Order
957
+ */
958
+ public function chargeBackTransaction($order, $message="")
959
+ {
960
+ // message block for direct debit charge back
961
+ if ($order->hasInvoices()) {
962
+ $invIncrementIDs = array();
963
+ /** @var $invoice Mage_Sales_Model_Order_Invoice */
964
+ foreach ($order->getInvoiceCollection() as $invoice) {
965
+ $this->log('Invoice Number ' . (string)$invoice->getIncrementId());
966
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
967
+ $invoice->setIsPaid(false);
968
+ // @codingStandardsIgnoreLine use of save in a loop
969
+ $invoice->save();
970
+ }
971
+
972
+ $order->setIsInProcess(false);
973
+ $order->setTotalInvoiced(0);
974
+ $order->setTotalPaid(0);
975
+ }
976
+
977
+ $order->setState(
978
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
979
+ true,
980
+ $message
981
+ );
982
+
983
+ return $order;
984
+ }
985
+
986
+ /**
987
+ * Handle transaction with an not ok status
988
+ *
989
+ * @param $order Mage_Sales_Model_Order
990
+ * @param $message string order history message
991
+ *
992
+ * @return Mage_Sales_Model_Order
993
+ */
994
+ public function canceledTransaction($order, $message)
995
+ {
996
+ if ($order->canCancel()) {
997
+ $order->cancel();
998
+
999
+ $order->setState(
1000
+ $order->getPayment()->getMethodInstance()->getStatusError(false),
1001
+ $order->getPayment()->getMethodInstance()->getStatusError(true),
1002
+ $message
1003
+ );
1004
+ }
1005
+
1006
+ return $order;
1007
+ }
1008
+
1009
+ /**
1010
+ * Handle transaction with means processing
1011
+ *
1012
+ * @param $order Mage_Sales_Model_Order
1013
+ * @param $data HeidelpayCD_Edition_Model_Transaction
1014
+ * @param $message string order history message
1015
+ *
1016
+ * @return Mage_Sales_Model_Order
1017
+ */
1018
+ public function processingTransaction($order, $data, $message='')
1019
+ {
1020
+
1021
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
1022
+ $paymentHelper = Mage::helper('hcd/payment');
1023
+
1024
+
1025
+ $message = ($message === '') ? 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] : $message;
1026
+ $totallyPaid = false;
1027
+
1028
+ $order->getPayment()
1029
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
1030
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
1031
+ ->setIsTransactionClosed(true);
1032
+
1033
+ if ($paymentHelper->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and
1034
+ $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']
1035
+ ) {
1036
+ $order->setState(
1037
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
1038
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
1039
+ $message
1040
+ );
1041
+ $totallyPaid = true;
1042
+ } else {
1043
+ /*
1044
+ * in case rc is ack and amount is to low or currency miss match
1045
+ */
1046
+ $order->setState(
1047
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
1048
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
1049
+ $message
1050
+ );
1051
+ }
1052
+
1053
+ $code = $order->getPayment()->getMethodInstance()->getCode();
1054
+
1055
+ $path = "payment/" . $code . "/";
1056
+ $autoInvoice = (Mage::getStoreConfig($path . "invioce", $data['CRITERION_STOREID']) == 1) ? true : false;
1057
+
1058
+ $this->log('Auto invoiced :'. (string) $autoInvoice);
1059
+
1060
+ if ($order->canInvoice() and ($autoInvoice or $code == 'hcdbs') and $totallyPaid === true) {
1061
+ $invoice = $order->prepareInvoice();
1062
+ $invoice->register()->capture();
1063
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
1064
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);
1065
+ $invoice->setIsPaid(true);
1066
+ $order->setIsInProcess(true);
1067
+ $order->addStatusHistoryComment(
1068
+ Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
1069
+ false
1070
+ );
1071
+ $invoice->save();
1072
+
1073
+ if ($this->_invoiceOrderEmail) {
1074
+ if ($code != 'hcdpp' and $code != 'hcdiv') {
1075
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
1076
+ $invoiceMailComment = ($info === false) ? '' : '<h3>'
1077
+ . $this->_getHelper()->__('Payment Information') . '</h3>' . $info . '<br/>';
1078
+ }
1079
+
1080
+ $invoice->sendEmail(true, $invoiceMailComment); // send invoice mail
1081
+ }
1082
+
1083
+
1084
+ $transactionSave = Mage::getModel('core/resource_transaction')
1085
+ ->addObject($invoice)
1086
+ ->addObject($invoice->getOrder());
1087
+ $transactionSave->save();
1088
+ }
1089
+
1090
+ $order->getPayment()->addTransaction(
1091
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
1092
+ null,
1093
+ true,
1094
+ $message
1095
+ );
1096
+
1097
+ $order->setIsInProcess(true);
1098
+
1099
+ return $order;
1100
+ }
1101
+
1102
+ /**
1103
+ * Handle transaction with means pending
1104
+ *
1105
+ * @param $order Mage_Sales_Model_Order
1106
+ * @param $data HeidelpayCD_Edition_Model_Transaction
1107
+ * @param $message string order history message
1108
+ *
1109
+ * @return Mage_Sales_Model_Order
1110
+ */
1111
+ public function pendingTransaction($order, $data, $message='')
1112
+ {
1113
+ $message = 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] .' '.$message;
1114
+
1115
+ $order->getPayment()->setTransactionId($data['IDENTIFICATION_UNIQUEID']);
1116
+
1117
+ $order->getPayment()->setIsTransactionClosed(0);
1118
+
1119
+ $order->getPayment()->setTransactionAdditionalInfo(
1120
+ Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
1121
+ null
1122
+ );
1123
+
1124
+ $this->log('Set Transaction to Pending : ');
1125
+ $order->setState(
1126
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
1127
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
1128
+ $message
1129
+ );
1130
+ $order->getPayment()->addTransaction(
1131
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
1132
+ null,
1133
+ true,
1134
+ $message
1135
+ );
1136
+ return $order;
1137
+ }
1138
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/AbstractSecuredPaymentMethods.php ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Abstract payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods extends HeidelpayCD_Edition_Model_Payment_Abstract
19
+ {
20
+ /**
21
+ * validation helper
22
+ *
23
+ * @var $_validatorHelper HeidelpayCD_Edition_Helper_Validator
24
+ */
25
+ protected $_validatorHelper;
26
+ /**
27
+ * send basket information to basket api
28
+ *
29
+ * @var bool send basket information to basket api
30
+ */
31
+ protected $_canBasketApi = false;
32
+
33
+ /**
34
+ * set checkout form block
35
+ *
36
+ * @var string checkout form block
37
+ */
38
+ protected $_formBlockType = 'hcd/form_invoiceSecured';
39
+
40
+ /**
41
+ * over write existing info block
42
+ *
43
+ * @var string
44
+ */
45
+ protected $_infoBlockType = 'hcd/info_invoice';
46
+
47
+ /**
48
+ * validated parameter
49
+ *
50
+ * @var array validated parameter
51
+ */
52
+ protected $_validatedParameters = array();
53
+
54
+ /**
55
+ * post data from checkout
56
+ *
57
+ * @var $_postPayload array post data from checkout
58
+ */
59
+ protected $_postPayload = array();
60
+
61
+ /**
62
+ * HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods constructor.
63
+ *
64
+ * @param $emptyArray array empty array from upstream
65
+ * @param HeidelpayCD_Edition_Helper_Validator $validatorHelper
66
+ */
67
+ // @codingStandardsIgnoreLine magento sets an empty array
68
+ public function __construct()
69
+ {
70
+ $this->_validatorHelper = Mage::helper('hcd/validator');
71
+ }
72
+
73
+ /**
74
+ * Over wright from block
75
+ *
76
+ * @return string
77
+ */
78
+ public function getFormBlockType()
79
+ {
80
+ return $this->_formBlockType;
81
+ }
82
+
83
+ /**
84
+ * is payment method available
85
+ *
86
+ * @param null $quote
87
+ *
88
+ * @return bool is payment method available
89
+ */
90
+ public function isAvailable($quote = null)
91
+ {
92
+ $billing = $this->getQuote()->getBillingAddress();
93
+ $shipping = $this->getQuote()->getShippingAddress();
94
+
95
+ /* billing and shipping address has to match */
96
+ if (($billing->getFirstname() != $shipping->getFirstname()) or
97
+ ($billing->getLastname() != $shipping->getLastname()) or
98
+ ($billing->getStreet() != $shipping->getStreet()) or
99
+ ($billing->getPostcode() != $shipping->getPostcode()) or
100
+ ($billing->getCity() != $shipping->getCity()) or
101
+ ($billing->getCountry() != $shipping->getCountry())
102
+ ) {
103
+ return false;
104
+ }
105
+
106
+ /* payment method is b2c only */
107
+ if (!empty($billing->getCompany())) {
108
+ return false;
109
+ }
110
+
111
+ return parent::isAvailable($quote);
112
+ }
113
+
114
+ /**
115
+ * Validate customer input on checkout
116
+ *
117
+ * @return $this
118
+ */
119
+ public function validate()
120
+ {
121
+ parent::validate();
122
+
123
+ if (isset($this->_postPayload['method']) and $this->_postPayload['method'] == $this->_code) {
124
+ if (array_key_exists($this->_code . '_salutation', $this->_postPayload)) {
125
+ $this->_validatedParameters['NAME.SALUTATION'] =
126
+ (
127
+ $this->_postPayload[$this->_code . '_salutation'] == 'MR' or
128
+ $this->_postPayload[$this->_code . '_salutation'] == 'MRS'
129
+ )
130
+ ? $this->_postPayload[$this->_code . '_salutation'] : '';
131
+ }
132
+
133
+ if (array_key_exists($this->_code . '_dobday', $this->_postPayload) &&
134
+ array_key_exists($this->_code . '_dobmonth', $this->_postPayload) &&
135
+ array_key_exists($this->_code . '_dobyear', $this->_postPayload)
136
+ ) {
137
+ $day = (int)$this->_postPayload[$this->_code . '_dobday'];
138
+ $mounth = (int)$this->_postPayload[$this->_code . '_dobmonth'];
139
+ $year = (int)$this->_postPayload[$this->_code . '_dobyear'];
140
+
141
+ if ($this->_validatorHelper->validateDateOfBirth($day, $mounth, $year)) {
142
+ $this->_validatedParameters['NAME.BIRTHDATE']
143
+ = $year . '-' . sprintf("%02d", $mounth) . '-' . sprintf("%02d", $day);
144
+ } else {
145
+ Mage::throwException(
146
+ $this->_getHelper()
147
+ ->__('The minimum age is 18 years for this payment methode.')
148
+ );
149
+ }
150
+ }
151
+
152
+
153
+ $this->saveCustomerData($this->_validatedParameters);
154
+ }
155
+
156
+ return $this;
157
+ }
158
+
159
+ /**
160
+ * Payment information for invoice mail
161
+ *
162
+ * @param array $paymentData transaction response
163
+ *
164
+ * @return string return payment information text
165
+ */
166
+ public function showPaymentInfo($paymentData)
167
+ {
168
+ $loadSnippet = $this->_getHelper()->__("Invoice Info Text");
169
+
170
+ $replace = array(
171
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
172
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
173
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CONNECTOR_ACCOUNT_HOLDER'],
174
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CONNECTOR_ACCOUNT_IBAN'],
175
+ '{CONNECTOR_ACCOUNT_BIC}' => $paymentData['CONNECTOR_ACCOUNT_BIC'],
176
+ '{IDENTIFICATION_SHORTID}' => $paymentData['IDENTIFICATION_SHORTID'],
177
+ );
178
+
179
+ return strtr($loadSnippet, $replace);
180
+ }
181
+
182
+ /**
183
+ * Handle transaction with means pending
184
+ *
185
+ * @param $order Mage_Sales_Model_Order
186
+ * @param $data HeidelpayCD_Edition_Model_Transaction
187
+ * @param $message string order history message
188
+ *
189
+ * @return Mage_Sales_Model_Order
190
+ */
191
+ public function pendingTransaction($order, $data, $message = '')
192
+ {
193
+ $message = 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] . ' ' . $message;
194
+
195
+ $order->getPayment()
196
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
197
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
198
+ ->setIsTransactionClosed(false);
199
+
200
+ $invoice = $order->prepareInvoice();
201
+ $invoice->register();
202
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
203
+ $order->setIsInProcess(true);
204
+ $invoice->setIsPaid(false);
205
+ $order->addStatusHistoryComment(
206
+ Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
207
+ false
208
+ );
209
+ $invoice->save();
210
+ if ($this->_invoiceOrderEmail) {
211
+ $code = $order->getPayment()->getMethodInstance()->getCode();
212
+ if ($code == 'hcdiv' or $code == 'hcdivsec') {
213
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
214
+ $invoiceMailComment = ($info === false) ? '' : '<h3>'
215
+ . $this->_getHelper()->__('payment information') . '</h3><p>' . $info . '</p>';
216
+ }
217
+
218
+ $invoice->sendEmail(true, $invoiceMailComment); // send invoice mail
219
+ }
220
+
221
+
222
+ $transactionSave = Mage::getModel('core/resource_transaction')
223
+ ->addObject($invoice)
224
+ ->addObject($invoice->getOrder());
225
+ $transactionSave->save();
226
+
227
+ $this->log('Set transaction to processed and generate invoice ');
228
+ $order->setState(
229
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
230
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
231
+ $message
232
+ );
233
+
234
+ $order->getPayment()->addTransaction(
235
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
236
+ null,
237
+ true,
238
+ $message
239
+ );
240
+
241
+ return $order;
242
+ }
243
+
244
+ /**
245
+ * Handle transaction with means processing
246
+ *
247
+ * @param $order Mage_Sales_Model_Order
248
+ * @param $data HeidelpayCD_Edition_Model_Transaction
249
+ * @param $message string order history message
250
+ *
251
+ * @return Mage_Sales_Model_Order
252
+ */
253
+ public function processingTransaction($order, $data, $message = '')
254
+ {
255
+
256
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
257
+ $paymentHelper = Mage::helper('hcd/payment');
258
+
259
+
260
+ $message = ($message === '') ? 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] : $message;
261
+ $totallyPaid = false;
262
+
263
+ $order->getPayment()
264
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
265
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
266
+ ->setIsTransactionClosed(true);
267
+
268
+ if ($paymentHelper->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and
269
+ $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']
270
+ ) {
271
+ $order->setState(
272
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
273
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
274
+ $message
275
+ );
276
+ $totallyPaid = true;
277
+ } else {
278
+ // in case rc is ack and amount is to low or currency miss match
279
+
280
+ $order->setState(
281
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
282
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
283
+ $message
284
+ );
285
+ }
286
+
287
+ // Set invoice to paid when the total amount matches
288
+ if ($order->hasInvoices() and $totallyPaid) {
289
+
290
+ /** @var $invoice Mage_Sales_Model_Order_Invoice */
291
+ foreach ($order->getInvoiceCollection() as $invoice) {
292
+ $this->log('Set invoice ' . (string)$invoice->getIncrementId() . ' to paid.');
293
+ $invoice
294
+ ->capture()
295
+ ->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID)
296
+ ->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
297
+ ->setIsPaid(true)
298
+ // @codingStandardsIgnoreLine use of save in a loop
299
+ ->save();
300
+
301
+ $transactionSave = Mage::getModel('core/resource_transaction')
302
+ ->addObject($invoice)
303
+ ->addObject($invoice->getOrder());
304
+ // @codingStandardsIgnoreLine use of save in a loop
305
+ $transactionSave->save();
306
+ }
307
+ }
308
+
309
+ // Set total paid and invoice to the connector amount
310
+ $order->setTotalInvoiced($data['PRESENTATION_AMOUNT']);
311
+ $order->setTotalPaid($data['PRESENTATION_AMOUNT']);
312
+
313
+
314
+ $order->getPayment()->addTransaction(
315
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
316
+ null,
317
+ true,
318
+ $message
319
+ );
320
+
321
+ $order->setIsInProcess(true);
322
+
323
+ return $order;
324
+ }
325
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/HcdDirectDebitSecured.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Direct debit secured payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_HcdDirectDebitSecured extends HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods
19
+ {
20
+ /**
21
+ * payment code
22
+ *
23
+ * @var string payment code
24
+ */
25
+ protected $_code = 'hcdddsec';
26
+
27
+ /**
28
+ * set checkout form block
29
+ *
30
+ * @var string checkout form block
31
+ */
32
+ protected $_formBlockType = 'hcd/form_directDebitSecured';
33
+
34
+ /**
35
+ * over write existing info block
36
+ *
37
+ * @var string
38
+ */
39
+ protected $_infoBlockType = 'hcd/info_directDebit';
40
+
41
+ /**
42
+ * Validate customer input on checkout
43
+ *
44
+ * @return $this
45
+ */
46
+ public function validate()
47
+ {
48
+ $this->_postPayload = Mage::app()->getRequest()->getPOST('payment');
49
+
50
+ if (isset($this->_postPayload['method']) and $this->_postPayload['method'] == $this->_code) {
51
+ parent::validate();
52
+
53
+ if (empty($this->_postPayload[$this->_code . '_holder'])) {
54
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
55
+ }
56
+
57
+ if (empty($this->_postPayload[$this->_code . '_iban'])) {
58
+ Mage::throwException($this->_getHelper()->__('Please specify a iban or account'));
59
+ }
60
+
61
+ $this->_validatedParameters['ACCOUNT.HOLDER'] = $this->_postPayload[$this->_code . '_holder'];
62
+
63
+ if (preg_match('#^[\d]#', $this->_postPayload[$this->_code . '_iban'])) {
64
+ $this->_validatedParameters['ACCOUNT.NUMBER'] = $this->_postPayload[$this->_code . '_iban'];
65
+ } else {
66
+ $this->_validatedParameters['ACCOUNT.IBAN'] = $this->_postPayload[$this->_code . '_iban'];
67
+ }
68
+
69
+ parent::validate();
70
+ }
71
+
72
+ return $this;
73
+ }
74
+
75
+ /**
76
+ * Payment information for invoice mail
77
+ *
78
+ * @param $paymentData array transaction response
79
+ *
80
+ * @return string return payment information text
81
+ */
82
+ public function showPaymentInfo($paymentData)
83
+ {
84
+ $loadSnippet = $this->_getHelper()->__("Direct Debit Info Text");
85
+
86
+ $repl = array(
87
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
88
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
89
+ '{Iban}' => $paymentData['ACCOUNT_IBAN'],
90
+ '{Ident}' => $paymentData['ACCOUNT_IDENTIFICATION'],
91
+ '{CreditorId}' => $paymentData['IDENTIFICATION_CREDITOR_ID'],
92
+ );
93
+
94
+ return strtr($loadSnippet, $repl);
95
+ }
96
+
97
+ /**
98
+ * @inheritdoc
99
+ */
100
+ public function chargeBack($order, $message = "")
101
+ {
102
+ $message = Mage::helper('hcd')->__('debit failed');
103
+ return parent::chargeBack($order, $message);
104
+ }
105
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/HcdInvoiceSecured.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Invoice secured payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_HcdInvoiceSecured extends HeidelpayCD_Edition_Model_Payment_AbstractSecuredPaymentMethods
19
+ {
20
+ /**
21
+ * payment code
22
+ *
23
+ * @var string payment code
24
+ */
25
+ protected $_code = 'hcdivsec';
26
+
27
+ /**
28
+ * @inheritdoc
29
+ */
30
+ public function validate()
31
+ {
32
+ $this->_postPayload = Mage::app()->getRequest()->getPOST('payment');
33
+ return parent::validate();
34
+ }
35
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdbs.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * BillSafe payment method
5
+ *
6
+ * @license Use of this software requires acceptance of the License Agreement.
7
+ * @copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
18
+ class HeidelpayCD_Edition_Model_Payment_Hcdbs extends HeidelpayCD_Edition_Model_Payment_Abstract
19
+ {
20
+ /** @var $_code string payment method code */
21
+ protected $_code = 'hcdbs';
22
+ /** @var $_canRefund bool */
23
+ protected $_canRefund = false;
24
+ /** @var $_canRefundInvoicePartial bool */
25
+ protected $_canRefundInvoicePartial = false;
26
+
27
+ /** @var $_basketApiHelper HeidelpayCD_Edition_Helper_BasketApi */
28
+ protected $_basketApiHelper;
29
+
30
+ /**
31
+ * HeidelpayCD_Edition_Model_Payment_Hcdbs constructor.
32
+ */
33
+ public function __construct()
34
+ {
35
+ parent::__construct();
36
+ $this->_basketApiHelper = Mage::helper('hcd/basketApi');
37
+ }
38
+
39
+ /**
40
+ * @inheritdoc
41
+ */
42
+ public function isAvailable($quote = null)
43
+ {
44
+ $billing = $this->getQuote()->getBillingAddress();
45
+ $shipping = $this->getQuote()->getShippingAddress();
46
+
47
+ if (($billing->getFirstname() != $shipping->getFirstname()) or
48
+ ($billing->getLastname() != $shipping->getLastname()) or
49
+ ($billing->getStreet() != $shipping->getStreet()) or
50
+ ($billing->getPostcode() != $shipping->getPostcode()) or
51
+ ($billing->getCity() != $shipping->getCity()) or
52
+ ($billing->getCountry() != $shipping->getCountry())
53
+ ) {
54
+ return false;
55
+ }
56
+
57
+ return parent::isAvailable($quote);
58
+ }
59
+
60
+ /**
61
+ * @inheritdoc
62
+ */
63
+ public function showPaymentInfo($paymentData)
64
+ {
65
+ $loadSnippet = $this->_getHelper()->__("BillSafe Info Text");
66
+
67
+ $replace = array(
68
+ '{LEGALNOTE}' => $paymentData['CRITERION_BILLSAFE_LEGALNOTE'],
69
+ '{AMOUNT}' => $paymentData['CRITERION_BILLSAFE_AMOUNT'],
70
+ '{CURRENCY}' => $paymentData['CRITERION_BILLSAFE_CURRENCY'],
71
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CRITERION_BILLSAFE_RECIPIENT'],
72
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CRITERION_BILLSAFE_IBAN'],
73
+ '{CONNECTOR_ACCOUNT_BIC}' => $paymentData['CRITERION_BILLSAFE_BIC'],
74
+ '{IDENTIFICATION_SHORTID}' => $paymentData['CRITERION_BILLSAFE_REFERENCE'],
75
+ '{PERIOD}' => $paymentData['CRITERION_BILLSAFE_PERIOD']
76
+ );
77
+
78
+ $loadSnippet = strtr($loadSnippet, $replace);
79
+
80
+
81
+ return $loadSnippet;
82
+ }
83
+
84
+ /**
85
+ * @inheritdoc
86
+ */
87
+ public function processingTransaction($order, $data, $message='')
88
+ {
89
+ $message = 'BillSafe Id: ' . $data['CRITERION_BILLSAFE_REFERENCE'];
90
+ parent::processingTransaction($order, $data, $message);
91
+ }
92
+
93
+ /**
94
+ * Prepare basket items for BillSafe
95
+ *
96
+ * @param $order Mage_Sales_Model_Order magento order object
97
+ *
98
+ * @return array basket details for heidelpay billSafe api call
99
+ */
100
+ public function getBasket($order)
101
+ {
102
+ $parameters =array();
103
+ $items = $order->getAllVisibleItems();
104
+ $itemCount = 0;
105
+
106
+ if ($items) {
107
+ foreach ($items as $item) {
108
+ $itemCount++;
109
+ $prefix = 'CRITERION.POS_' . sprintf('%02d', $itemCount);
110
+
111
+ /** @var $item Mage_Sales_Model_Order_Item */
112
+ $quantity = (int)$item->getQtyOrdered();
113
+ $parameters[$prefix . '.POSITION'] = $itemCount;
114
+ $parameters[$prefix . '.QUANTITY'] = $quantity;
115
+ $parameters[$prefix . '.UNIT'] = 'Stk.'; // Liter oder so
116
+ $parameters[$prefix . '.AMOUNT_UNIT_GROSS'] =
117
+ floor(bcmul($item->getPriceInclTax(), 100, 10));
118
+ $parameters[$prefix . '.AMOUNT_GROSS'] =
119
+ floor(bcmul($item->getPriceInclTax() * $quantity, 100, 10));
120
+
121
+
122
+ $parameters[$prefix . '.TEXT'] = $item->getName();
123
+ $parameters[$prefix . '.COL1'] = 'SKU:' . $item->getSku();
124
+ $parameters[$prefix . '.ARTICLE_NUMBER'] = $item->getProductId();
125
+ $parameters[$prefix . '.PERCENT_VAT'] = sprintf('%1.2f', $item->getTaxPercent());
126
+ $parameters[$prefix . '.ARTICLE_TYPE'] = 'goods';
127
+ }
128
+ }
129
+
130
+ if ($this->_basketApiHelper->getShippingNetPrice($order) > 0) {
131
+ $itemCount++;
132
+ $prefix = 'CRITERION.POS_' . sprintf('%02d', $itemCount);
133
+ $parameters[$prefix . '.POSITION'] = $itemCount;
134
+ $parameters[$prefix . '.QUANTITY'] = '1';
135
+ $parameters[$prefix . '.UNIT'] = 'Stk.'; // Liter oder so
136
+ $parameters[$prefix . '.AMOUNT_UNIT_GROSS'] = floor(
137
+ bcmul(
138
+ (($order->getShippingAmount() - $order->getShippingRefunded())
139
+ * (1 + $this->_basketApiHelper->getShippingTaxPercent($order) / 100)),
140
+ 100, 10
141
+ )
142
+ );
143
+ $parameters[$prefix . '.AMOUNT_GROSS'] = floor(
144
+ bcmul(
145
+ (($order->getShippingAmount() - $order->getShippingRefunded())
146
+ * (1 + $this->_basketApiHelper->getShippingTaxPercent($order) / 100)),
147
+ 100, 10
148
+ )
149
+ );
150
+
151
+ $parameters[$prefix . '.TEXT'] = 'Shipping';
152
+ $parameters[$prefix . '.ARTICLE_NUMBER'] = '0';
153
+ $parameters[$prefix . '.PERCENT_VAT'] = $this->_basketApiHelper->getShippingTaxPercent($order);
154
+ $parameters[$prefix . '.ARTICLE_TYPE'] = 'shipment';
155
+ }
156
+
157
+ if ($order->getDiscountAmount() < 0) {
158
+ $itemCount++;
159
+ $prefix = 'CRITERION.POS_' . sprintf('%02d', $itemCount);
160
+ $parameters[$prefix . '.POSITION'] = $itemCount;
161
+ $parameters[$prefix . '.QUANTITY'] = '1';
162
+ $parameters[$prefix . '.UNIT'] = 'Stk.'; // Liter oder so
163
+ $parameters[$prefix . '.AMOUNT_UNIT_GROSS'] = floor(bcmul($order->getDiscountAmount(), 100, 10));
164
+ $parameters[$prefix . '.AMOUNT_GROSS'] = floor(bcmul($order->getDiscountAmount(), 100, 10));
165
+
166
+ $parameters[$prefix . '.TEXT'] = 'Voucher';
167
+ $parameters[$prefix . '.ARTICLE_NUMBER'] = '0';
168
+ $parameters[$prefix . '.PERCENT_VAT'] = '0.00';
169
+ $parameters[$prefix . '.ARTICLE_TYPE'] = 'voucher';
170
+ }
171
+
172
+ return $parameters;
173
+ }
174
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdcc.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Credit card payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdcc extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * @var string payment code of the method
21
+ */
22
+ protected $_code = 'hcdcc';
23
+ /**
24
+ * @var bool this payment method is able to capture
25
+ */
26
+ protected $_canCapture = true;
27
+ /**
28
+ * @var bool this payment method is capable of partly capture
29
+ */
30
+ protected $_canCapturePartial = true;
31
+
32
+ /**
33
+ * @inheritdoc
34
+ */
35
+ public function isRecognition()
36
+ {
37
+ $path = "payment/".$this->_code."/";
38
+ $storeId = Mage::app()->getStore()->getId();
39
+ return Mage::getStoreConfig($path.'recognition', $storeId);
40
+ }
41
+
42
+ /**
43
+ * @inheritdoc
44
+ */
45
+ public function activeRedirect()
46
+ {
47
+ $recognition = $this->isRecognition();
48
+ if ($recognition > 0) {
49
+ return true;
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * @inheritdoc
57
+ */
58
+ protected $_formBlockType = 'hcd/form_creditcard';
59
+
60
+ /**
61
+ * @inheritdoc
62
+ */
63
+ public function getFormBlockType()
64
+ {
65
+ return $this->_formBlockType;
66
+ }
67
+
68
+ /**
69
+ * @inheritdoc
70
+ */
71
+ public function chargeBack($order, $message = "")
72
+ {
73
+ $message = Mage::helper('hcd')->__('chargeback');
74
+ return parent::chargeBack($order, $message);
75
+ }
76
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcddc.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Debit card payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcddc extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcddc';
20
+ protected $_canCapture = true;
21
+ protected $_canCapturePartial = true;
22
+
23
+ /**
24
+ * @inheritdoc
25
+ */
26
+ public function isRecognition()
27
+ {
28
+ $path = "payment/".$this->_code."/";
29
+ $storeId = Mage::app()->getStore()->getId();
30
+ return Mage::getStoreConfig($path.'recognition', $storeId);
31
+ }
32
+
33
+ /**
34
+ * @inheritdoc
35
+ */
36
+ public function activeRedirect()
37
+ {
38
+ $recognation = $this->isRecognition();
39
+ if ($recognation > 0) {
40
+ return true;
41
+ }
42
+
43
+ return false;
44
+ }
45
+
46
+ /**
47
+ * @inheritdoc
48
+ */
49
+ protected $_formBlockType = 'hcd/form_creditcard';
50
+
51
+ /**
52
+ * @inheritdoc
53
+ */
54
+ public function getFormBlockType()
55
+ {
56
+ return $this->_formBlockType;
57
+ }
58
+
59
+ /**
60
+ * @inheritdoc
61
+ */
62
+ public function chargeBack($order, $message = "")
63
+ {
64
+ $message = Mage::helper('hcd')->__('chargeback');
65
+ return parent::chargeBack($order, $message);
66
+ }
67
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcddd.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcddd extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcddd';
20
+ protected $_canCapture = true;
21
+ protected $_canCapturePartial = true;
22
+ protected $_formBlockType = 'hcd/form_debit';
23
+ /**
24
+ * over write existing info block
25
+ *
26
+ * @var string
27
+ */
28
+ protected $_infoBlockType = 'hcd/info_directDebit';
29
+
30
+ public function getFormBlockType()
31
+ {
32
+ return $this->_formBlockType;
33
+ }
34
+
35
+ public function validate()
36
+ {
37
+ parent::validate();
38
+ $payment = array();
39
+ $params = array();
40
+ $payment = Mage::app()->getRequest()->getPOST('payment');
41
+
42
+
43
+ if (isset($payment['method']) and $payment['method'] == $this->_code) {
44
+ if (empty($payment[$this->_code.'_holder'])) {
45
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
46
+ }
47
+
48
+ if (empty($payment[$this->_code.'_iban'])) {
49
+ Mage::throwException($this->_getHelper()->__('Please specify a iban or account'));
50
+ }
51
+
52
+ $params['ACCOUNT.HOLDER'] = $payment[$this->_code.'_holder'];
53
+
54
+ $params['ACCOUNT.IBAN'] = $payment[$this->_code.'_iban'];
55
+
56
+
57
+ $this->saveCustomerData($params);
58
+ }
59
+
60
+ return $this;
61
+ }
62
+
63
+ public function showPaymentInfo($paymentData)
64
+ {
65
+ $loadSnippet = $this->_getHelper()->__("Direct Debit Info Text");
66
+
67
+ $repl = array(
68
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
69
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
70
+ '{Iban}' => $paymentData['ACCOUNT_IBAN'],
71
+ '{Ident}' => $paymentData['ACCOUNT_IDENTIFICATION'],
72
+ '{CreditorId}' => $paymentData['IDENTIFICATION_CREDITOR_ID'],
73
+ );
74
+
75
+ return $loadSnippet= strtr($loadSnippet, $repl);
76
+ }
77
+
78
+ /**
79
+ * @inheritdoc
80
+ */
81
+ public function chargeBack($order, $message = "")
82
+ {
83
+ $message = Mage::helper('hcd')->__('debit failed');
84
+ return parent::chargeBack($order, $message);
85
+ }
86
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdeps.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * EPS payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdeps extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdeps';
20
+ protected $_canRefund = false;
21
+ protected $_canRefundInvoicePartial = false;
22
+
23
+ protected $_formBlockType = 'hcd/form_eps';
24
+
25
+ public function getFormBlockType()
26
+ {
27
+ return $this->_formBlockType;
28
+ }
29
+
30
+ public function validate()
31
+ {
32
+ parent::validate();
33
+ $payment = array();
34
+ $params = array();
35
+ $payment = Mage::app()->getRequest()->getPOST('payment');
36
+
37
+ if ($payment['method'] == $this->_code) {
38
+ if (empty($payment[$this->_code.'_holder'])) {
39
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
40
+ }
41
+
42
+ $params['ACCOUNT.HOLDER'] = $payment[$this->_code.'_holder'];
43
+
44
+ $params['ACCOUNT.BANKNAME'] = $payment[$this->_code.'_bank'];
45
+ $params['ACCOUNT.COUNTRY'] = $this->getQuote()->getBillingAddress()->getCountry();
46
+
47
+
48
+ $this->saveCustomerData($params);
49
+
50
+ return $this;
51
+ }
52
+
53
+ return $this;
54
+ }
55
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdgp.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Giropay payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdgp extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdgp';
20
+ protected $_canRefund = true;
21
+ protected $_canRefundInvoicePartial = true;
22
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdide.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ideal payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdide extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * unique internal payment method identifier
21
+ *
22
+ * @var string [a-z0-9_]
23
+ **/
24
+ protected $_code = 'hcdide';
25
+ protected $_canRefund = false;
26
+ protected $_canRefundInvoicePartial = false;
27
+
28
+ protected $_formBlockType = 'hcd/form_ideal';
29
+
30
+ public function getFormBlockType()
31
+ {
32
+ return $this->_formBlockType;
33
+ }
34
+
35
+ public function validate()
36
+ {
37
+ parent::validate();
38
+ $payment = array();
39
+ $params = array();
40
+ $payment = Mage::app()->getRequest()->getPOST('payment');
41
+
42
+ if ($payment['method'] == $this->_code) {
43
+ if (empty($payment[$this->_code.'_holder'])) {
44
+ Mage::throwException($this->_getHelper()->__('Please specify a account holder'));
45
+ }
46
+
47
+ $params['ACCOUNT.HOLDER'] = $payment[$this->_code.'_holder'];
48
+
49
+ $params['ACCOUNT.BANKNAME'] = $payment[$this->_code.'_bank'];
50
+ $params['ACCOUNT.COUNTRY'] = $this->getQuote()->getBillingAddress()->getCountry();
51
+
52
+
53
+ $this->saveCustomerData($params);
54
+
55
+ return $this;
56
+ }
57
+
58
+ return $this;
59
+ }
60
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdiv.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice unsecured payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdiv extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdiv';
20
+
21
+ /**
22
+ * over write existing info block
23
+ *
24
+ * @var string
25
+ */
26
+ protected $_infoBlockType = 'hcd/info_invoice';
27
+
28
+ /**
29
+ * Payment information for invoice mail
30
+ *
31
+ * @param array $paymentData transaction response
32
+ *
33
+ * @return string return payment information text
34
+ */
35
+ public function showPaymentInfo($paymentData)
36
+ {
37
+ $loadSnippet = $this->_getHelper()->__("Invoice Info Text");
38
+
39
+ $repl = array(
40
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
41
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
42
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CONNECTOR_ACCOUNT_HOLDER'],
43
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CONNECTOR_ACCOUNT_IBAN'],
44
+ '{CONNECTOR_ACCOUNT_BIC}' => $paymentData['CONNECTOR_ACCOUNT_BIC'],
45
+ '{IDENTIFICATION_SHORTID}' => $paymentData['IDENTIFICATION_SHORTID'],
46
+ );
47
+
48
+ return strtr($loadSnippet, $repl);
49
+ }
50
+
51
+ /**
52
+ * @inheritdoc
53
+ */
54
+ public function processingTransaction($order, $data, $message='')
55
+ {
56
+ $message = Mage::helper('hcd')->__('received amount ')
57
+ . $data['PRESENTATION_AMOUNT'] . ' ' . $data['PRESENTATION_CURRENCY'] . ' ' . $message;
58
+ parent::processingTransaction($order, $data, $message);
59
+ }
60
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdmk.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagirKart payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ *
16
+ * @deprecated This payment method is not longer available
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Payment_Hcdmk extends HeidelpayCD_Edition_Model_Payment_Abstract
20
+ {
21
+ protected $_code = 'hcdmk';
22
+ protected $_canRefund = false;
23
+ protected $_canRefundInvoicePartial = false;
24
+
25
+ public function isAvailable($quote=null)
26
+ {
27
+ $currencyCode=$this->getQuote()->getQuoteCurrencyCode();
28
+ if (!empty($currencyCode) && $currencyCode != 'TRY') {
29
+ return false;
30
+ }
31
+
32
+ return parent::isAvailable($quote);
33
+ }
34
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdmpa.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdmpa extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * unique internal payment method identifier
21
+ *
22
+ * @var string [a-z0-9_]
23
+ **/
24
+ protected $_code = 'hcdmpa';
25
+ protected $_canCapture = true;
26
+ protected $_canCapturePartial = true;
27
+ protected $_canRefund = true;
28
+ protected $_canRefundInvoicePartial = true;
29
+ protected $_canBasketApi = true;
30
+
31
+ protected $_formBlockType = 'hcd/form_masterpass';
32
+ protected $_infoBlockType = 'hcd/info_masterpass';
33
+
34
+ /**
35
+ public function isAvailable($quote=null) {
36
+ return true;
37
+ }
38
+ * @param mixed $code
39
+ * @param mixed $customerId
40
+ * @param mixed $storeId
41
+ */
42
+ public function getPaymentData()
43
+ {
44
+ $session = Mage::getSingleton('checkout/session');
45
+
46
+ if ($session->getHcdWallet() !== false) {
47
+ $hpdata = $session->getHcdWallet();
48
+
49
+ if ($hpdata['code'] != $this->_code) {
50
+ return '';
51
+ }
52
+
53
+ $html = (array_key_exists('mail', $hpdata)) ? $hpdata['mail'].'<br />' : '';
54
+ $html .= (array_key_exists('brand', $hpdata)) ? $this->_getHelper()->__($hpdata['brand']).' ' : '';
55
+ $html .= (array_key_exists('number', $hpdata)) ? $hpdata['number'].'<br/>' : '';
56
+ $html .= (array_key_exists('expiryMonth', $hpdata))
57
+ ? $this->_getHelper()->__('Expires').' '.$hpdata['expiryMonth'].'/' : '';
58
+ $html .= (array_key_exists('expiryYear', $hpdata)) ? $hpdata['expiryYear'] : '';
59
+
60
+ return $html;
61
+ }
62
+ }
63
+
64
+ /*
65
+ * MasterPass need shipping adress instead of billing (REV20150707 FullCheckout Adressen)
66
+ */
67
+ public function getUser($order, $isReg=false)
68
+ {
69
+ $user = array();
70
+
71
+ $user = parent::getUser($order, $isReg);
72
+ $adress = ($order->getShippingAddress() == false)
73
+ ? $order->getBillingAddress() : $order->getShippingAddress();
74
+ $email = ($adress->getEmail()) ? $adress->getEmail() : $order->getCustomerEmail();
75
+
76
+
77
+ $user['IDENTIFICATION.SHOPPERID'] = $adress->getCustomerId();
78
+ if ($adress->getCompany() == true) {
79
+ $user['NAME.COMPANY'] = trim($adress->getCompany());
80
+ }
81
+
82
+ $user['NAME.GIVEN'] = trim($adress->getFirstname());
83
+ $user['NAME.FAMILY'] = trim($adress->getLastname());
84
+ $user['ADDRESS.STREET'] = $adress->getStreet1()." ".$adress->getStreet2();
85
+ $user['ADDRESS.ZIP'] = $adress->getPostcode();
86
+ $user['ADDRESS.CITY'] = $adress->getCity();
87
+ $user['ADDRESS.COUNTRY'] = $adress->getCountry();
88
+ $user['CONTACT.EMAIL'] = $email;
89
+
90
+ return $user;
91
+ }
92
+
93
+ public function showPaymentInfo($paymentData)
94
+ {
95
+ $lang = Mage::app()->getLocale()->getLocaleCode();
96
+ switch ($lang) {
97
+ case 'de_DE':
98
+ case 'de_AT':
99
+ case 'de_CH':
100
+ $urlLang = 'de/DE';
101
+ break;
102
+ case 'fr_FR':
103
+ $urlLang = 'fr/FR';
104
+ break;
105
+ case 'en_GB':
106
+ case 'en_US':
107
+ default:
108
+ $urlLang = 'en/US';
109
+ break;
110
+ }
111
+
112
+ $html = '<center><button type="button" title="MasterPass"
113
+ class="btn-hcdmpa-payment-data" style="position: static"
114
+ onclick="window.open(\'https://www.mastercard.com/mc_us/wallet/learnmore/'.$urlLang.'\')">
115
+ </button>
116
+ <div sytle="margin-top: 10px !important;">';
117
+
118
+ $html .= (array_key_exists('CONTACT_EMAIL', $paymentData))
119
+ ? $paymentData['CONTACT_EMAIL'].'<br />' : '';
120
+ $html .= (array_key_exists('ACCOUNT_BRAND', $paymentData))
121
+ ? $this->_getHelper()->__($paymentData['ACCOUNT_BRAND']).' ' : '';
122
+ $html .= (array_key_exists('ACCOUNT_NUMBER', $paymentData))
123
+ ? $paymentData['ACCOUNT_NUMBER'].'<br/>' : '';
124
+ $html .= (array_key_exists('ACCOUNT_EXPIRY_MONTH', $paymentData))
125
+ ? $this->_getHelper()->__('Expires').' '.$paymentData['ACCOUNT_EXPIRY_MONTH'].'/' : '';
126
+ $html .= (array_key_exists('ACCOUNT_EXPIRY_YEAR', $paymentData))
127
+ ? $paymentData['ACCOUNT_EXPIRY_YEAR'] : '';
128
+
129
+ $html .= '</div></center>';
130
+
131
+ $this->getCheckout()->setHcdPaymentInfo($html);
132
+ }
133
+
134
+ /**
135
+ * @inheritdoc
136
+ */
137
+ public function chargeBack($order, $message = "")
138
+ {
139
+ $message = Mage::helper('hcd')->__('chargeback');
140
+ return parent::chargeBack($order, $message);
141
+ }
142
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdpal.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdpal extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ /**
20
+ * unique internal payment method identifier
21
+ *
22
+ * @var string [a-z0-9_]
23
+ **/
24
+ protected $_code = 'hcdpal';
25
+ protected $_canCapture = true;
26
+ protected $_canCapturePartial = true;
27
+
28
+ /*
29
+ * PayPal seller protection, need shipping adress instead of billing (PAYPAL REV 20141215)
30
+ */
31
+ public function getUser($order, $isReg=false)
32
+ {
33
+ $user = array();
34
+
35
+ $user = parent::getUser($order, $isReg);
36
+ $adress = ($order->getShippingAddress() == false)
37
+ ? $order->getBillingAddress() : $order->getShippingAddress();
38
+ $email = ($adress->getEmail()) ? $adress->getEmail() : $order->getCustomerEmail();
39
+
40
+
41
+ $user['IDENTIFICATION.SHOPPERID'] = $adress->getCustomerId();
42
+ if ($adress->getCompany() == true) {
43
+ $user['NAME.COMPANY'] = trim($adress->getCompany());
44
+ }
45
+
46
+ $user['NAME.GIVEN'] = trim($adress->getFirstname());
47
+ $user['NAME.FAMILY'] = trim($adress->getLastname());
48
+ $user['ADDRESS.STREET'] = $adress->getStreet1()." ".$adress->getStreet2();
49
+ $user['ADDRESS.ZIP'] = $adress->getPostcode();
50
+ $user['ADDRESS.CITY'] = $adress->getCity();
51
+ $user['ADDRESS.COUNTRY'] = $adress->getCountry();
52
+ $user['CONTACT.EMAIL'] = $email;
53
+
54
+ return $user;
55
+ }
56
+
57
+ /**
58
+ * @inheritdoc
59
+ */
60
+ public function chargeBack($order, $message = "")
61
+ {
62
+ $message = Mage::helper('hcd')->__('chargeback');
63
+ return parent::chargeBack($order, $message);
64
+ }
65
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdpf.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Postfinance payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdpf extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdpf';
20
+ protected $_canRefund = false;
21
+ protected $_canRefundInvoicePartial = false;
22
+ protected $_formBlockType = 'hcd/form_postfinance';
23
+
24
+ public function getFormBlockType()
25
+ {
26
+ return $this->_formBlockType;
27
+ }
28
+
29
+ public function isAvailable($quote=null)
30
+ {
31
+ $currencyCode=$this->getQuote()->getQuoteCurrencyCode();
32
+ if (!empty($currencyCode) && $currencyCode != 'CHF') {
33
+ return false;
34
+ }
35
+
36
+ return parent::isAvailable($quote);
37
+ }
38
+
39
+ public function validate()
40
+ {
41
+ parent::validate();
42
+ $payment = Mage::app()->getRequest()->getPOST('payment');
43
+
44
+
45
+ if (empty($payment[$this->_code.'_pf'])) {
46
+ $errorCode = 'invalid_data';
47
+ $errorMsg = $this->_getHelper()->__('No Postfinance method selected');
48
+ Mage::throwException($errorMsg);
49
+ return $this;
50
+ }
51
+
52
+ $this->saveCustomerData(array('ACCOUNT.BRAND' => $payment[$this->_code.'_pf']));
53
+
54
+ return $this;
55
+ }
56
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdpp.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Prepayment payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Payment_Hcdpp extends HeidelpayCD_Edition_Model_Payment_Abstract
18
+ {
19
+ protected $_code = 'hcdpp';
20
+
21
+ protected $_infoBlockType = 'hcd/info_prepayment';
22
+
23
+ public function showPaymentInfo($paymentData)
24
+ {
25
+ $loadSnippet = $this->_getHelper()->__("Prepayment Info Text");
26
+
27
+ $repl = array(
28
+ '{AMOUNT}' => $paymentData['CLEARING_AMOUNT'],
29
+ '{CURRENCY}' => $paymentData['CLEARING_CURRENCY'],
30
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $paymentData['CONNECTOR_ACCOUNT_HOLDER'],
31
+ '{CONNECTOR_ACCOUNT_IBAN}' => $paymentData['CONNECTOR_ACCOUNT_IBAN'],
32
+ '{IDENTIFICATION_SHORTID}' => $paymentData['IDENTIFICATION_SHORTID'],
33
+ );
34
+
35
+ $loadSnippet= strtr($loadSnippet, $repl);
36
+
37
+ return $loadSnippet;
38
+ }
39
+
40
+ /**
41
+ * Handle transaction with means pending
42
+ *
43
+ * @param $order Mage_Sales_Model_Order
44
+ * @param $data HeidelpayCD_Edition_Model_Transaction
45
+ * @param $message string order history message
46
+ *
47
+ * @return Mage_Sales_Model_Order
48
+ */
49
+ public function pendingTransaction($order, $data, $message = '')
50
+ {
51
+ $message = 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] . ' ' . $message;
52
+
53
+ $order->getPayment()
54
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
55
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
56
+ ->setIsTransactionClosed(false);
57
+
58
+ $invoice = $order->prepareInvoice();
59
+ $invoice->register();
60
+ $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_OPEN);
61
+ $order->setIsInProcess(true);
62
+ $invoice->setIsPaid(false);
63
+ $order->addStatusHistoryComment(
64
+ Mage::helper('hcd')->__('Automatically invoiced by Heidelpay.'),
65
+ false
66
+ );
67
+ $invoice->save();
68
+ if ($this->_invoiceOrderEmail) {
69
+ $code = $order->getPayment()->getMethodInstance()->getCode();
70
+ if ($code == 'hcdiv' or $code == 'hcdivsec') {
71
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
72
+ $invoiceMailComment = ($info === false) ? '' : '<h3>'
73
+ . $this->_getHelper()->__('payment information') . '</h3><p>' . $info . '</p>';
74
+ }
75
+
76
+ $invoice->sendEmail(true, $invoiceMailComment); // send invoice mail
77
+ }
78
+
79
+
80
+ $transactionSave = Mage::getModel('core/resource_transaction')
81
+ ->addObject($invoice)
82
+ ->addObject($invoice->getOrder());
83
+ $transactionSave->save();
84
+
85
+ $this->log('Set transaction to processed and generate invoice ');
86
+ $order->setState(
87
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
88
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
89
+ $message
90
+ );
91
+
92
+ $order->getPayment()->addTransaction(
93
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
94
+ null,
95
+ true,
96
+ $message
97
+ );
98
+
99
+ return $order;
100
+ }
101
+
102
+ /**
103
+ * Handle transaction with means processing
104
+ *
105
+ * @param $order Mage_Sales_Model_Order
106
+ * @param $data HeidelpayCD_Edition_Model_Transaction
107
+ * @param $message string order history message
108
+ *
109
+ * @return Mage_Sales_Model_Order
110
+ */
111
+ public function processingTransaction($order, $data, $message = '')
112
+ {
113
+
114
+ /** @var $paymentHelper HeidelpayCD_Edition_Helper_Payment */
115
+ $paymentHelper = Mage::helper('hcd/payment');
116
+
117
+
118
+ $message = ($message === '') ? 'Heidelpay ShortID: ' . $data['IDENTIFICATION_SHORTID'] : $message;
119
+ $totallyPaid = false;
120
+
121
+ $order->getPayment()
122
+ ->setTransactionId($data['IDENTIFICATION_UNIQUEID'])
123
+ ->setParentTransactionId($order->getPayment()->getLastTransId())
124
+ ->setIsTransactionClosed(true);
125
+
126
+ if ($paymentHelper->format($order->getGrandTotal()) == $data['PRESENTATION_AMOUNT'] and
127
+ $order->getOrderCurrencyCode() == $data['PRESENTATION_CURRENCY']
128
+ ) {
129
+ $order->setState(
130
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(false),
131
+ $order->getPayment()->getMethodInstance()->getStatusSuccess(true),
132
+ $message
133
+ );
134
+ $totallyPaid = true;
135
+ } else {
136
+ // in case rc is ack and amount is to low or currency miss match
137
+
138
+ $order->setState(
139
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(false),
140
+ $order->getPayment()->getMethodInstance()->getStatusPartlyPaid(true),
141
+ $message
142
+ );
143
+ }
144
+
145
+ // Set invoice to paid when the total amount matches
146
+ if ($order->hasInvoices() and $totallyPaid) {
147
+
148
+ /** @var $invoice Mage_Sales_Model_Order_Invoice */
149
+ foreach ($order->getInvoiceCollection() as $invoice) {
150
+ $this->log('Set invoice ' . (string)$invoice->getIncrementId() . ' to paid.');
151
+ $invoice
152
+ ->capture()
153
+ ->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID)
154
+ ->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE)
155
+ ->setIsPaid(true)
156
+ // @codingStandardsIgnoreLine use of save in a loop
157
+ ->save();
158
+
159
+ $transactionSave = Mage::getModel('core/resource_transaction')
160
+ ->addObject($invoice)
161
+ ->addObject($invoice->getOrder());
162
+ // @codingStandardsIgnoreLine use of save in a loop
163
+ $transactionSave->save();
164
+ }
165
+ }
166
+
167
+ // Set total paid and invoice to the connector amount
168
+ $order->setTotalInvoiced($data['PRESENTATION_AMOUNT']);
169
+ $order->setTotalPaid($data['PRESENTATION_AMOUNT']);
170
+
171
+
172
+ $order->getPayment()->addTransaction(
173
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
174
+ null,
175
+ true,
176
+ $message
177
+ );
178
+
179
+ $order->setIsInProcess(true);
180
+
181
+ return $order;
182
+ }
183
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdsu.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sofort payment method
4
+ *
5
+ * Also called "Sofortüberweisung" in germany.
6
+ *
7
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
8
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
9
+ *
10
+ * @link https://dev.heidelpay.de/magento
11
+ *
12
+ * @author Jens Richter
13
+ *
14
+ * @package Heidelpay
15
+ * @subpackage Magento
16
+ * @category Magento
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Payment_Hcdsu extends HeidelpayCD_Edition_Model_Payment_Abstract
20
+ {
21
+ protected $_code = 'hcdsu';
22
+ protected $_canRefund = true;
23
+ protected $_canRefundInvoicePartial = true;
24
+
25
+ /**
26
+ * @inheritdoc
27
+ */
28
+ public function chargeBack($order, $message = "")
29
+ {
30
+ $message = Mage::helper('hcd')->__('chargeback');
31
+ return parent::chargeBack($order, $message);
32
+ }
33
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Payment/Hcdyt.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Yapital payment method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ *
16
+ * @deprecated This payment method is not longer available
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Payment_Hcdyt extends HeidelpayCD_Edition_Model_Payment_Abstract
20
+ {
21
+ protected $_code = 'hcdyt';
22
+ protected $_canRefund = false;
23
+ protected $_canRefundInvoicePartial = false;
24
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Resource/Encryption.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Heidelpay encryption model
4
+ *
5
+ * replace the magento md5 hashing with sha256
6
+ *
7
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
8
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
9
+ *
10
+ * @link https://dev.heidelpay.de/magento
11
+ *
12
+ * @author Jens Richter
13
+ *
14
+ * @package Heidelpay
15
+ * @subpackage Magento
16
+ * @category Magento
17
+ */
18
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
19
+ class HeidelpayCD_Edition_Model_Resource_Encryption extends Mage_Core_Model_Encryption
20
+ {
21
+ public function hash($data)
22
+ {
23
+ return hash('sha256', $data);
24
+ }
25
+
26
+ public function getHash($string, $salt = false)
27
+ {
28
+ if ($salt === false) {
29
+ $salt = (string)Mage::getConfig()->getNode('global/crypt/key');
30
+ }
31
+
32
+ return $this->hash($salt.(string)$string);
33
+ }
34
+
35
+ public function validateHash($string, $hash)
36
+ {
37
+ return $this->getHash((string)$string) === $hash;
38
+ }
39
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Resource/Setup.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * heidelpay resource model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Modul_Resource_Setup extends Mage_Core_Model_Resource_Setup
18
+ {
19
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/System/Config/Source/Bookingmode.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Booking mode configuration model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine
17
+ class HeidelpayCD_Edition_Model_System_Config_Source_Bookingmode
18
+ {
19
+ /**
20
+ * returns the available booking modes for backend configuration
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ array('value'=>'DB', 'label'=>Mage::helper('hcd')->__('Direct Booking')),
28
+ array('value'=>'PA', 'label'=>Mage::helper('hcd')->__('Preauthorisation'))
29
+ );
30
+ }
31
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/System/Config/Source/Recognition.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Recognition configuration model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine
17
+ class HeidelpayCD_Edition_Model_System_Config_Source_Recognition
18
+ {
19
+ /**
20
+ * Returns the recognition configuration option for the backend
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ array('value'=>'0', 'label'=>Mage::helper('hcd')->__('no recognition')),
28
+ array('value'=>'1', 'label'=>Mage::helper('hcd')->__('only if shippping adress is unchanged')),
29
+ array('value'=>'2', 'label'=>Mage::helper('hcd')->__('always'))
30
+ );
31
+ }
32
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/System/Config/Source/Returnurl.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Return url configuration model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine
17
+ class HeidelpayCD_Edition_Model_System_Config_Source_Returnurl
18
+ {
19
+ /**
20
+ * Return the configuration option for the return urk in case of a payment error
21
+ *
22
+ * @return array currently you can choose between basket and checkout page
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ array('value'=>'basket', 'label'=>Mage::helper('hcd')->__('Basket')),
28
+ array('value'=>'onepage', 'label'=>Mage::helper('hcd')->__('Onepage Checkout')),
29
+ );
30
+ }
31
+ }
app/code/community/HeidelpayCD/Edition/Edition/Model/Transaction.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Transaction model
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_Model_Transaction extends Mage_Core_Model_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ $this->_init('hcd/transaction');
22
+ parent::_construct();
23
+ }
24
+
25
+ public function saveTransactionData($data, $source='shop')
26
+ {
27
+ $paymentCode = Mage::helper('hcd/payment')->splitPaymentCode($data['PAYMENT_CODE']);
28
+
29
+ $this->setPaymentMethode($paymentCode[0]);
30
+ $this->setPaymentType($paymentCode[1]);
31
+ $this->setTransactionid($data['IDENTIFICATION_TRANSACTIONID']);
32
+ $this->setUniqeid($data['IDENTIFICATION_UNIQUEID']);
33
+ $this->setResult($data['PROCESSING_RESULT']);
34
+ $this->setShortid($data['IDENTIFICATION_SHORTID']);
35
+ $this->setStatuscode($data['PROCESSING_STATUS_CODE']);
36
+ $this->setReturn($data['PROCESSING_RETURN']);
37
+ $this->setReturncode($data['PROCESSING_RETURN_CODE']);
38
+ $this->setJsonresponse(Mage::getModel('hcd/resource_encryption')->encrypt(json_encode($data)));
39
+ // @codingStandardsIgnoreLine should be refactored - issue #2
40
+ $this->setDatetime(date('Y-m-d H:i:s'));
41
+ $this->setSource($source);
42
+ return $this->save();
43
+ }
44
+
45
+ public function loadTransactionDataByX($filter=array(), $sortby=false)
46
+ {
47
+ $data = array();
48
+ $trans = $this->getCollection();
49
+
50
+ foreach ($filter as $k => $v) {
51
+ $trans->addFieldToFilter($k, $v);
52
+ }
53
+
54
+ if ($sortby) {
55
+ $trans->getSelect()->order($sortby);
56
+ }
57
+
58
+ $trans->load();
59
+
60
+
61
+
62
+ $data = $trans->getData();
63
+ $temp = array();
64
+ foreach ($data as $k => $v) {
65
+ $temp[] = json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[$k]['jsonresponse']), true);
66
+ }
67
+
68
+ return $temp;
69
+ }
70
+
71
+ public function loadLastTransactionDataByTransactionnr($transid)
72
+ {
73
+ $data = array();
74
+ $trans = $this->getCollection();
75
+ $trans->addFieldToFilter('transactionid', $transid);
76
+ $trans->getSelect()->order('id DESC');
77
+ // @codingStandardsIgnoreLine
78
+ $trans->getSelect()->limit(1);
79
+ $trans->load();
80
+
81
+
82
+ $data = $trans->getData();
83
+
84
+ // @codingStandardsIgnoreLine seem to be a bug in marketplace ready
85
+ if (is_array($data)) {
86
+ return json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['jsonresponse']), true);
87
+ }
88
+
89
+ return false;
90
+ }
91
+
92
+ public function loadLastTransactionDataByUniqeId($id)
93
+ {
94
+ $data = array();
95
+ $trans = $this->getCollection();
96
+ $trans->addFieldToFilter('uniqeid', $id);
97
+ // @codingStandardsIgnoreLine should be refactored - issue #6
98
+ $trans->getSelect()->limit(1);
99
+ $trans->load();
100
+
101
+
102
+ $data = $trans->getData();
103
+ if (isset($data[0])) {
104
+ return json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['jsonresponse']), true);
105
+ } else {
106
+ return false;
107
+ }
108
+ }
109
+
110
+ public function getOneTransactionByMethode($transid, $methode)
111
+ {
112
+ $data = false;
113
+ $trans = $this->getCollection();
114
+ $trans->addFieldToFilter('transactionid', $transid)
115
+ ->addFieldToFilter('Payment_Type', $methode);
116
+ $trans->getSelect()->order('id DESC');
117
+ // @codingStandardsIgnoreLine should be refactored - issue #6
118
+ $trans->getSelect()->limit(1);
119
+ $trans->load();
120
+
121
+
122
+ $data = $trans->getData();
123
+
124
+ if (isset($data[0])) {
125
+ return json_decode(Mage::getModel('hcd/resource_encryption')->decrypt($data[0]['jsonresponse']), true);
126
+ } else {
127
+ return false;
128
+ }
129
+ }
130
+ }
app/code/community/HeidelpayCD/Edition/Edition/controllers/CheckoutController.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout controller
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+
17
+ $modulePath = Mage::getModuleDir('', 'Mage_Checkout');
18
+ require_once($modulePath."/controllers/OnepageController.php");
19
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
20
+ class HeidelpayCD_Edition_CheckoutController extends Mage_Checkout_OnepageController
21
+ {
22
+ public function indexAction()
23
+ {
24
+ $session = Mage::getSingleton('checkout/session');
25
+ $checkout = $this->getOnepage();
26
+ $quote = $session->getQuote();
27
+
28
+ if (!$quote->hasItems() || $quote->getHasError()) {
29
+ $this->_redirect('checkout/cart');
30
+ return;
31
+ }
32
+
33
+
34
+ $data = false;
35
+ $this->loadLayout();
36
+ $this->getLayout()->getBlock('head')->setTitle($this->__('MasterPass Checkout'));
37
+
38
+ $session->setCurrency($quote->getGlobalCurrencyCode());
39
+ $session->setTotalamount($quote->getGrandTotal());
40
+
41
+ $data = Mage::getModel('hcd/transaction')
42
+ ->loadLastTransactionDataByTransactionnr(Mage::getSingleton('checkout/session')->getQuoteId());
43
+
44
+ Mage::getSingleton('checkout/session')->setCartWasUpdated(false);
45
+ Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure' => true)));
46
+ $this->getOnepage()->initCheckout();
47
+
48
+
49
+ // @codingStandardsIgnoreLine should be refactored - issue #4
50
+ $this->log('Data from wallet '.print_r($data, 1));
51
+
52
+
53
+
54
+ $this->getOnepage()->saveCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_GUEST);
55
+
56
+ $this->getOnepage()->getCheckout()->setStepData('login', 'complete', true);
57
+
58
+ $region = Mage::helper('hcd/payment')->getRegion($data['ADDRESS_COUNTRY'], $data['ADDRESS_STATE']);
59
+
60
+ $billingAddress = array(
61
+ "address_id" => '',
62
+ "firstname" => trim($data['NAME_GIVEN']),
63
+ "lastname" => trim($data['NAME_FAMILY']),
64
+ "company" => '',
65
+ "email" => trim($data['CONTACT_EMAIL']),
66
+ "street" => array(
67
+ "0" => $data['ADDRESS_STREET'],
68
+ "1" => '',
69
+ ),
70
+ "region_id" =>(string) $region,
71
+ "region" => $data['ADDRESS_STATE'],
72
+ "city" => $data['ADDRESS_CITY'],
73
+ "postcode" => $data['ADDRESS_ZIP'],
74
+ "country_id" => $data['ADDRESS_COUNTRY'],
75
+ "telephone" => preg_replace('/[A-z]-/', '', $data['CONTACT_PHONE']),
76
+ "customer_password" =>"",
77
+ "confirm_password" =>"",
78
+ "save_in_address_book" => 1
79
+ );
80
+ // @codingStandardsIgnoreLine should be refactored - issue #4
81
+ $this->log('adress'.print_r($billingAddress, 1));
82
+
83
+ $hpdata = array(
84
+ 'code' => 'hcdmpa',
85
+ 'brand' => (array_key_exists('ACCOUNT_BRAND', $data)) ? $data['ACCOUNT_BRAND'] : false ,
86
+ 'mail' => (array_key_exists('CONTACT_EMAIL', $data)) ? $data['CONTACT_EMAIL'] : false ,
87
+ 'number' => (array_key_exists('ACCOUNT_NUMBER', $data)) ? $data['ACCOUNT_NUMBER'] : false ,
88
+ 'expiryMonth' => (array_key_exists('ACCOUNT_EXPIRY_MONTH', $data))
89
+ ? $data['ACCOUNT_EXPIRY_MONTH'] : false ,
90
+ 'expiryYear' => (array_key_exists('ACCOUNT_EXPIRY_YEAR', $data))
91
+ ? $data['ACCOUNT_EXPIRY_YEAR'] : false ,
92
+ 'referenceId' => (array_key_exists('IDENTIFICATION_UNIQUEID', $data))
93
+ ? $data['IDENTIFICATION_UNIQUEID'] : false ,
94
+ 'adress' => $billingAddress
95
+ );
96
+
97
+ $session->setHcdWallet($hpdata);
98
+
99
+
100
+ $customAddress = Mage::getModel('customer/address');
101
+ $customAddress->setData($billingAddress);
102
+
103
+ $quote->setBillingAddress(
104
+ Mage::getSingleton('sales/quote_address')
105
+ ->importCustomerAddress($customAddress)
106
+ );
107
+
108
+ $quote->setShippingAddress(
109
+ Mage::getSingleton('sales/quote_address')
110
+ ->importCustomerAddress($customAddress)
111
+ );
112
+
113
+ $this->getOnepage()->getQuote()->collectTotals()->save();
114
+
115
+
116
+ $this->getOnepage()->getCheckout()->setStepData('billing', 'complete', true);
117
+ $this->getOnepage()->getCheckout()->setStepData('shipping', 'allow', true);
118
+
119
+ $this->getOnepage()->getCheckout()->setStepData('shipping', 'complete', true);
120
+ $this->getOnepage()->getCheckout()->setStepData('payment', 'allow', true);
121
+ $this->getOnepage()->savePayment(array('method'=>'hcdmpa'));
122
+
123
+
124
+
125
+ $this->renderLayout();
126
+ }
127
+
128
+ public function saveBillingAction()
129
+ {
130
+ if ($this->_expireAjax()) {
131
+ return;
132
+ }
133
+
134
+ if ($this->getRequest()->isPost()) {
135
+ $data = $this->getRequest()->getPost('billing', array());
136
+ $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
137
+
138
+ if (isset($data['email'])) {
139
+ $data['email'] = trim($data['email']);
140
+ }
141
+
142
+ $result = $this->getOnepage()->saveBilling($data, $customerAddressId);
143
+
144
+
145
+ if (!isset($result['error'])) {
146
+ if ($this->getOnepage()->getQuote()->isVirtual()) {
147
+ $result['goto_section'] = 'payment';
148
+ $result['update_section'] = array(
149
+ 'name' => 'payment-method',
150
+ 'html' => $this->_getPaymentMethodsHtml()
151
+ );
152
+ } else {
153
+ $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
154
+
155
+ $result = $this->getOnepage()->saveShipping($wallet['adress'], false);
156
+ $this->getOnepage()->getCheckout()->setStepData('shipping', 'allow', true)
157
+ ->setStepData('shipping', 'complete', true);
158
+
159
+ if (!isset($result['error'])) {
160
+ $result['goto_section'] = 'shipping_method';
161
+ $result['update_section'] = array(
162
+ 'name' => 'shipping-method',
163
+ 'html' => $this->_getShippingMethodsHtml()
164
+ );
165
+ }
166
+ }
167
+ }
168
+
169
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
170
+ }
171
+ }
172
+
173
+ public function savePayment($data)
174
+ {
175
+ try {
176
+ $result = $this->getOnepage()->savePayment($data);
177
+
178
+
179
+ $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
180
+ if (empty($result['error']) && !$redirectUrl) {
181
+ $this->loadLayout('checkout_onepage_review');
182
+ $result['goto_section'] = 'review';
183
+ $result['update_section'] = array(
184
+ 'name' => 'review',
185
+ 'html' => $this->_getReviewHtml()
186
+ );
187
+ }
188
+
189
+ if ($redirectUrl) {
190
+ $result['redirect'] = $redirectUrl;
191
+ }
192
+ } catch (Mage_Payment_Exception $e) {
193
+ if ($e->getFields()) {
194
+ $result['fields'] = $e->getFields();
195
+ }
196
+
197
+ $result['error'] = $e->getMessage();
198
+ } catch (Mage_Core_Exception $e) {
199
+ $result['error'] = $e->getMessage();
200
+ } catch (Exception $e) {
201
+ Mage::logException($e);
202
+ $result['error'] = $this->__('Unable to set Payment Method.');
203
+ }
204
+
205
+ $this->getOnepage()->getCheckout()->setStepData('payment', 'complete', true);
206
+ return $result;
207
+ }
208
+
209
+ public function savePaymentAction()
210
+ {
211
+ if ($this->_expireAjax()) {
212
+ return;
213
+ }
214
+
215
+ $result = $this->savePayment(array('method'=>'hcdmpa'));
216
+
217
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
218
+ }
219
+
220
+ protected function _getPaymentMethodsHtml()
221
+ {
222
+ $layout = $this->getLayout();
223
+ $update = $layout->getUpdate();
224
+ $update->load('hcd_checkout_paymentmethod');
225
+ $layout->generateXml();
226
+ $layout->generateBlocks();
227
+ $output = $layout->getOutput();
228
+ return $output;
229
+ }
230
+
231
+ public function saveShippingMethodAction()
232
+ {
233
+ if ($this->_expireAjax()) {
234
+ return;
235
+ }
236
+
237
+ if ($this->getRequest()->isPost()) {
238
+ $data = $this->getRequest()->getPost('shipping_method', '');
239
+ $result = $this->getOnepage()->saveShippingMethod($data);
240
+ // $result will contain error data if shipping method is empty
241
+ if (!$result) {
242
+ Mage::dispatchEvent(
243
+ 'checkout_controller_onepage_save_shipping_method',
244
+ array(
245
+ 'request' => $this->getRequest(),
246
+ 'quote' => $this->getOnepage()->getQuote())
247
+ );
248
+ $this->getOnepage()->getQuote()->collectTotals();
249
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
250
+
251
+ $result['goto_section'] = 'payment';
252
+ $result['update_section'] = array(
253
+ 'name' => 'payment-method',
254
+ 'html' => $this->_getPaymentMethodsHtml()
255
+ );
256
+ }
257
+
258
+ $this->getOnepage()->getQuote()->collectTotals()->save();
259
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
260
+ }
261
+ }
262
+
263
+ public function progressAction()
264
+ {
265
+ // previous step should never be null. We always start with billing and go forward
266
+ $prevStep = $this->getRequest()->getParam('prevStep', false);
267
+
268
+ if ($this->_expireAjax() || !$prevStep) {
269
+ return null;
270
+ }
271
+
272
+ $layout = $this->getLayout();
273
+ $update = $layout->getUpdate();
274
+ /* Load the block belonging to the current step*/
275
+ $update->load('hcd_checkout_progress_' . $prevStep);
276
+ $layout->generateXml();
277
+ $layout->generateBlocks();
278
+ $output = $layout->getOutput();
279
+ $this->getResponse()->setBody($output);
280
+ return $output;
281
+ }
282
+
283
+ protected function log($message, $level="DEBUG", $file=false)
284
+ {
285
+ $callers=debug_backtrace();
286
+ return Mage::helper('hcd/payment')->realLog($callers[1]['function'].' '.$message, $level, $file);
287
+ }
288
+ }
app/code/community/HeidelpayCD/Edition/Edition/controllers/IndexController.php ADDED
@@ -0,0 +1,664 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Index controller
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ // @codingStandardsIgnoreLine magento marketplace namespace warning
17
+ class HeidelpayCD_Edition_IndexController extends Mage_Core_Controller_Front_Action
18
+ {
19
+ protected $_sendNewOrderEmail = true;
20
+ protected $_invoiceOrderEmail = true;
21
+ protected $_order = null;
22
+ protected $_paymentInst = null;
23
+ protected $_debug = true;
24
+
25
+ protected $_liveUrl = 'https://heidelpay.hpcgw.net/ngw/post';
26
+ protected $_sandboxUrl = 'https://test-heidelpay.hpcgw.net/ngw/post';
27
+
28
+
29
+ protected $_liveBasketUrl = 'https://heidelpay.hpcgw.net/ngw/basket/';
30
+ protected $_sandboxBasketUrl = 'https://test-heidelpay.hpcgw.net/ngw/basket/';
31
+
32
+
33
+ public $importantPPFields = array(
34
+ 'PRESENTATION_AMOUNT',
35
+ 'PRESENTATION_CURRENCY',
36
+ 'CONNECTOR_ACCOUNT_COUNTRY',
37
+ 'CONNECTOR_ACCOUNT_HOLDER',
38
+ 'CONNECTOR_ACCOUNT_NUMBER',
39
+ 'CONNECTOR_ACCOUNT_BANK',
40
+ 'CONNECTOR_ACCOUNT_BIC',
41
+ 'CONNECTOR_ACCOUNT_IBAN',
42
+ 'IDENTIFICATION_SHORTID',
43
+ );
44
+
45
+ /** @var $_basketApiHelper HeidelpayCD_Edition_Helper_BasketApi */
46
+ protected $_basketApiHelper;
47
+
48
+ protected function _getHelper()
49
+ {
50
+ return Mage::helper('hcd');
51
+ }
52
+
53
+ /**
54
+ * HeidelpayCD_Edition_IndexController constructor.
55
+ *
56
+ * @param Zend_Controller_Request_Abstract $request
57
+ * @param Zend_Controller_Response_Abstract $response
58
+ * @param HeidelpayCD_Edition_Helper_BasketApi $basketApiHelper
59
+ * @param array $invokeArgs
60
+ */
61
+ // @codingStandardsIgnoreLine bug in multi line standard
62
+ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
63
+ {
64
+ parent::__construct($request, $response, $invokeArgs);
65
+ $this->_basketApiHelper = Mage::helper('hcd/basketApi');
66
+ }
67
+
68
+ protected function log($message, $level = "DEBUG", $file = false)
69
+ {
70
+ $callers = debug_backtrace();
71
+ return Mage::helper('hcd/payment')->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
72
+ }
73
+
74
+ protected function _expireAjax()
75
+ {
76
+ if (!$this->getCheckout()->getQuote()->hasItems()) {
77
+ $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
78
+ return false;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Get order model
84
+ *
85
+ * @return Mage_Sales_Model_Order
86
+ */
87
+ public function getOrder()
88
+ {
89
+ return Mage::getModel('sales/order');
90
+ }
91
+
92
+ /**
93
+ * Get checkout session namespace
94
+ *
95
+ * @return Mage_Checkout_Model_Session
96
+ */
97
+ public function getCheckout()
98
+ {
99
+ return Mage::getSingleton('checkout/session');
100
+ }
101
+
102
+ /**
103
+ * Get current quote
104
+ *
105
+ * @return Mage_Sales_Model_Quote
106
+ */
107
+ public function getQuote()
108
+ {
109
+ return $this->getCheckout()->getQuote();
110
+ }
111
+
112
+ /**
113
+ * Get hp session namespace
114
+ *
115
+ * @return Mage_Heidelpay_Model_Session
116
+ */
117
+ public function getSession()
118
+ {
119
+ return Mage::getSingleton('core/session');
120
+ }
121
+
122
+ protected function _getCheckout()
123
+ {
124
+ return Mage::getSingleton('checkout/session');
125
+ }
126
+
127
+ public function getOnepage()
128
+ {
129
+ return Mage::getSingleton('checkout/type_onepage');
130
+ }
131
+
132
+ public function getStore()
133
+ {
134
+ return Mage::app()->getStore()->getId();
135
+ }
136
+
137
+ /**
138
+ * successful return from Heidelpay payment
139
+ */
140
+ public function successAction()
141
+ {
142
+ $session = $this->getCheckout();
143
+ $order = Mage::getModel('sales/order');
144
+ $this->log('SuccessAction Session: '. json_encode($session->getLastRealOrderId()));
145
+ $order->loadByIncrementId($session->getLastRealOrderId());
146
+ if ($order->getPayment() === false) {
147
+ $this->_redirect('', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
148
+ return $this;
149
+ }
150
+
151
+ $noMail = (Mage::app()->getRequest()->getParam('no_mail') == 1) ? true : false;
152
+
153
+
154
+ $this->getCheckout()->getQuote()->setIsActive(false)->save();
155
+ $this->getCheckout()->clear();
156
+
157
+ $message = "";
158
+
159
+ $data = Mage::getModel('hcd/transaction')
160
+ ->loadLastTransactionDataByTransactionnr($session->getLastRealOrderId());
161
+
162
+ $this->log('SuccessAction Data: '. json_encode($data));
163
+
164
+ /*
165
+ * validate Hash to prevent manipulation
166
+ */
167
+ if (Mage::getModel('hcd/resource_encryption')
168
+ ->validateHash($data['IDENTIFICATION_TRANSACTIONID'], $data['CRITERION_SECRET']) === false
169
+ ) {
170
+ $this->log(
171
+ "Customer tries to redirect directly to success page. IP "
172
+ . Mage::app()->getRequest()->getServer('REMOTE_ADDR')
173
+ . " . This could be some kind of manipulation.", 'WARN'
174
+ );
175
+ $this->_redirect('', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
176
+ }
177
+
178
+ $session->unsHcdPaymentInfo();
179
+
180
+ if ($order->getPayment()->getMethodInstance()->getCode() != 'hcdiv' and
181
+ $order->getPayment()->getMethodInstance()->getCode() != 'hcdivsec') {
182
+ $info = $order->getPayment()->getMethodInstance()->showPaymentInfo($data);
183
+ if ($info !== false) {
184
+ $session->setHcdPaymentInfo($info);
185
+ $order->setCustomerNote($info);
186
+ }
187
+ }
188
+
189
+ // last_quote_id workaround for trusted shop buyerprotection
190
+ $quoteID = ($session->getLastQuoteId() === false) ? $session->getQuoteId() : $session->getLastQuoteId();
191
+ $this->getCheckout()->setLastSuccessQuoteId($quoteID);
192
+ $this->log('LastQuteID :' . $quoteID);
193
+
194
+ if ($noMail === false) {
195
+ /** @var $orderStateHelper HeidelpayCD_Edition_Helper_OrderState */
196
+ $orderStateHelper = Mage::helper('hcd/orderState');
197
+ $orderStateHelper->mapStatus(
198
+ $data,
199
+ $order
200
+ );
201
+ }
202
+
203
+ if ($order->getId() and $noMail === false) {
204
+ $order->sendNewOrderEmail();
205
+ }
206
+
207
+ $order->save();
208
+ $this->_redirect('checkout/onepage/success', array('_secure' => true));
209
+ }
210
+
211
+ public function errorAction()
212
+ {
213
+ $session = $this->getCheckout();
214
+ $errorCode = null;
215
+ $order = Mage::getModel('sales/order');
216
+ $order->loadByIncrementId($session->getLastRealOrderId());
217
+ $this->log(' LastRealOrderId ' . json_encode($session->getLastRealOrderId()));
218
+
219
+ $request = Mage::app()->getRequest();
220
+ $getError = $request->getParam('HPError');
221
+
222
+
223
+ // in case of an error in the server to server request
224
+ $usersession = $this->getSession();
225
+ $data = Mage::getModel('hcd/transaction')
226
+ ->loadLastTransactionDataByTransactionnr($session->getLastRealOrderId());
227
+ $this->log(' data ' . json_encode($data));
228
+
229
+ if ($usersession->getHcdError() !== null) {
230
+ $message = Mage::helper('hcd/payment')
231
+ ->handleError($usersession->getHcdError(), $errorCode, (string)$order->getRealOrderId());
232
+ $intMessage = $usersession->getHcdError();
233
+ $data['PROCESSING_RESULT'] = 'NOK';
234
+ $usersession->unsHcdError();
235
+ } else {
236
+ if (isset($data['PROCESSING_RETURN_CODE'])) {
237
+ $errorCode = $data['PROCESSING_RETURN_CODE'];
238
+ }
239
+
240
+ if (isset($getError)) {
241
+ $errorCode = $getError;
242
+ $data['PROCESSING_RESULT'] = 'NOK';
243
+ }
244
+
245
+ $message = Mage::helper('hcd/payment')
246
+ ->handleError($data['PROCESSING_RETURN'], $errorCode, (string)$order->getRealOrderId());
247
+ $intMessage = (!empty($data['PROCESSING_RETURN'])) ? $data['PROCESSING_RETURN'] : $message;
248
+ }
249
+
250
+ $quoteId = ($session->getLastQuoteId() === false) ? $session->getQuoteId() : $session->getLastQuoteId();
251
+ // last_quote_id workaround for trusted shop buyerprotection
252
+
253
+ if ($quoteId) {
254
+ $quote = Mage::getModel('sales/quote')->load($quoteId);
255
+ if ($quote->getId()) {
256
+ $quote->setIsActive(true)->save();
257
+ $session->setQuoteId($quoteId);
258
+ }
259
+ }
260
+
261
+ /** @var $orderStateHelper HeidelpayCD_Edition_Helper_OrderState */
262
+ $orderStateHelper = Mage::helper('hcd/orderState');
263
+ $orderStateHelper->mapStatus(
264
+ $data,
265
+ $order,
266
+ $intMessage
267
+ );
268
+
269
+ $storeId = Mage::app()->getStore()->getId();
270
+ $redirectController = Mage::getStoreConfig("hcd/settings/returnurl", $storeId);
271
+
272
+ switch ($redirectController) {
273
+ case "basket":
274
+ $session->addError($message);
275
+ $this->_redirect('checkout/cart', array('_secure' => true));
276
+ break;
277
+ default:
278
+ $usersession->addError($message);
279
+ $this->_redirect('checkout/onepage', array('_secure' => true));
280
+ }
281
+ }
282
+
283
+ /**
284
+ * redirect return from Heidelpay payment (iframe)
285
+ */
286
+ public function indexAction()
287
+ {
288
+ $data = array();
289
+ $order = $this->getOrder();
290
+
291
+ $refId = false;
292
+ $basketId = false;
293
+
294
+ $session = $this->getCheckout();
295
+ $order->loadByIncrementId($session->getLastRealOrderId());
296
+ if ($order->getPayment() === false) {
297
+ $this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());
298
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
299
+ return $this;
300
+ }
301
+
302
+ $payment = $order->getPayment()->getMethodInstance();
303
+
304
+ if ($session->getHcdWallet() !== false) {
305
+ $wallet = $session->getHcdWallet();
306
+ $refId = (!empty($wallet['referenceId'])) ? $wallet['referenceId'] : false;
307
+ $this->log('Wallet reference id :' . $refId);
308
+ }
309
+
310
+
311
+ if ($payment->canBasketApi() and empty($refId)) {
312
+ $shoppingCart = $this->_basketApiHelper->basketItems($order, $this->getStore());
313
+
314
+ $url = (Mage::getStoreConfig('hcd/settings/transactionmode', $this->getStore()) == 0)
315
+ ? $this->_liveBasketUrl : $this->_sandboxBasketUrl;
316
+
317
+ $this->log("doRequest shoppingcart : " . json_encode($shoppingCart), 'DEBUG');
318
+
319
+ $result = Mage::helper('hcd/payment')->doRequest($url, array('raw' => $shoppingCart));
320
+
321
+ if (array_key_exists('result', $result) && $result['result'] == 'NOK') {
322
+ $this->log(
323
+ 'Send basket to payment fail, because of : ' .
324
+ json_encode($result), 'ERROR'
325
+ );
326
+ Mage::getSingleton('core/session')->setHcdError($result['basketErrors']['message']);
327
+ $this->_redirect(
328
+ 'hcd/index/error',
329
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
330
+ );
331
+ return;
332
+ }
333
+
334
+ $this->log(
335
+ "doRequest shopping cart response : " .
336
+ json_encode($result), 'DEBUG'
337
+ );
338
+ $basketId = (array_key_exists('basketId', $result)) ? $result['basketId'] : false;
339
+ }
340
+
341
+
342
+ // if order status is cancel redirect to cancel page
343
+ if ($order->getStatus() == $payment->getStatusError()) {
344
+ $this->_redirect(
345
+ 'hcd/index/error',
346
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
347
+ );
348
+ return;
349
+ }
350
+
351
+ // if order status is success redirect to success page
352
+ if ($order->getStatus() == $payment->getStatusSuccess() or $order->getStatus() == $payment->getStatusPendig()) {
353
+ $this->_redirect(
354
+ 'hcd/index/success',
355
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true, 'no_mail' => true)
356
+ );
357
+ return;
358
+ }
359
+
360
+
361
+ $data = $payment->getHeidelpayUrl(false, $basketId, $refId);
362
+
363
+ if ($data['POST_VALIDATION'] == 'ACK' and $data['PROCESSING_RESULT'] == 'ACK') {
364
+ if ($data['PAYMENT_CODE'] == "OT.PA") {
365
+ $quoteID = ($session->getLastQuoteId() === false) ? $session->getQuoteId() : $session->getLastQuoteId();
366
+ // last_quote_id workaround for trusted shop buyerprotection
367
+ $order->getPayment()->setTransactionId($quoteID);
368
+ $order->getPayment()->setIsTransactionClosed(true);
369
+ }
370
+
371
+ $order->setState(
372
+ $order->getPayment()->getMethodInstance()->getStatusPendig(false),
373
+ $order->getPayment()->getMethodInstance()->getStatusPendig(true),
374
+ Mage::helper('hcd')->__('Get payment url from Heidelpay -> ') . $data['FRONTEND_REDIRECT_URL']
375
+ );
376
+ $order->getPayment()->addTransaction(
377
+ Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH,
378
+ null,
379
+ true
380
+ );
381
+ $order->save();
382
+
383
+ $session->getQuote()->setIsActive(true)->save();
384
+ $session->clear();
385
+
386
+ if ($payment->activeRedirect() === true) {
387
+ $this->_redirectUrl($data['FRONTEND_REDIRECT_URL']);
388
+ return;
389
+ }
390
+
391
+ $this->loadLayout();
392
+ $this->log('RedirectUrl ' . $data['FRONTEND_PAYMENT_FRAME_URL']);
393
+ $this->log('CCHolder ' . $payment->getCustomerName());
394
+ $this->getLayout()->getBlock('hcd_index')->setHcdUrl($data['FRONTEND_PAYMENT_FRAME_URL']);
395
+ $this->getLayout()->getBlock('hcd_index')->setHcdCode($payment->getCode());
396
+ } else {
397
+ Mage::getModel('hcd/transaction')->saveTransactionData($data);
398
+ Mage::getSingleton('core/session')->setHcdError($data['PROCESSING_RETURN']);
399
+ $this->_redirect(
400
+ 'hcd/index/error',
401
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
402
+ );
403
+ }
404
+
405
+
406
+ $this->renderLayout();
407
+ return $this;
408
+ }
409
+
410
+ /**
411
+ * masterpass wallet controller
412
+ */
413
+ public function walletAction()
414
+ {
415
+ $data = array();
416
+ $request = Mage::app()->getRequest();
417
+ $paymentCode = $request->getParam('_wallet');
418
+ $storeId = $this->getStore();
419
+ $code = false;
420
+ $mageBasketId = (string)$this->getCheckout()->getQuoteId();
421
+
422
+ if ($paymentCode == 'hcdmpa') {
423
+ $code = 'hcdmpa';
424
+ }
425
+
426
+ $quote = $this->getOnepage()->getQuote();
427
+ if (!$quote->hasItems() || $quote->getHasError() || $code === false) {
428
+ $this->_redirect('checkout/cart');
429
+ return;
430
+ }
431
+
432
+
433
+ $shoppingCart = $this->_basketApiHelper->basketItems($quote, $storeId, false);
434
+
435
+ $url = (Mage::getStoreConfig(
436
+ 'hcd/settings/transactionmode',
437
+ $storeId
438
+ ) == 0) ? $this->_liveBasketUrl : $this->_sandboxBasketUrl;
439
+
440
+ $this->log("doRequest shoppingcart : " . json_encode($shoppingCart), 'DEBUG');
441
+ $this->log("doRequest shoppingcart : " . json_encode($shoppingCart), 'DEBUG');
442
+
443
+ $result = Mage::helper('hcd/payment')->doRequest($url, array('raw' => $shoppingCart));
444
+
445
+ if (array_key_exists('result', $result) && $result['result'] == 'NOK') {
446
+ $this->log(
447
+ 'Send basket to payment fail, because of : ' .
448
+ json_encode($result), 'ERROR'
449
+ );
450
+ $message = $this->_getHelper()
451
+ ->__('An unexpected error occurred. Please contact us to get further information.');
452
+ Mage::getSingleton('core/session')->addError($message);
453
+ $this->_redirect('checkout/cart', array('_secure' => true));
454
+ return;
455
+ }
456
+
457
+ $this->log("doRequest shoppingcart response : " . json_encode($result), 'DEBUG');
458
+
459
+ $config = array(
460
+ 'PAYMENT.METHOD' => preg_replace('/^hcd/', '', $code),
461
+ 'SECURITY.SENDER' => Mage::getStoreConfig('hcd/settings/security_sender', $storeId),
462
+ 'TRANSACTION.MODE' => (Mage::getStoreConfig(
463
+ 'hcd/settings/transactionmode',
464
+ $storeId
465
+ ) == 0) ? 'LIVE' : 'CONNECTOR_TEST',
466
+ 'URL' => (Mage::getStoreConfig(
467
+ 'hcd/settings/transactionmode',
468
+ $storeId
469
+ ) == 0) ? $this->_liveUrl : $this->_sandboxUrl,
470
+ 'USER.LOGIN' => trim(Mage::getStoreConfig('hcd/settings/user_id', $storeId)),
471
+ 'USER.PWD' => trim(Mage::getStoreConfig('hcd/settings/user_pwd', $storeId)),
472
+ 'TRANSACTION.CHANNEL' => trim(Mage::getStoreConfig('payment/' . $code . '/channel', $storeId)),
473
+ 'PAYMENT.TYPE' => 'IN'
474
+ );
475
+ $frontend = array(
476
+ 'FRONTEND.LANGUAGE' => Mage::helper('hcd/payment')->getLang(),
477
+ 'FRONTEND.RESPONSE_URL' => Mage::getUrl(
478
+ 'hcd/index/response',
479
+ array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true)
480
+ ),
481
+ 'CRITERION.SECRET' => Mage::getModel('hcd/resource_encryption')->getHash($mageBasketId),
482
+ 'CRITERION.LANGUAGE' => strtolower(Mage::helper('hcd/payment')->getLang()),
483
+ 'CRITERION.STOREID' => $storeId,
484
+ 'SHOP.TYPE' => 'Magento ' . Mage::getVersion(),
485
+ 'SHOPMODULE.VERSION' => 'HeidelpayCD Edition - '
486
+ . (string)Mage::getConfig()->getNode()->modules->HeidelpayCD_Edition->version,
487
+ 'WALLET.DIRECT_PAYMENT' => 'false'
488
+ );
489
+
490
+ $visitorData = Mage::getSingleton('core/session')->getVisitorData();
491
+
492
+ $user = array(
493
+ 'IDENTIFICATION.SHOPPERID' => $visitorData['visitor_id'],
494
+ 'NAME.GIVEN' => ' - ',
495
+ 'NAME.FAMILY' => ' - ',
496
+ 'ADDRESS.STREET' => ' - ',
497
+ 'ADDRESS.ZIP' => ' - ',
498
+ 'ADDRESS.CITY' => ' - ',
499
+ 'ADDRESS.COUNTRY' => 'DE',
500
+ 'CONTACT.EMAIL' => 'dummy@heidelpay.de',
501
+ 'CONTACT.IP' => (filter_var(
502
+ trim(Mage::app()->getRequest()->getClientIp()),
503
+ FILTER_VALIDATE_IP
504
+ )) ? trim(Mage::app()->getRequest()->getClientIp()) : '127.0.0.1'
505
+ );
506
+
507
+ $basketData = array(
508
+ 'PRESENTATION.AMOUNT' => Mage::helper('hcd/payment')->format($quote->getGrandTotal()),
509
+ 'PRESENTATION.CURRENCY' => $quote->getGlobalCurrencyCode(),
510
+ 'IDENTIFICATION.TRANSACTIONID' => $mageBasketId,
511
+ 'BASKET.ID' => (array_key_exists('basketId', $result)) ? $result['basketId'] : ''
512
+ );
513
+
514
+ $params = Mage::helper('hcd/payment')->preparePostData(
515
+ $config, $frontend, $user, $basketData,
516
+ $criterion = array()
517
+ );
518
+
519
+
520
+ $this->log("doRequest url : " . $config['URL'], 'DEBUG');
521
+ $this->log("doRequest params : " . json_encode($params), 'DEBUG');
522
+ $data = Mage::helper('hcd/payment')->doRequest($config['URL'], $params);
523
+ $this->log("doRequest response : " . json_encode($data), 'DEBUG');
524
+
525
+
526
+ if ($data['POST_VALIDATION'] == 'ACK' and $data['PROCESSING_RESULT'] == 'ACK') {
527
+ /** Redirect on Success */
528
+ $this->_redirectUrl(trim($data['FRONTEND_REDIRECT_URL']));
529
+ return;
530
+ } else {
531
+ /** Error Case */
532
+ $this->log('Wallet Redirect for ' . $code . ' fail, because of : ' . $data['PROCESSING_RETURN'], 'ERROR');
533
+ $message = $this->_getHelper()
534
+ ->__('An unexpected error occurred. Please contact us to get further information.');
535
+ Mage::getSingleton('core/session')->addError($message);
536
+ $this->_redirect('checkout/cart', array('_secure' => true));
537
+ return;
538
+ }
539
+ }
540
+
541
+ /**
542
+ * Controller for push notification
543
+ */
544
+ public function pushAction()
545
+ {
546
+ $rawPost = false;
547
+ $lastdata = null;
548
+ $request = Mage::app()->getRequest();
549
+ $rawPost = $request->getRawBody();
550
+
551
+ if ($rawPost === false) {
552
+ $this->_redirect('', array('_secure' => true));
553
+ }
554
+
555
+ /** Hack to remove a structure problem in criterion node */
556
+ $rawPost = preg_replace('/<Criterion(\s+)name="(.+?)">(.+?)<\/Criterion>/', '<$2>$3</$2>', $rawPost);
557
+
558
+ $xml = simplexml_load_string($rawPost);
559
+
560
+ $this->log('XML Object from Push : ' . $rawPost);
561
+
562
+ // @codingStandardsIgnoreStart simplexml notation
563
+ list($type, $methode) = Mage::helper('hcd/payment')
564
+ ->splitPaymentCode((string)$xml->Transaction->Payment['code']);
565
+
566
+ if ($methode == 'RG') {
567
+ return;
568
+ }
569
+
570
+ $hash = (string)$xml->Transaction->Analysis->SECRET;
571
+ $orderID = (string)$xml->Transaction->Identification->TransactionID;
572
+ // @codingStandardsIgnoreEnd
573
+
574
+ if (Mage::getModel('hcd/resource_encryption')->validateHash($orderID, $hash) === false) {
575
+ $this->log(
576
+ "Get response form server " . Mage::app()->getRequest()->getServer('REMOTE_ADDR')
577
+ . " with an invalid hash. This could be some kind of manipulation.",
578
+ 'WARN'
579
+ );
580
+ $this->_redirect('', array('_forced_secure' => true, '_store_to_url' => true, '_nosid' => true));
581
+ return;
582
+ }
583
+
584
+ // @codingStandardsIgnoreStart simplexml notation
585
+ $xmlData = array(
586
+ 'PAYMENT_CODE' => (string)$xml->Transaction->Payment['code'],
587
+ 'IDENTIFICATION_TRANSACTIONID' => (string)$orderID,
588
+ 'IDENTIFICATION_UNIQUEID' => (string)$xml->Transaction->Identification->UniqueID,
589
+ 'PROCESSING_RESULT' => (string)$xml->Transaction->Processing->Result,
590
+ 'IDENTIFICATION_SHORTID' => (string)$xml->Transaction->Identification->ShortID,
591
+ 'PROCESSING_STATUS_CODE' => (string)$xml->Transaction->Processing->Status['code'],
592
+ 'PROCESSING_RETURN' => (string)$xml->Transaction->Processing->Return,
593
+ 'PROCESSING_RETURN_CODE' => (string)$xml->Transaction->Processing->Return['code'],
594
+ 'PRESENTATION_AMOUNT' => (string)$xml->Transaction->Payment->Presentation->Amount,
595
+ 'PRESENTATION_CURRENCY' => (string)$xml->Transaction->Payment->Presentation->Currency,
596
+ 'IDENTIFICATION_REFERENCEID' => (string)$xml->Transaction->Identification->ReferenceID,
597
+ 'CRITERION_STOREID' => (int)$xml->Transaction->Analysis->STOREID,
598
+ 'ACCOUNT_BRAND' => false,
599
+ 'CRITERION_LANGUAGE' => strtoupper((string)$xml->Transaction->Analysis->LANGUAGE)
600
+ );
601
+ // @codingStandardsIgnoreEnd
602
+
603
+ $order = $this->getOrder();
604
+ $order->loadByIncrementId($orderID);
605
+ $paymentCode = $order->getPayment()->getMethodInstance()->getCode();
606
+
607
+ switch ($paymentCode) {
608
+ case 'hcddd':
609
+ // @codingStandardsIgnoreStart simplexml notation
610
+ $xmlData['CLEARING_AMOUNT'] = (string)$xml->Transaction->Payment->Clearing->Amount;
611
+ $xmlData['CLEARING_CURRENCY'] = (string)$xml->Transaction->Payment->Clearing->Currency;
612
+ $xmlData['ACCOUNT_IBAN'] = (string)$xml->Transaction->Account->Iban;
613
+ $xmlData['ACCOUNT_BIC'] = (string)$xml->Transaction->Account->Bic;
614
+ $xmlData['ACCOUNT_IDENTIFICATION'] = (string)$xml->Transaction->Account->Identification;
615
+ $xmlData['IDENTIFICATION_CREDITOR_ID'] = (string)$xml->Transaction->Identification->CreditorID;
616
+ // @codingStandardsIgnoreEnd
617
+ break;
618
+ case 'hcdbs':
619
+ if ($methode == 'FI') {
620
+ // @codingStandardsIgnoreStart simplexml notation
621
+ $xmlData['CRITERION_BILLSAFE_LEGALNOTE'] = (string)$xml->Transaction->Analysis->BILLSAFE_LEGALNOTE;
622
+ $xmlData['CRITERION_BILLSAFE_AMOUNT'] = (string)$xml->Transaction->Analysis->BILLSAFE_AMOUNT;
623
+ $xmlData['CRITERION_BILLSAFE_CURRENCY'] = (string)$xml->Transaction->Analysis->BILLSAFE_CURRENCY;
624
+ $xmlData['CRITERION_BILLSAFE_RECIPIENT'] = (string)$xml->Transaction->Analysis->BILLSAFE_RECIPIENT;
625
+ $xmlData['CRITERION_BILLSAFE_IBAN'] = (string)$xml->Transaction->Analysis->BILLSAFE_IBAN;
626
+ $xmlData['CRITERION_BILLSAFE_BIC'] = (string)$xml->Transaction->Analysis->BILLSAFE_BIC;
627
+ $xmlData['CRITERION_BILLSAFE_REFERENCE'] = (string)$xml->Transaction->Analysis->BILLSAFE_REFERENCE;
628
+ $xmlData['CRITERION_BILLSAFE_PERIOD'] = (string)$xml->Transaction->Analysis->BILLSAFE_PERIOD;
629
+ $xmlData['ACCOUNT_BRAND'] = 'BILLSAFE';
630
+ // @codingStandardsIgnoreEnd
631
+ }
632
+ break;
633
+ }
634
+
635
+ // @codingStandardsIgnoreLine simplexml notation
636
+ if (!empty($xml->Transaction->Identification->UniqueID)) {
637
+ $lastdata = Mage::getModel('hcd/transaction')
638
+ ->loadLastTransactionDataByUniqeId($xmlData['IDENTIFICATION_UNIQUEID']);
639
+ }
640
+
641
+ if ($lastdata === false) {
642
+ Mage::getModel('hcd/transaction')->saveTransactionData($xmlData, 'push');
643
+ }
644
+
645
+
646
+ $this->log('PaymentCode ' . $paymentCode);
647
+
648
+ $this->log($type . " " . $methode);
649
+
650
+ if ($methode == 'CB' or
651
+ $methode == 'RC' or
652
+ $methode == 'CP' or
653
+ $methode == 'DB' or
654
+ ($methode == 'FI' and $paymentCode == 'hcdbs')
655
+ ) {
656
+ /** @var $orderStateHelper HeidelpayCD_Edition_Helper_OrderState */
657
+ $orderStateHelper = Mage::helper('hcd/orderState');
658
+ $orderStateHelper->mapStatus(
659
+ $xmlData,
660
+ $order
661
+ );
662
+ }
663
+ }
664
+ }
app/code/community/HeidelpayCD/Edition/Edition/controllers/ResponseController.php ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Index controller
5
+ *
6
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
7
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
8
+ *
9
+ * @link https://dev.heidelpay.de/magento
10
+ *
11
+ * @author Jens Richter
12
+ *
13
+ * @package Heidelpay
14
+ * @subpackage Magento
15
+ * @category Magento
16
+ */
17
+ // @codingStandardsIgnoreLine
18
+ class HeidelpayCD_Edition_ResponseController extends Mage_Core_Controller_Front_Action
19
+ {
20
+ protected $_sendNewOrderEmail = true;
21
+ protected $_invoiceOrderEmail = true;
22
+ protected $_order = null;
23
+ protected $_paymentInst = null;
24
+ protected $_debug = true;
25
+
26
+ protected function _getHelper()
27
+ {
28
+ return Mage::helper('hcd');
29
+ }
30
+
31
+ protected function log($message, $level = "DEBUG", $file = false)
32
+ {
33
+ $callers = debug_backtrace();
34
+ return Mage::helper('hcd/payment')->realLog($callers[1]['function'] . ' ' . $message, $level, $file);
35
+ }
36
+
37
+ protected function _expireAjax()
38
+ {
39
+ if (!$this->getCheckout()->getQuote()->hasItems()) {
40
+ $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
41
+ return false;
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Get order model
47
+ *
48
+ * @return Mage_Sales_Model_Order
49
+ */
50
+ public function getOrder()
51
+ {
52
+ return Mage::getModel('sales/order');
53
+ }
54
+
55
+ /**
56
+ * Get checkout session namespace
57
+ *
58
+ * @return Mage_Checkout_Model_Session
59
+ */
60
+ public function getCheckout()
61
+ {
62
+ return Mage::getSingleton('checkout/session');
63
+ }
64
+
65
+ /**
66
+ * Get current quote
67
+ *
68
+ * @return Mage_Sales_Model_Quote
69
+ */
70
+ public function getQuote()
71
+ {
72
+ return $this->getCheckout()->getQuote();
73
+ }
74
+
75
+ /**
76
+ * Get hp session namespace
77
+ *
78
+ * @return Mage_Core_Model_Abstract
79
+ */
80
+ public function getSession()
81
+ {
82
+ return Mage::getSingleton('core/session');
83
+ }
84
+
85
+ /**
86
+ * @return Mage_Checkout_Model_Session
87
+ */
88
+ protected function _getCheckout()
89
+ {
90
+ return Mage::getSingleton('checkout/session');
91
+ }
92
+
93
+ public function getOnepage()
94
+ {
95
+ return Mage::getSingleton('checkout/type_onepage');
96
+ }
97
+
98
+ public function getStore()
99
+ {
100
+ return Mage::app()->getStore()->getId();
101
+ }
102
+
103
+ public function indexAction()
104
+ {
105
+ $response = Mage::app()->getRequest();
106
+ $response->setParamSources(array('_POST'));
107
+ $data = array();
108
+
109
+ $this->log('ResponseController');
110
+
111
+ $securityHash = $response->getPost('CRITERION_SECRET');
112
+
113
+ $transactionId = $response->getPOST('IDENTIFICATION_TRANSACTIONID');
114
+ $data['IDENTIFICATION_TRANSACTIONID'] =
115
+ (!empty($transactionId))
116
+ ? $response->getPOST('IDENTIFICATION_TRANSACTIONID')
117
+ : $response->getPOST('IDENTIFICATION_SHOPPERID');
118
+ /*
119
+ * validate Hash to prevent manipulation
120
+ */
121
+ if (Mage::getModel('hcd/resource_encryption')
122
+ ->validateHash(
123
+ $data['IDENTIFICATION_TRANSACTIONID'],
124
+ $securityHash
125
+ ) === false
126
+ ) {
127
+ // @codingStandardsIgnoreLine should be refactored - issue #5
128
+ print Mage::getUrl(
129
+ 'hcd/index/error', array(
130
+ '_forced_secure' => true,
131
+ '_store_to_url' => true,
132
+ '_nosid' => true
133
+ )
134
+ );
135
+ $this->log(
136
+ "Get response form server "
137
+ . $response->getServer('REMOTE_ADDR')
138
+ . " with an invalid hash. This could be some kind of manipulation.",
139
+ 'WARN'
140
+ );
141
+ return;
142
+ }
143
+
144
+ $data= $response->getParams();
145
+
146
+
147
+ $paymentCode = Mage::helper('hcd/payment')->splitPaymentCode($data['PAYMENT_CODE']);
148
+
149
+ $this->log("Post params: " . json_encode($data));
150
+
151
+ if ($paymentCode[1] == 'RG') {
152
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
153
+ $message = Mage::helper('hcd/payment')->handleError(
154
+ $data['PROCESSING_RETURN'],
155
+ $data['PROCESSING_RETURN_CODE']
156
+ );
157
+ $checkout = $this->getCheckout()->addError($message);
158
+ $url = Mage::getUrl(
159
+ 'hcd/index/error', array(
160
+ '_forced_secure' => true,
161
+ '_store_to_url' => true,
162
+ '_nosid' => true,
163
+ 'HPError' => $data['PROCESSING_RETURN_CODE']
164
+ )
165
+ );
166
+ } else {
167
+ // save cc and dc registration data
168
+ $this->saveCustomerRegistration($data, $paymentCode);
169
+
170
+ $url = Mage::getUrl('hcd/', array('_secure' => true));
171
+ }
172
+ } elseif ($paymentCode[1] == 'IN' and $response->getPost('WALLET_DIRECT_PAYMENT') == 'false') {
173
+ // Back to checkout after wallet init
174
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
175
+ $this->log(
176
+ 'Wallet for basketId '
177
+ . $data['IDENTIFICATION_TRANSACTIONID']
178
+ . ' failed because of '
179
+ . $data['PROCESSING_RETURN'],
180
+ 'NOTICE'
181
+ );
182
+ $url = Mage::getUrl('checkout/cart', array('_secure' => true));
183
+ } else {
184
+ $url = Mage::getUrl('hcd/checkout/', array('_secure' => true, '_wallet' => 'hcdmpa'));
185
+ }
186
+
187
+ Mage::getModel('hcd/transaction')->saveTransactionData($data);
188
+ } else {
189
+ /* load order */
190
+ $order = $this->getOrder();
191
+ $order->loadByIncrementId($data['IDENTIFICATION_TRANSACTIONID']);
192
+ if ($order->getPayment() !== false) {
193
+ $payment = $order->getPayment()->getMethodInstance();
194
+ }
195
+
196
+ $this->log('UniqeID: ' . $data['IDENTIFICATION_UNIQUEID']);
197
+
198
+
199
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
200
+ if (isset($data['FRONTEND_REQUEST_CANCELLED'])) {
201
+ $url = $data['FRONTEND_FAILURE_URL'];
202
+ } else {
203
+ $url = $data['FRONTEND_FAILURE_URL'];
204
+ }
205
+ } elseif (($paymentCode[1] == 'CP' or
206
+ $paymentCode[1] == 'DB' or
207
+ $paymentCode[1] == 'FI' or
208
+ $paymentCode[1] == 'RC')
209
+ and ($data['PROCESSING_RESULT'] == 'ACK' and $data['PROCESSING_STATUS_CODE'] != 80)
210
+ ) {
211
+ $url = $data['FRONTEND_SUCCESS_URL'];
212
+ } else {
213
+ $url = $data['FRONTEND_SUCCESS_URL'];
214
+ }
215
+
216
+ Mage::getModel('hcd/transaction')->saveTransactionData($data);
217
+ }
218
+
219
+ $this->log('Url: ' . $url);
220
+
221
+ // @codingStandardsIgnoreLine should be refactored - issue #5
222
+ print $url;
223
+ }
224
+
225
+ /**
226
+ * Save customer registration
227
+ *
228
+ * @param $data HeidelpayCD_Edition_Model_Transaction
229
+ * @param $paymentCode array
230
+ *
231
+ * @return HeidelpayCD_Edition_Model_Customer
232
+ */
233
+ protected function saveCustomerRegistration($data, $paymentCode)
234
+ {
235
+ /** @var $customerData HeidelpayCD_Edition_Model_Customer */
236
+ $customerData = Mage::getModel('hcd/customer');
237
+ $currentPayment = 'hcd' . strtolower($paymentCode[0]);
238
+ $storeId = ($data['CRITERION_GUEST'] == 'true')
239
+ ? 0 : trim($data['CRITERION_STOREID']);
240
+ $registrationData = Mage::getModel('hcd/customer')
241
+ ->getCollection()
242
+ ->addFieldToFilter('Customerid', trim($data['IDENTIFICATION_SHOPPERID']))
243
+ ->addFieldToFilter('Storeid', $storeId)
244
+ ->addFieldToFilter('Paymentmethode', trim($currentPayment));
245
+ $registrationData->load();
246
+ $returnData = $registrationData->getData();
247
+ if (!empty($returnData[0]['id'])) {
248
+ $customerData->setId((int)$returnData[0]['id']);
249
+ }
250
+
251
+ $customerData->setPaymentmethode($currentPayment);
252
+ $customerData->setUniqeid($data['IDENTIFICATION_UNIQUEID']);
253
+ $customerData->setCustomerid($data['IDENTIFICATION_SHOPPERID']);
254
+ $customerData->setStoreid($storeId);
255
+ $customerData->setPaymentData(
256
+ Mage::getModel('hcd/resource_encryption')
257
+ ->encrypt(
258
+ json_encode(
259
+ array(
260
+ 'ACCOUNT.REGISTRATION' => $data['IDENTIFICATION_UNIQUEID'],
261
+ 'SHIPPPING_HASH' => $data['CRITERION_SHIPPPING_HASH'],
262
+ 'ACCOUNT_BRAND' => $data['ACCOUNT_BRAND'],
263
+ 'ACCOUNT_NUMBER' => $data['ACCOUNT_NUMBER'],
264
+ 'ACCOUNT_HOLDER' => $data['ACCOUNT_HOLDER'],
265
+ 'ACCOUNT_EXPIRY_MONTH' => $data['ACCOUNT_EXPIRY_MONTH'],
266
+ 'ACCOUNT_EXPIRY_YEAR' => $data['ACCOUNT_EXPIRY_YEAR']
267
+ )
268
+ )
269
+ )
270
+ );
271
+
272
+ return $customerData->save();
273
+ }
274
+ }
app/code/community/HeidelpayCD/Edition/Edition/etc/config.xml ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <HeidelpayCD_Edition>
5
+ <version>17.5.17</version>
6
+ </HeidelpayCD_Edition>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <hcd>
11
+ <class>HeidelpayCD_Edition_Helper</class>
12
+ </hcd>
13
+ </helpers>
14
+ <models>
15
+ <hcd>
16
+ <class>HeidelpayCD_Edition_Model</class>
17
+ <resourceModel>hcd_resource</resourceModel>
18
+ </hcd>
19
+ <hcd_resource>
20
+ <class>HeidelpayCD_Edition_Model_Mysql4</class>
21
+ <entities>
22
+ <transaction>
23
+ <table>heidelpay_transaction</table>
24
+ </transaction>
25
+ <customer>
26
+ <table>heidelpay_customer</table>
27
+ </customer>
28
+ </entities>
29
+ </hcd_resource>
30
+ </models>
31
+ <blocks>
32
+ <hcd>
33
+ <class>HeidelpayCD_Edition_Block</class>
34
+ </hcd>
35
+ </blocks>
36
+ <resources>
37
+ <hcd_setup>
38
+ <setup>
39
+ <module>HeidelpayCD_Edition</module>
40
+ </setup>
41
+ </hcd_setup>
42
+ <hcd_write>
43
+ <connection>
44
+ <use>core_write</use>
45
+ </connection>
46
+ </hcd_write>
47
+ <hcd_read>
48
+ <connection>
49
+ <use>core_read</use>
50
+ </connection>
51
+ </hcd_read>
52
+ </resources>
53
+ <payment>
54
+ <groups>
55
+ <hcd>Heidelpay CD-Edition</hcd>
56
+ </groups>
57
+ </payment>
58
+ <events>
59
+ <checkout_onepage_controller_success_action>
60
+ <observers>
61
+ <controller_action_before>
62
+ <class>hcd/observer</class>
63
+ <method>removeWalletDataFromCheckout</method>
64
+ </controller_action_before>
65
+ </observers>
66
+ </checkout_onepage_controller_success_action>
67
+ <controller_action_predispatch_checkout>
68
+ <observers>
69
+ <controller_action_before>
70
+ <class>hcd/observer</class>
71
+ <method>handleWalletDataDuringCheckout</method>
72
+ </controller_action_before>
73
+ </observers>
74
+ </controller_action_predispatch_checkout>
75
+ <sales_order_shipment_save_before>
76
+ <observers>
77
+ <reportShippingToHeidelpay>
78
+ <class>hcd/observer</class>
79
+ <method>reportShippingToHeidelpay</method>
80
+ </reportShippingToHeidelpay>
81
+ </observers>
82
+ </sales_order_shipment_save_before>
83
+ </events>
84
+ <template>
85
+ <email>
86
+ <hcd_payment_info>
87
+ <label>Heidelpay payment informations</label>
88
+ <file>sales/hcd_payment_info.html</file>
89
+ <type>html</type>
90
+ </hcd_payment_info>
91
+ </email>
92
+ </template>
93
+ </global>
94
+ <frontend>
95
+ <secure_url>
96
+ <hcd_payment>hcd/</hcd_payment>
97
+ </secure_url>
98
+ <routers>
99
+ <hcd>
100
+ <use>standard</use>
101
+ <args>
102
+ <module>HeidelpayCD_Edition</module>
103
+ <frontName>hcd</frontName>
104
+ </args>
105
+ </hcd>
106
+ </routers>
107
+ <translate>
108
+ <modules>
109
+ <HeidelpayCD_Edition>
110
+ <files>
111
+ <default>HeidelpayCD_Edition.csv</default>
112
+ </files>
113
+ </HeidelpayCD_Edition>
114
+ </modules>
115
+ </translate>
116
+ <layout>
117
+ <updates>
118
+ <hcd>
119
+ <file>hcd.xml</file>
120
+ </hcd>
121
+ </updates>
122
+ </layout>
123
+ </frontend>
124
+ <adminhtml>
125
+ <translate>
126
+ <modules>
127
+ <HeidelpayCD_Edition>
128
+ <files>
129
+ <default>HeidelpayCD_Edition.csv</default>
130
+ </files>
131
+ </HeidelpayCD_Edition>
132
+ </modules>
133
+ </translate>
134
+ <acl>
135
+ <resources>
136
+ <admin>
137
+ <children>
138
+ <system>
139
+ <children>
140
+ <config>
141
+ <children>
142
+ <hcd>
143
+ <title>HeidelpayCD Edition</title>
144
+ </hcd>
145
+ </children>
146
+ </config>
147
+ </children>
148
+ </system>
149
+ </children>
150
+ </admin>
151
+ </resources>
152
+ </acl>
153
+ </adminhtml>
154
+ <default>
155
+ <hcd>
156
+ <settings>
157
+ <transactionmode>1</transactionmode>
158
+ <security_sender>31HA07BC8142C5A171745D00AD63D182</security_sender>
159
+ <user_id>31ha07bc8142c5a171744e5aef11ffd3</user_id>
160
+ <user_pwd>93167DE7</user_pwd>
161
+ <log>0</log>
162
+ <invoicing>0</invoicing>
163
+ <returnurl>onepage</returnurl>
164
+ </settings>
165
+ </hcd>
166
+ <payment>
167
+ <hcdcc>
168
+ <group>hcd</group>
169
+ <title>Credit Card</title>
170
+ <active>0</active>
171
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
172
+ <bookingmode>DB</bookingmode>
173
+ <invioce>1</invioce>
174
+ <capture_on_delivery>0</capture_on_delivery>
175
+ <model>hcd/payment_hcdcc</model>
176
+ <sort_order>1</sort_order>
177
+ <min_amount>0</min_amount>
178
+ <max_amount>0</max_amount>
179
+ <allowspecific>0</allowspecific>
180
+ </hcdcc>
181
+ <hcddc>
182
+ <group>hcd</group>
183
+ <title>Debit Card</title>
184
+ <active>0</active>
185
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
186
+ <bookingmode>DB</bookingmode>
187
+ <invioce>1</invioce>
188
+ <capture_on_delivery>0</capture_on_delivery>
189
+ <model>hcd/payment_hcddc</model>
190
+ <sort_order>1</sort_order>
191
+ <min_amount>0</min_amount>
192
+ <max_amount>0</max_amount>
193
+ <allowspecific>0</allowspecific>
194
+ </hcddc>
195
+ <hcddd>
196
+ <group>hcd</group>
197
+ <title>Direct Debit - Lastschrift</title>
198
+ <active>0</active>
199
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
200
+ <bookingmode>DB</bookingmode>
201
+ <insurence>0</insurence>
202
+ <invioce>1</invioce>
203
+ <capture_on_delivery>0</capture_on_delivery>
204
+ <model>hcd/payment_hcddd</model>
205
+ <sort_order>1</sort_order>
206
+ <min_amount>0</min_amount>
207
+ <max_amount>0</max_amount>
208
+ <allowspecific>0</allowspecific>
209
+ </hcddd>
210
+ <hcdddsec>
211
+ <group>hcd</group>
212
+ <title>Direct debit secured</title>
213
+ <active>0</active>
214
+ <channel>31HA07BC81856CAD6D8E0B3A3100FBA3</channel>
215
+ <bookingmode>DB</bookingmode>
216
+ <insurence>0</insurence>
217
+ <invioce>1</invioce>
218
+ <capture_on_delivery>0</capture_on_delivery>
219
+ <model>hcd/payment_hcdDirectDebitSecured</model>
220
+ <sort_order>1</sort_order>
221
+ <min_amount>10</min_amount>
222
+ <max_amount>0</max_amount>
223
+ <allowspecific>0</allowspecific>
224
+ </hcdddsec>
225
+ <hcdsu>
226
+ <group>hcd</group>
227
+ <title>SOFORT Überweisung</title>
228
+ <active>0</active>
229
+ <channel>31HA07BC8142C5A171749CDAA43365D2</channel>
230
+ <invioce>1</invioce>
231
+ <model>hcd/payment_hcdsu</model>
232
+ <sort_order>1</sort_order>
233
+ <min_amount>0</min_amount>
234
+ <max_amount>0</max_amount>
235
+ <allowspecific>1</allowspecific>
236
+ <specificcountry>BE,DE,IT,NL,AT,SI,ES</specificcountry>
237
+ </hcdsu>
238
+ <hcdgp>
239
+ <group>hcd</group>
240
+ <title>Giropay</title>
241
+ <active>0</active>
242
+ <channel>31HA07BC8142C5A171740166AF277E03</channel>
243
+ <invioce>1</invioce>
244
+ <model>hcd/payment_hcdgp</model>
245
+ <sort_order>1</sort_order>
246
+ <min_amount>0</min_amount>
247
+ <max_amount>0</max_amount>
248
+ <allowspecific>0</allowspecific>
249
+ </hcdgp>
250
+ <hcdbs>
251
+ <group>hcd</group>
252
+ <title>Kauf auf Rechnung</title>
253
+ <active>0</active>
254
+ <channel>31HA07BC8142EE6D02715F4CA97DDD8B</channel>
255
+ <model>hcd/payment_hcdbs</model>
256
+ <invioce>1</invioce>
257
+ <sort_order>1</sort_order>
258
+ <min_amount>0</min_amount>
259
+ <max_amount>0</max_amount>
260
+ <allowspecific>1</allowspecific>
261
+ <specificcountry>DE</specificcountry>
262
+ </hcdbs>
263
+ <hcdpal>
264
+ <group>hcd</group>
265
+ <title>Pay Pal</title>
266
+ <active>0</active>
267
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
268
+ <bookingmode>DB</bookingmode>
269
+ <invioce>1</invioce>
270
+ <capture_on_delivery>0</capture_on_delivery>
271
+ <model>hcd/payment_hcdpal</model>
272
+ <payment_action>Authorization</payment_action>
273
+ <sort_order>1</sort_order>
274
+ <min_amount>0</min_amount>
275
+ <max_amount>0</max_amount>
276
+ <allowspecific>0</allowspecific>
277
+ </hcdpal>
278
+ <hcdpp>
279
+ <group>hcd</group>
280
+ <title>Prepayment</title>
281
+ <active>0</active>
282
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
283
+ <invioce>1</invioce>
284
+ <model>hcd/payment_hcdpp</model>
285
+ <sort_order>1</sort_order>
286
+ <min_amount>0</min_amount>
287
+ <max_amount>0</max_amount>
288
+ <allowspecific>0</allowspecific>
289
+ </hcdpp>
290
+ <hcdiv>
291
+ <group>hcd</group>
292
+ <title>Invoice</title>
293
+ <active>0</active>
294
+ <channel>31HA07BC8142C5A171749A60D979B6E4</channel>
295
+ <invioce>0</invioce>
296
+ <capture_on_delivery>0</capture_on_delivery>
297
+ <model>hcd/payment_hcdiv</model>
298
+ <sort_order>1</sort_order>
299
+ <min_amount>0</min_amount>
300
+ <max_amount>0</max_amount>
301
+ <allowspecific>0</allowspecific>
302
+ </hcdiv>
303
+ <hcdivsec>
304
+ <group>hcd</group>
305
+ <title>Invoice secured</title>
306
+ <active>0</active>
307
+ <channel>31HA07BC81856CAD6D8E05CDDE7E2AC8</channel>
308
+ <invioce>0</invioce>
309
+ <capture_on_delivery>0</capture_on_delivery>
310
+ <model>hcd/payment_hcdInvoiceSecured</model>
311
+ <sort_order>1</sort_order>
312
+ <min_amount>10</min_amount>
313
+ <max_amount>0</max_amount>
314
+ <allowspecific>0</allowspecific>
315
+ </hcdivsec>
316
+ <hcdpf>
317
+ <group>hcd</group>
318
+ <title>Postfinance</title>
319
+ <active>0</active>
320
+ <channel>31HA07BC811E8AEF9AB2733D80C21DA8</channel>
321
+ <invioce>1</invioce>
322
+ <model>hcd/payment_hcdpf</model>
323
+ <sort_order>1</sort_order>
324
+ <min_amount>0</min_amount>
325
+ <max_amount>0</max_amount>
326
+ <allowspecific>1</allowspecific>
327
+ <specificcountry>CH</specificcountry>
328
+ </hcdpf>
329
+ <hcdeps>
330
+ <group>hcd</group>
331
+ <title>EPS</title>
332
+ <active>0</active>
333
+ <channel></channel>
334
+ <invioce>1</invioce>
335
+ <model>hcd/payment_hcdeps</model>
336
+ <sort_order>1</sort_order>
337
+ <min_amount>0</min_amount>
338
+ <max_amount>0</max_amount>
339
+ <allowspecific>1</allowspecific>
340
+ <specificcountry>AT</specificcountry>
341
+ </hcdeps>
342
+ <hcdide>
343
+ <group>hcd</group>
344
+ <title>Ideal</title>
345
+ <active>0</active>
346
+ <channel>31HA07BC8142C5A171744B56E61281E5</channel>
347
+ <invioce>1</invioce>
348
+ <model>hcd/payment_hcdide</model>
349
+ <sort_order>1</sort_order>
350
+ <min_amount>0</min_amount>
351
+ <max_amount>0</max_amount>
352
+ <allowspecific>1</allowspecific>
353
+ <specificcountry>NL</specificcountry>
354
+ </hcdide>
355
+ <hcdmpa>
356
+ <group>hcd</group>
357
+ <title>MasterPass</title>
358
+ <active>0</active>
359
+ <channel>31HA07BC814948E72EF669CA3BB1431F</channel>
360
+ <invioce>1</invioce>
361
+ <capture_on_delivery>0</capture_on_delivery>
362
+ <model>hcd/payment_hcdmpa</model>
363
+ <sort_order>1</sort_order>
364
+ <min_amount>0</min_amount>
365
+ <max_amount>0</max_amount>
366
+ <allowspecific>0</allowspecific>
367
+ </hcdmpa>
368
+ </payment>
369
+ </default>
370
+ </config>
app/code/community/HeidelpayCD/Edition/Edition/etc/system.xml ADDED
@@ -0,0 +1,1539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <!--{{{ Global Settings-->
5
+ <hcd translate="label" module="hcd">
6
+ <label>
7
+ <![CDATA[<img alt="Heidelpay" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAADBQTFRFODg43d3dt7e3KCgoREREU1NTAQEBEhIS////scfeeXl57OzsqKioXV1dk5OTnZ2dfmcBJgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDgsIBJoD8v4AAABKSURBVAjXY5gJBQwzOsCgE53RCmM0AxknQIwGIMOiOyxBA8TgcFson9YCZIRzdHT0JQAZZSA1y4CMIhCjDaQGxOjtxGkFkAFzBgC9LkKOoh4LJgAAAABJRU5ErkJggg==" /> Heidelpay CD-Edition ]]></label>
8
+ <tab>sales</tab>
9
+ <frontend_type>text</frontend_type>
10
+ <sort_order>405</sort_order>
11
+ <show_in_default>1</show_in_default>
12
+ <show_in_website>1</show_in_website>
13
+ <show_in_store>1</show_in_store>
14
+ <groups>
15
+ <about_us>
16
+ <label>about Heidelpay</label>
17
+ <frontend_type>text</frontend_type>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ <comment><![CDATA[<br />
23
+ <div class="box">
24
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAA7BAMAAAAEMPCJAAAAAXNSR0IArs4c6QAAABhQTFRFPT09u7u7////k5OTDw8Pa2tr2dnZ7u7uGx/afwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kKFggjGov/KAYAAAJ5SURBVEjH7dW7l6IwFAfgOKK247s1l0PS+rYNy2NbRVxbZUZtncyq//7eCD6QeGYo9pwtlgb55TPkARcCuQ6SB7OXXJz++M//Mt/l4sz+N/npJHV83SWEzHdpzutT1xXz9iNnXZcsBgvDnd1zGrqktCCYyhRnoddSybFuFG6cGl4Lb8e3TbcoE67OPCxeBkjDwoVToxgl6ee5F8XV+dW5Tgdv1E/48C79MJYxdwBM75bjlZBnfvCiu/QgogtX/d0dq4ri3Einw3LCzYc9YUQi3zsPeyRkzIe1h01avSAPH9NG5czZQze4UA6zaSalzpl3gswz0Nja79k0XCveiDINVrkQZtPfBcWLmRyYQ5xsSj3kopJtgND9mQ25gdwNNLyhTYeKR5qGvVvTpO+KS02DJXRpB7mnyfG50aXWM071ncSPmIbr0/x8rGvgv7RpkKtGqk/ZKB3El6z8jE/TQXxJ7S85m+Tilp2v93Yu/s2xv2FZpIsJ8Daw0WQKvDlTPFq3cKWr7dMRbh8T5AQLypBgWfChgUUY9sLoU5vNZ80AXnujgSWBL688rFkVLAargPrck/goTiNqU5tj1Rzg5rIi7QPt342d+lblRH3qm/jGEe5wWcLecaMOn8gG2LUZ3XHmd4Rr2PivF4AudQ0hkOP9zTq+U3XowQZSvXcK1eou5lPqVKvbFD/IXpqj4zUcjK8Gg4WklQzmQw0GzHaQ5szbrSo4VbLbCBhOPp3LVGc4VWCDPqTGjisoIlqGlSgRrOTxQs5HS9jgQuJ85I0fgUf4haslJ9yUtzHwHVsm28TV8G/8ycGWt9/jXJwFubhZ+wafXH8e5Ndcf/wBKDObGG4GKXIAAAAASUVORK5CYII=" alt="Heidelpay" />
25
+ <p style="font-size:12px; font-weight: bold;">Heidelberger Payment GmbH - Ihr Full Service Payment Provider - alles aus einer Hand </p>
26
+ <p></p> <p style="font-size:12px">Die Heidelberger Payment GmbH kurz: heidelpay bietet als BaFin-zertifizierter Payment Service Provider alles was zum Online-Payment gehört.<br /><br />
27
+ <a href="http://testshops.heidelpay.de/contactform/?campaign=MagentoWL&amp;shop=Magento" target="_blank" style="font-size: 12px; color: #000; font-weight: bold;">&gt;&gt;&gt; Informationen anfordern &lt;&lt;&lt;</a>
28
+ <br /></p><p><br /> </p><p style="font-size:12px">Das Leistungsspektrum des PCI DSS zertifizierten Unternehmens reicht von weltweiten e-Payment Lösungen, inklusive eines vollständigen Debitorenmanagement-, Risk- und Fraud- Systems
29
+ bis hin zu einem breiten Angebot alternativer Bezahlverfahren - schnell, sicher, einfach und umfassend - alles aus einer Hand.</p><br />
30
+ <a href="http://www.heidelpay.de" target="_blank" style="font-size: 12px; color: #000; font-weight: bold;">www.heidelpay.de</a>
31
+ <br /><br /><p style="font-size:12px;"> Die Plugin wird bei der Installation mit Testdaten aktiviert.</p>
32
+ </div>
33
+ ]]>
34
+ </comment>
35
+ </about_us>
36
+ <settings translate="label">
37
+ <label>General Settings Heidelpay</label>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <fields>
44
+ <transactionmode translate="label">
45
+ <label>Use Testsystem</label>
46
+ <frontend_type>select</frontend_type>
47
+ <source_model>adminhtml/system_config_source_yesno</source_model>
48
+ <comment>If is set to yes, transactionis use the sandbox system and the
49
+ TRANSACTION.MODE=CONNECTOR_TEST, otherwise real payment will be used with mode LIVE. For
50
+ details see integration basisc documentation.
51
+ </comment>
52
+ <sort_order>5</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ </transactionmode>
57
+ <security_sender translate="label">
58
+ <label>Security Sender</label>
59
+ <frontend_type>text</frontend_type>
60
+ <sort_order>10</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ </security_sender>
65
+ <user_id translate="label">
66
+ <label>User Login</label>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>20</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </user_id>
73
+ <user_pwd translate="label">
74
+ <label>User Password</label>
75
+ <frontend_type>text</frontend_type>
76
+ <sort_order>30</sort_order>
77
+ <show_in_default>1</show_in_default>
78
+ <show_in_website>1</show_in_website>
79
+ <show_in_store>1</show_in_store>
80
+ </user_pwd>
81
+ <returnurl translate="label">
82
+ <label>Return in Errorcase</label>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>hcd/system_config_source_returnurl</source_model>
85
+ <comment>Please configurate where your costumer should be redirected to in case of an
86
+ payment error
87
+ </comment>
88
+ <sort_order>50</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ </returnurl>
93
+ <log translate="label">
94
+ <label>Debug Log</label>
95
+ <frontend_type>select</frontend_type>
96
+ <source_model>adminhtml/system_config_source_yesno</source_model>
97
+ <comment>If is set to yes, you can controll all neccessary conntetion Data in
98
+ /var/log/Heidelpay.log
99
+ </comment>
100
+ <sort_order>60</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
+ </log>
105
+ <invoicing translate="label">
106
+ <label>Invoicing over heidelpay</label>
107
+ <frontend_type>select</frontend_type>
108
+ <source_model>adminhtml/system_config_source_yesno</source_model>
109
+ <comment>Invoicing over heidelpay requires an extra contract. For more information, please
110
+ contact your key account manager.
111
+ </comment>
112
+ <sort_order>70</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </invoicing>
117
+ </fields>
118
+ </settings>
119
+ </groups>
120
+ </hcd>
121
+ </sections>
122
+ <sections>
123
+ <payment>
124
+ <groups id="hcd" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1"
125
+ showInStore="1">
126
+ <hcdcc translate="label">
127
+ <label>Heidelpay Credit Card (hcd)</label>
128
+ <frontend_type>text</frontend_type>
129
+ <sort_order>50</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
+ <fields>
134
+ <title translate="label">
135
+ <label>Title</label>
136
+ <frontend_type>text</frontend_type>
137
+ <sort_order>10</sort_order>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>1</show_in_store>
141
+ </title>
142
+ <active translate="label">
143
+ <label>Enabled</label>
144
+ <frontend_type>select</frontend_type>
145
+ <source_model>adminhtml/system_config_source_yesno</source_model>
146
+ <sort_order>20</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ </active>
151
+ <channel translate="label">
152
+ <label>Channel ID</label>
153
+ <frontend_type>text</frontend_type>
154
+ <sort_order>40</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ </channel>
159
+ <bookingmode translate="label">
160
+ <label>Bookingmode</label>
161
+ <frontend_type>select</frontend_type>
162
+ <source_model>hcd/system_config_source_bookingmode</source_model>
163
+ <sort_order>50</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>
167
+ </bookingmode>
168
+ <recognition translate="label">
169
+ <label>Recognition</label>
170
+ <frontend_type>select</frontend_type>
171
+ <source_model>hcd/system_config_source_recognition</source_model>
172
+ <sort_order>60</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>1</show_in_store>
176
+ </recognition>
177
+ <invioce translate="label">
178
+ <label>Automatically invoiced</label>
179
+ <frontend_type>select</frontend_type>
180
+ <source_model>adminhtml/system_config_source_yesno</source_model>
181
+ <sort_order>70</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
+ </invioce>
186
+ <!--<capture_on_delivery translate="label">
187
+ <label>Automatically capture on delivery</label>
188
+ <frontend_type>select</frontend_type>
189
+ <source_model>adminhtml/system_config_source_yesno</source_model>
190
+ <comment>please note that capture on delivery is only possible, when you set bookingmode to preauthorisation</comment>
191
+ <sort_order>80</sort_order>
192
+ <show_in_default>1</show_in_default>
193
+ <show_in_website>1</show_in_website>
194
+ <show_in_store>1</show_in_store>
195
+ </capture_on_delivery>-->
196
+ <sort_order translate="label">
197
+ <label>Sort order</label>
198
+ <frontend_type>text</frontend_type>
199
+ <sort_order>110</sort_order>
200
+ <show_in_default>1</show_in_default>
201
+ <show_in_website>1</show_in_website>
202
+ <show_in_store>1</show_in_store>
203
+ </sort_order>
204
+ <min_amount translate="label">
205
+ <label>Minimum Amount (CENT)</label>
206
+ <frontend_type>text</frontend_type>
207
+ <sort_order>120</sort_order>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>1</show_in_store>
211
+ </min_amount>
212
+ <max_amount translate="label">
213
+ <label>Maximum Amount (CENT)</label>
214
+ <frontend_type>text</frontend_type>
215
+ <sort_order>130</sort_order>
216
+ <show_in_default>1</show_in_default>
217
+ <show_in_website>1</show_in_website>
218
+ <show_in_store>1</show_in_store>
219
+ </max_amount>
220
+ <allowspecific translate="label">
221
+ <label>allow specific countries</label>
222
+ <frontend_type>allowspecific</frontend_type>
223
+ <sort_order>140</sort_order>
224
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
225
+ <show_in_default>1</show_in_default>
226
+ <show_in_website>1</show_in_website>
227
+ <show_in_store>1</show_in_store>
228
+ </allowspecific>
229
+ <specificcountry translate="label">
230
+ <label>specific countries</label>
231
+ <frontend_type>multiselect</frontend_type>
232
+ <sort_order>150</sort_order>
233
+ <source_model>adminhtml/system_config_source_country</source_model>
234
+ <show_in_default>1</show_in_default>
235
+ <show_in_website>1</show_in_website>
236
+ <show_in_store>1</show_in_store>
237
+ </specificcountry>
238
+ </fields>
239
+ </hcdcc>
240
+ <hcddc translate="label">
241
+ <label>Heidelpay Debit Card (hcd)</label>
242
+ <frontend_type>text</frontend_type>
243
+ <sort_order>130</sort_order>
244
+ <show_in_default>1</show_in_default>
245
+ <show_in_website>1</show_in_website>
246
+ <show_in_store>1</show_in_store>
247
+ <fields>
248
+ <title translate="label">
249
+ <label>Title</label>
250
+ <frontend_type>text</frontend_type>
251
+ <sort_order>10</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
+ </title>
256
+ <active translate="label">
257
+ <label>Enabled</label>
258
+ <frontend_type>select</frontend_type>
259
+ <source_model>adminhtml/system_config_source_yesno</source_model>
260
+ <sort_order>20</sort_order>
261
+ <show_in_default>1</show_in_default>
262
+ <show_in_website>1</show_in_website>
263
+ <show_in_store>1</show_in_store>
264
+ </active>
265
+ <channel translate="label">
266
+ <label>Channel ID</label>
267
+ <frontend_type>text</frontend_type>
268
+ <sort_order>40</sort_order>
269
+ <show_in_default>1</show_in_default>
270
+ <show_in_website>1</show_in_website>
271
+ <show_in_store>1</show_in_store>
272
+ </channel>
273
+ <bookingmode translate="label">
274
+ <label>Bookinnmode</label>
275
+ <frontend_type>select</frontend_type>
276
+ <source_model>hcd/system_config_source_bookingmode</source_model>
277
+ <sort_order>50</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ </bookingmode>
282
+ <recognition translate="label">
283
+ <label>Recognition</label>
284
+ <frontend_type>select</frontend_type>
285
+ <source_model>hcd/system_config_source_recognition</source_model>
286
+ <sort_order>60</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>
290
+ </recognition>
291
+ <invioce translate="label">
292
+ <label>Automatically invoiced</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>adminhtml/system_config_source_yesno</source_model>
295
+ <sort_order>70</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
+ </invioce>
300
+ <sort_order translate="label">
301
+ <label>Sort order</label>
302
+ <frontend_type>text</frontend_type>
303
+ <sort_order>110</sort_order>
304
+ <show_in_default>1</show_in_default>
305
+ <show_in_website>1</show_in_website>
306
+ <show_in_store>1</show_in_store>
307
+ </sort_order>
308
+ <min_amount translate="label">
309
+ <label>Minimum Amount (CENT)</label>
310
+ <frontend_type>text</frontend_type>
311
+ <sort_order>120</sort_order>
312
+ <show_in_default>1</show_in_default>
313
+ <show_in_website>1</show_in_website>
314
+ <show_in_store>1</show_in_store>
315
+ </min_amount>
316
+ <max_amount translate="label">
317
+ <label>Maximum Amount (CENT)</label>
318
+ <frontend_type>text</frontend_type>
319
+ <sort_order>130</sort_order>
320
+ <show_in_default>1</show_in_default>
321
+ <show_in_website>1</show_in_website>
322
+ <show_in_store>1</show_in_store>
323
+ </max_amount>
324
+ <allowspecific translate="label">
325
+ <label>allow specific countries</label>
326
+ <frontend_type>allowspecific</frontend_type>
327
+ <sort_order>140</sort_order>
328
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
329
+ <show_in_default>1</show_in_default>
330
+ <show_in_website>1</show_in_website>
331
+ <show_in_store>1</show_in_store>
332
+ </allowspecific>
333
+ <specificcountry translate="label">
334
+ <label>specific countries</label>
335
+ <frontend_type>multiselect</frontend_type>
336
+ <sort_order>150</sort_order>
337
+ <source_model>adminhtml/system_config_source_country</source_model>
338
+ <show_in_default>1</show_in_default>
339
+ <show_in_website>1</show_in_website>
340
+ <show_in_store>1</show_in_store>
341
+ </specificcountry>
342
+ </fields>
343
+ </hcddc>
344
+ <hcddd translate="label">
345
+ <label>Heidelpay Direct Debit (hcd)</label>
346
+ <frontend_type>text</frontend_type>
347
+ <sort_order>60</sort_order>
348
+ <show_in_default>1</show_in_default>
349
+ <show_in_website>1</show_in_website>
350
+ <show_in_store>1</show_in_store>
351
+ <fields>
352
+ <title translate="label">
353
+ <label>Title</label>
354
+ <frontend_type>text</frontend_type>
355
+ <sort_order>10</sort_order>
356
+ <show_in_default>1</show_in_default>
357
+ <show_in_website>1</show_in_website>
358
+ <show_in_store>1</show_in_store>
359
+ </title>
360
+ <active translate="label">
361
+ <label>Enabled</label>
362
+ <frontend_type>select</frontend_type>
363
+ <source_model>adminhtml/system_config_source_yesno</source_model>
364
+ <sort_order>20</sort_order>
365
+ <show_in_default>1</show_in_default>
366
+ <show_in_website>1</show_in_website>
367
+ <show_in_store>1</show_in_store>
368
+ </active>
369
+ <channel translate="label">
370
+ <label>Channel ID</label>
371
+ <frontend_type>text</frontend_type>
372
+ <sort_order>40</sort_order>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>1</show_in_website>
375
+ <show_in_store>1</show_in_store>
376
+ </channel>
377
+ <bookingmode translate="label">
378
+ <label>Bookingmode</label>
379
+ <frontend_type>select</frontend_type>
380
+ <source_model>hcd/system_config_source_bookingmode</source_model>
381
+ <sort_order>50</sort_order>
382
+ <show_in_default>1</show_in_default>
383
+ <show_in_website>1</show_in_website>
384
+ <show_in_store>1</show_in_store>
385
+ </bookingmode>
386
+ <recognition translate="label">
387
+ <label>Recognition</label>
388
+ <frontend_type>select</frontend_type>
389
+ <source_model>hcd/system_config_source_recognition</source_model>
390
+ <sort_order>60</sort_order>
391
+ <show_in_default>1</show_in_default>
392
+ <show_in_website>1</show_in_website>
393
+ <show_in_store>1</show_in_store>
394
+ </recognition>
395
+ <invioce translate="label">
396
+ <label>Automatically invoiced</label>
397
+ <frontend_type>select</frontend_type>
398
+ <source_model>adminhtml/system_config_source_yesno</source_model>
399
+ <sort_order>70</sort_order>
400
+ <show_in_default>1</show_in_default>
401
+ <show_in_website>1</show_in_website>
402
+ <show_in_store>1</show_in_store>
403
+ </invioce>
404
+ <sort_order translate="label">
405
+ <label>Sort order</label>
406
+ <frontend_type>text</frontend_type>
407
+ <sort_order>110</sort_order>
408
+ <show_in_default>1</show_in_default>
409
+ <show_in_website>1</show_in_website>
410
+ <show_in_store>1</show_in_store>
411
+ </sort_order>
412
+ <min_amount translate="label">
413
+ <label>Minimum Amount (CENT)</label>
414
+ <frontend_type>text</frontend_type>
415
+ <sort_order>120</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
+ </min_amount>
420
+ <max_amount translate="label">
421
+ <label>Maximum Amount (CENT)</label>
422
+ <frontend_type>text</frontend_type>
423
+ <sort_order>130</sort_order>
424
+ <show_in_default>1</show_in_default>
425
+ <show_in_website>1</show_in_website>
426
+ <show_in_store>1</show_in_store>
427
+ </max_amount>
428
+ <allowspecific translate="label">
429
+ <label>allow specific countries</label>
430
+ <frontend_type>allowspecific</frontend_type>
431
+ <sort_order>140</sort_order>
432
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
433
+ <show_in_default>1</show_in_default>
434
+ <show_in_website>1</show_in_website>
435
+ <show_in_store>1</show_in_store>
436
+ </allowspecific>
437
+ <specificcountry translate="label">
438
+ <label>specific countries</label>
439
+ <frontend_type>multiselect</frontend_type>
440
+ <sort_order>150</sort_order>
441
+ <source_model>adminhtml/system_config_source_country</source_model>
442
+ <show_in_default>1</show_in_default>
443
+ <show_in_website>1</show_in_website>
444
+ <show_in_store>1</show_in_store>
445
+ </specificcountry>
446
+ </fields>
447
+ </hcddd>
448
+ <hcdddsec translate="label">
449
+ <label>Heidelpay direct debit secured(hcd)</label>
450
+ <frontend_type>text</frontend_type>
451
+ <sort_order>65</sort_order>
452
+ <show_in_default>1</show_in_default>
453
+ <show_in_website>1</show_in_website>
454
+ <show_in_store>1</show_in_store>
455
+ <fields>
456
+ <title translate="label">
457
+ <label>Title</label>
458
+ <frontend_type>text</frontend_type>
459
+ <sort_order>10</sort_order>
460
+ <show_in_default>1</show_in_default>
461
+ <show_in_website>1</show_in_website>
462
+ <show_in_store>1</show_in_store>
463
+ </title>
464
+ <active translate="label">
465
+ <label>Enabled</label>
466
+ <frontend_type>select</frontend_type>
467
+ <source_model>adminhtml/system_config_source_yesno</source_model>
468
+ <sort_order>20</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
+ </active>
473
+ <channel translate="label">
474
+ <label>Channel ID</label>
475
+ <frontend_type>text</frontend_type>
476
+ <sort_order>40</sort_order>
477
+ <show_in_default>1</show_in_default>
478
+ <show_in_website>1</show_in_website>
479
+ <show_in_store>1</show_in_store>
480
+ </channel>
481
+ <recognition translate="label">
482
+ <label>Recognition</label>
483
+ <frontend_type>select</frontend_type>
484
+ <source_model>hcd/system_config_source_recognition</source_model>
485
+ <sort_order>60</sort_order>
486
+ <show_in_default>1</show_in_default>
487
+ <show_in_website>1</show_in_website>
488
+ <show_in_store>1</show_in_store>
489
+ </recognition>
490
+ <invioce translate="label">
491
+ <label>Automatically invoiced</label>
492
+ <frontend_type>select</frontend_type>
493
+ <source_model>adminhtml/system_config_source_yesno</source_model>
494
+ <sort_order>70</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <show_in_store>1</show_in_store>
498
+ </invioce>
499
+ <sort_order translate="label">
500
+ <label>Sort order</label>
501
+ <frontend_type>text</frontend_type>
502
+ <sort_order>110</sort_order>
503
+ <show_in_default>1</show_in_default>
504
+ <show_in_website>1</show_in_website>
505
+ <show_in_store>1</show_in_store>
506
+ </sort_order>
507
+ <min_amount translate="label">
508
+ <label>Minimum Amount (CENT)</label>
509
+ <frontend_type>text</frontend_type>
510
+ <sort_order>120</sort_order>
511
+ <show_in_default>1</show_in_default>
512
+ <show_in_website>1</show_in_website>
513
+ <show_in_store>1</show_in_store>
514
+ </min_amount>
515
+ <max_amount translate="label">
516
+ <label>Maximum Amount (CENT)</label>
517
+ <frontend_type>text</frontend_type>
518
+ <sort_order>130</sort_order>
519
+ <show_in_default>1</show_in_default>
520
+ <show_in_website>1</show_in_website>
521
+ <show_in_store>1</show_in_store>
522
+ </max_amount>
523
+ <allowspecific translate="label">
524
+ <label>allow specific countries</label>
525
+ <frontend_type>allowspecific</frontend_type>
526
+ <sort_order>140</sort_order>
527
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
528
+ <show_in_default>1</show_in_default>
529
+ <show_in_website>1</show_in_website>
530
+ <show_in_store>1</show_in_store>
531
+ </allowspecific>
532
+ <specificcountry translate="label">
533
+ <label>specific countries</label>
534
+ <frontend_type>multiselect</frontend_type>
535
+ <sort_order>150</sort_order>
536
+ <source_model>adminhtml/system_config_source_country</source_model>
537
+ <show_in_default>1</show_in_default>
538
+ <show_in_website>1</show_in_website>
539
+ <show_in_store>1</show_in_store>
540
+ </specificcountry>
541
+ </fields>
542
+ </hcdddsec>
543
+ <hcdsu translate="label">
544
+ <label><![CDATA[Heidelpay SOFORT &Uuml;berweisung (hcd)]]></label>
545
+ <frontend_type>text</frontend_type>
546
+ <sort_order>80</sort_order>
547
+ <show_in_default>1</show_in_default>
548
+ <show_in_website>1</show_in_website>
549
+ <show_in_store>1</show_in_store>
550
+ <fields>
551
+ <title translate="label">
552
+ <label>Title</label>
553
+ <frontend_type>text</frontend_type>
554
+ <sort_order>10</sort_order>
555
+ <show_in_default>1</show_in_default>
556
+ <show_in_website>1</show_in_website>
557
+ <show_in_store>1</show_in_store>
558
+ </title>
559
+ <active translate="label">
560
+ <label>Enabled</label>
561
+ <frontend_type>select</frontend_type>
562
+ <source_model>adminhtml/system_config_source_yesno</source_model>
563
+ <sort_order>20</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
+ </active>
568
+ <channel translate="label">
569
+ <label>Channel ID</label>
570
+ <frontend_type>text</frontend_type>
571
+ <sort_order>40</sort_order>
572
+ <show_in_default>1</show_in_default>
573
+ <show_in_website>1</show_in_website>
574
+ <show_in_store>1</show_in_store>
575
+ </channel>
576
+ <invioce translate="label">
577
+ <label>Automatically invoiced</label>
578
+ <frontend_type>select</frontend_type>
579
+ <source_model>adminhtml/system_config_source_yesno</source_model>
580
+ <sort_order>70</sort_order>
581
+ <show_in_default>1</show_in_default>
582
+ <show_in_website>1</show_in_website>
583
+ <show_in_store>1</show_in_store>
584
+ </invioce>
585
+ <sort_order translate="label">
586
+ <label>Sort order</label>
587
+ <frontend_type>text</frontend_type>
588
+ <sort_order>110</sort_order>
589
+ <show_in_default>1</show_in_default>
590
+ <show_in_website>1</show_in_website>
591
+ <show_in_store>1</show_in_store>
592
+ </sort_order>
593
+ <min_amount translate="label">
594
+ <label>Minimum Amount (CENT)</label>
595
+ <frontend_type>text</frontend_type>
596
+ <sort_order>120</sort_order>
597
+ <show_in_default>1</show_in_default>
598
+ <show_in_website>1</show_in_website>
599
+ <show_in_store>1</show_in_store>
600
+ </min_amount>
601
+ <max_amount translate="label">
602
+ <label>Maximum Amount (CENT)</label>
603
+ <frontend_type>text</frontend_type>
604
+ <sort_order>130</sort_order>
605
+ <show_in_default>1</show_in_default>
606
+ <show_in_website>1</show_in_website>
607
+ <show_in_store>1</show_in_store>
608
+ </max_amount>
609
+ <allowspecific translate="label">
610
+ <label>allow specific countries</label>
611
+ <frontend_type>allowspecific</frontend_type>
612
+ <sort_order>140</sort_order>
613
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
614
+ <show_in_default>1</show_in_default>
615
+ <show_in_website>1</show_in_website>
616
+ <show_in_store>1</show_in_store>
617
+ </allowspecific>
618
+ <specificcountry translate="label">
619
+ <label>specific countries</label>
620
+ <frontend_type>multiselect</frontend_type>
621
+ <sort_order>150</sort_order>
622
+ <source_model>adminhtml/system_config_source_country</source_model>
623
+ <show_in_default>1</show_in_default>
624
+ <show_in_website>1</show_in_website>
625
+ <show_in_store>1</show_in_store>
626
+ </specificcountry>
627
+ </fields>
628
+ </hcdsu>
629
+ <hcdgp translate="label">
630
+ <label>Heidelpay Giropay (hcd)</label>
631
+ <frontend_type>text</frontend_type>
632
+ <sort_order>90</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
+ <title translate="label">
638
+ <label>Title</label>
639
+ <frontend_type>text</frontend_type>
640
+ <sort_order>10</sort_order>
641
+ <show_in_default>1</show_in_default>
642
+ <show_in_website>1</show_in_website>
643
+ <show_in_store>1</show_in_store>
644
+ </title>
645
+ <active translate="label">
646
+ <label>Enabled</label>
647
+ <frontend_type>select</frontend_type>
648
+ <source_model>adminhtml/system_config_source_yesno</source_model>
649
+ <sort_order>20</sort_order>
650
+ <show_in_default>1</show_in_default>
651
+ <show_in_website>1</show_in_website>
652
+ <show_in_store>1</show_in_store>
653
+ </active>
654
+ <channel translate="label">
655
+ <label>Channel ID</label>
656
+ <frontend_type>text</frontend_type>
657
+ <sort_order>40</sort_order>
658
+ <show_in_default>1</show_in_default>
659
+ <show_in_website>1</show_in_website>
660
+ <show_in_store>1</show_in_store>
661
+ </channel>
662
+ <recognition translate="label">
663
+ <label>Recognition</label>
664
+ <frontend_type>select</frontend_type>
665
+ <source_model>hcd/system_config_source_recognition</source_model>
666
+ <sort_order>60</sort_order>
667
+ <show_in_default>1</show_in_default>
668
+ <show_in_website>1</show_in_website>
669
+ <show_in_store>1</show_in_store>
670
+ </recognition>
671
+ <invioce translate="label">
672
+ <label>Automatically invoiced</label>
673
+ <frontend_type>select</frontend_type>
674
+ <source_model>adminhtml/system_config_source_yesno</source_model>
675
+ <sort_order>70</sort_order>
676
+ <show_in_default>1</show_in_default>
677
+ <show_in_website>1</show_in_website>
678
+ <show_in_store>1</show_in_store>
679
+ </invioce>
680
+ <sort_order translate="label">
681
+ <label>Sort order</label>
682
+ <frontend_type>text</frontend_type>
683
+ <sort_order>110</sort_order>
684
+ <show_in_default>1</show_in_default>
685
+ <show_in_website>1</show_in_website>
686
+ <show_in_store>1</show_in_store>
687
+ </sort_order>
688
+ <min_amount translate="label">
689
+ <label>Minimum Amount (CENT)</label>
690
+ <frontend_type>text</frontend_type>
691
+ <sort_order>120</sort_order>
692
+ <show_in_default>1</show_in_default>
693
+ <show_in_website>1</show_in_website>
694
+ <show_in_store>1</show_in_store>
695
+ </min_amount>
696
+ <max_amount translate="label">
697
+ <label>Maximum Amount (CENT)</label>
698
+ <frontend_type>text</frontend_type>
699
+ <sort_order>130</sort_order>
700
+ <show_in_default>1</show_in_default>
701
+ <show_in_website>1</show_in_website>
702
+ <show_in_store>1</show_in_store>
703
+ </max_amount>
704
+ <allowspecific translate="label">
705
+ <label>allow specific countries</label>
706
+ <frontend_type>allowspecific</frontend_type>
707
+ <sort_order>140</sort_order>
708
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
709
+ <show_in_default>1</show_in_default>
710
+ <show_in_website>1</show_in_website>
711
+ <show_in_store>1</show_in_store>
712
+ </allowspecific>
713
+ <specificcountry translate="label">
714
+ <label>specific countries</label>
715
+ <frontend_type>multiselect</frontend_type>
716
+ <sort_order>150</sort_order>
717
+ <source_model>adminhtml/system_config_source_country</source_model>
718
+ <show_in_default>1</show_in_default>
719
+ <show_in_website>1</show_in_website>
720
+ <show_in_store>1</show_in_store>
721
+ </specificcountry>
722
+ </fields>
723
+ </hcdgp>
724
+ <hcdbs translate="label">
725
+ <label>Heidelpay Billsafe (hcd)</label>
726
+ <frontend_type>text</frontend_type>
727
+ <sort_order>100</sort_order>
728
+ <show_in_default>1</show_in_default>
729
+ <show_in_website>1</show_in_website>
730
+ <show_in_store>1</show_in_store>
731
+ <fields>
732
+ <title translate="label">
733
+ <label>Title</label>
734
+ <frontend_type>text</frontend_type>
735
+ <sort_order>10</sort_order>
736
+ <show_in_default>1</show_in_default>
737
+ <show_in_website>1</show_in_website>
738
+ <show_in_store>1</show_in_store>
739
+ </title>
740
+ <active translate="label">
741
+ <label>Enabled</label>
742
+ <frontend_type>select</frontend_type>
743
+ <source_model>adminhtml/system_config_source_yesno</source_model>
744
+ <sort_order>20</sort_order>
745
+ <show_in_default>1</show_in_default>
746
+ <show_in_website>1</show_in_website>
747
+ <show_in_store>1</show_in_store>
748
+ </active>
749
+ <channel translate="label">
750
+ <label>Channel ID</label>
751
+ <frontend_type>text</frontend_type>
752
+ <sort_order>40</sort_order>
753
+ <show_in_default>1</show_in_default>
754
+ <show_in_website>1</show_in_website>
755
+ <show_in_store>1</show_in_store>
756
+ </channel>
757
+ <sort_order translate="label">
758
+ <label>Sort order</label>
759
+ <frontend_type>text</frontend_type>
760
+ <sort_order>110</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
+ </sort_order>
765
+ <min_amount translate="label">
766
+ <label>Minimum Amount (CENT)</label>
767
+ <frontend_type>text</frontend_type>
768
+ <sort_order>120</sort_order>
769
+ <show_in_default>1</show_in_default>
770
+ <show_in_website>1</show_in_website>
771
+ <show_in_store>1</show_in_store>
772
+ </min_amount>
773
+ <max_amount translate="label">
774
+ <label>Maximum Amount (CENT)</label>
775
+ <frontend_type>text</frontend_type>
776
+ <sort_order>130</sort_order>
777
+ <show_in_default>1</show_in_default>
778
+ <show_in_website>1</show_in_website>
779
+ <show_in_store>1</show_in_store>
780
+ </max_amount>
781
+ <allowspecific translate="label">
782
+ <label>allow specific countries</label>
783
+ <frontend_type>allowspecific</frontend_type>
784
+ <sort_order>140</sort_order>
785
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
786
+ <show_in_default>1</show_in_default>
787
+ <show_in_website>1</show_in_website>
788
+ <show_in_store>1</show_in_store>
789
+ </allowspecific>
790
+ <specificcountry translate="label">
791
+ <label>specific countries</label>
792
+ <frontend_type>multiselect</frontend_type>
793
+ <sort_order>150</sort_order>
794
+ <source_model>adminhtml/system_config_source_country</source_model>
795
+ <show_in_default>1</show_in_default>
796
+ <show_in_website>1</show_in_website>
797
+ <show_in_store>1</show_in_store>
798
+ </specificcountry>
799
+ </fields>
800
+ </hcdbs>
801
+ <hcdpal translate="label">
802
+ <label>Heidelpay Pay Pal (hcd)</label>
803
+ <frontend_type>text</frontend_type>
804
+ <sort_order>70</sort_order>
805
+ <show_in_default>1</show_in_default>
806
+ <show_in_website>1</show_in_website>
807
+ <show_in_store>1</show_in_store>
808
+ <fields>
809
+ <title translate="label">
810
+ <label>Title</label>
811
+ <frontend_type>text</frontend_type>
812
+ <sort_order>10</sort_order>
813
+ <show_in_default>1</show_in_default>
814
+ <show_in_website>1</show_in_website>
815
+ <show_in_store>1</show_in_store>
816
+ </title>
817
+ <active translate="label">
818
+ <label>Enabled</label>
819
+ <frontend_type>select</frontend_type>
820
+ <source_model>adminhtml/system_config_source_yesno</source_model>
821
+ <sort_order>20</sort_order>
822
+ <show_in_default>1</show_in_default>
823
+ <show_in_website>1</show_in_website>
824
+ <show_in_store>1</show_in_store>
825
+ </active>
826
+ <channel translate="label">
827
+ <label>Channel ID</label>
828
+ <frontend_type>text</frontend_type>
829
+ <sort_order>40</sort_order>
830
+ <show_in_default>1</show_in_default>
831
+ <show_in_website>1</show_in_website>
832
+ <show_in_store>1</show_in_store>
833
+ </channel>
834
+ <bookingmode translate="label">
835
+ <label>Bookingmode</label>
836
+ <frontend_type>select</frontend_type>
837
+ <source_model>hcd/system_config_source_bookingmode</source_model>
838
+ <sort_order>50</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
+ </bookingmode>
843
+ <invioce translate="label">
844
+ <label>Automatically invoiced</label>
845
+ <frontend_type>select</frontend_type>
846
+ <source_model>adminhtml/system_config_source_yesno</source_model>
847
+ <sort_order>70</sort_order>
848
+ <show_in_default>1</show_in_default>
849
+ <show_in_website>1</show_in_website>
850
+ <show_in_store>1</show_in_store>
851
+ </invioce>
852
+ <!--<capture_on_delivery translate="label">
853
+ <label>Automatically capture on delivery</label>
854
+ <frontend_type>select</frontend_type>
855
+ <source_model>adminhtml/system_config_source_yesno</source_model>
856
+ <comment>please note that capture on delivery is only possible, when you set bookingmode to preauthorisation</comment>
857
+ <sort_order>80</sort_order>
858
+ <show_in_default>1</show_in_default>
859
+ <show_in_website>1</show_in_website>
860
+ <show_in_store>1</show_in_store>
861
+ </capture_on_delivery>-->
862
+ <sort_order translate="label">
863
+ <label>Sort order</label>
864
+ <frontend_type>text</frontend_type>
865
+ <sort_order>110</sort_order>
866
+ <show_in_default>1</show_in_default>
867
+ <show_in_website>1</show_in_website>
868
+ <show_in_store>1</show_in_store>
869
+ </sort_order>
870
+ <min_amount translate="label">
871
+ <label>Minimum Amount (CENT)</label>
872
+ <frontend_type>text</frontend_type>
873
+ <sort_order>120</sort_order>
874
+ <show_in_default>1</show_in_default>
875
+ <show_in_website>1</show_in_website>
876
+ <show_in_store>1</show_in_store>
877
+ </min_amount>
878
+ <max_amount translate="label">
879
+ <label>Maximum Amount (CENT)</label>
880
+ <frontend_type>text</frontend_type>
881
+ <sort_order>130</sort_order>
882
+ <show_in_default>1</show_in_default>
883
+ <show_in_website>1</show_in_website>
884
+ <show_in_store>1</show_in_store>
885
+ </max_amount>
886
+ <allowspecific translate="label">
887
+ <label>allow specific countries</label>
888
+ <frontend_type>allowspecific</frontend_type>
889
+ <sort_order>140</sort_order>
890
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
891
+ <show_in_default>1</show_in_default>
892
+ <show_in_website>1</show_in_website>
893
+ <show_in_store>1</show_in_store>
894
+ </allowspecific>
895
+ <specificcountry translate="label">
896
+ <label>specific countries</label>
897
+ <frontend_type>multiselect</frontend_type>
898
+ <sort_order>150</sort_order>
899
+ <source_model>adminhtml/system_config_source_country</source_model>
900
+ <show_in_default>1</show_in_default>
901
+ <show_in_website>1</show_in_website>
902
+ <show_in_store>1</show_in_store>
903
+ </specificcountry>
904
+ </fields>
905
+ </hcdpal>
906
+ <hcdeps translate="label">
907
+ <label>Heidelpay EPS (hcd)</label>
908
+ <frontend_type>text</frontend_type>
909
+ <sort_order>150</sort_order>
910
+ <show_in_default>1</show_in_default>
911
+ <show_in_website>1</show_in_website>
912
+ <show_in_store>1</show_in_store>
913
+ <fields>
914
+ <title translate="label">
915
+ <label>Title</label>
916
+ <frontend_type>text</frontend_type>
917
+ <sort_order>10</sort_order>
918
+ <show_in_default>1</show_in_default>
919
+ <show_in_website>1</show_in_website>
920
+ <show_in_store>1</show_in_store>
921
+ </title>
922
+ <active translate="label">
923
+ <label>Enabled</label>
924
+ <frontend_type>select</frontend_type>
925
+ <source_model>adminhtml/system_config_source_yesno</source_model>
926
+ <sort_order>20</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>
930
+ </active>
931
+ <channel translate="label">
932
+ <label>Channel ID</label>
933
+ <frontend_type>text</frontend_type>
934
+ <sort_order>40</sort_order>
935
+ <show_in_default>1</show_in_default>
936
+ <show_in_website>1</show_in_website>
937
+ <show_in_store>1</show_in_store>
938
+ </channel>
939
+ <invioce translate="label">
940
+ <label>Automatically invoiced</label>
941
+ <frontend_type>select</frontend_type>
942
+ <source_model>adminhtml/system_config_source_yesno</source_model>
943
+ <sort_order>70</sort_order>
944
+ <show_in_default>1</show_in_default>
945
+ <show_in_website>1</show_in_website>
946
+ <show_in_store>1</show_in_store>
947
+ </invioce>
948
+ <sort_order translate="label">
949
+ <label>Sort order</label>
950
+ <frontend_type>text</frontend_type>
951
+ <sort_order>110</sort_order>
952
+ <show_in_default>1</show_in_default>
953
+ <show_in_website>1</show_in_website>
954
+ <show_in_store>1</show_in_store>
955
+ </sort_order>
956
+ <min_amount translate="label">
957
+ <label>Minimum Amount (CENT)</label>
958
+ <frontend_type>text</frontend_type>
959
+ <sort_order>120</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>
963
+ </min_amount>
964
+ <max_amount translate="label">
965
+ <label>Maximum Amount (CENT)</label>
966
+ <frontend_type>text</frontend_type>
967
+ <sort_order>130</sort_order>
968
+ <show_in_default>1</show_in_default>
969
+ <show_in_website>1</show_in_website>
970
+ <show_in_store>1</show_in_store>
971
+ </max_amount>
972
+ <allowspecific translate="label">
973
+ <label>allow specific countries</label>
974
+ <frontend_type>allowspecific</frontend_type>
975
+ <sort_order>140</sort_order>
976
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
977
+ <show_in_default>1</show_in_default>
978
+ <show_in_website>1</show_in_website>
979
+ <show_in_store>1</show_in_store>
980
+ </allowspecific>
981
+ <specificcountry translate="label">
982
+ <label>specific countries</label>
983
+ <frontend_type>multiselect</frontend_type>
984
+ <sort_order>150</sort_order>
985
+ <source_model>adminhtml/system_config_source_country</source_model>
986
+ <show_in_default>1</show_in_default>
987
+ <show_in_website>1</show_in_website>
988
+ <show_in_store>1</show_in_store>
989
+ </specificcountry>
990
+ </fields>
991
+ </hcdeps>
992
+ <hcdide translate="label">
993
+ <label>Heidelpay iDeal (hcd)</label>
994
+ <frontend_type>text</frontend_type>
995
+ <sort_order>160</sort_order>
996
+ <show_in_default>1</show_in_default>
997
+ <show_in_website>1</show_in_website>
998
+ <show_in_store>1</show_in_store>
999
+ <fields>
1000
+ <title translate="label">
1001
+ <label>Title</label>
1002
+ <frontend_type>text</frontend_type>
1003
+ <sort_order>10</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
+ </title>
1008
+ <active translate="label">
1009
+ <label>Enabled</label>
1010
+ <frontend_type>select</frontend_type>
1011
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1012
+ <sort_order>20</sort_order>
1013
+ <show_in_default>1</show_in_default>
1014
+ <show_in_website>1</show_in_website>
1015
+ <show_in_store>1</show_in_store>
1016
+ </active>
1017
+ <channel translate="label">
1018
+ <label>Channel ID</label>
1019
+ <frontend_type>text</frontend_type>
1020
+ <sort_order>40</sort_order>
1021
+ <show_in_default>1</show_in_default>
1022
+ <show_in_website>1</show_in_website>
1023
+ <show_in_store>1</show_in_store>
1024
+ </channel>
1025
+ <invioce translate="label">
1026
+ <label>Automatically invoiced</label>
1027
+ <frontend_type>select</frontend_type>
1028
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1029
+ <sort_order>70</sort_order>
1030
+ <show_in_default>1</show_in_default>
1031
+ <show_in_website>1</show_in_website>
1032
+ <show_in_store>1</show_in_store>
1033
+ </invioce>
1034
+ <sort_order translate="label">
1035
+ <label>Sort order</label>
1036
+ <frontend_type>text</frontend_type>
1037
+ <sort_order>110</sort_order>
1038
+ <show_in_default>1</show_in_default>
1039
+ <show_in_website>1</show_in_website>
1040
+ <show_in_store>1</show_in_store>
1041
+ </sort_order>
1042
+ <min_amount translate="label">
1043
+ <label>Minimum Amount (CENT)</label>
1044
+ <frontend_type>text</frontend_type>
1045
+ <sort_order>120</sort_order>
1046
+ <show_in_default>1</show_in_default>
1047
+ <show_in_website>1</show_in_website>
1048
+ <show_in_store>1</show_in_store>
1049
+ </min_amount>
1050
+ <max_amount translate="label">
1051
+ <label>Maximum Amount (CENT)</label>
1052
+ <frontend_type>text</frontend_type>
1053
+ <sort_order>130</sort_order>
1054
+ <show_in_default>1</show_in_default>
1055
+ <show_in_website>1</show_in_website>
1056
+ <show_in_store>1</show_in_store>
1057
+ </max_amount>
1058
+ <allowspecific translate="label">
1059
+ <label>allow specific countries</label>
1060
+ <frontend_type>allowspecific</frontend_type>
1061
+ <sort_order>140</sort_order>
1062
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
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
+ </allowspecific>
1067
+ <specificcountry translate="label">
1068
+ <label>specific countries</label>
1069
+ <frontend_type>multiselect</frontend_type>
1070
+ <sort_order>150</sort_order>
1071
+ <source_model>adminhtml/system_config_source_country</source_model>
1072
+ <show_in_default>1</show_in_default>
1073
+ <show_in_website>1</show_in_website>
1074
+ <show_in_store>1</show_in_store>
1075
+ </specificcountry>
1076
+ </fields>
1077
+ </hcdide>
1078
+ <hcdpp translate="label">
1079
+ <label>Heidelpay Prepayment (hcd)</label>
1080
+ <frontend_type>text</frontend_type>
1081
+ <sort_order>100</sort_order>
1082
+ <show_in_default>1</show_in_default>
1083
+ <show_in_website>1</show_in_website>
1084
+ <show_in_store>1</show_in_store>
1085
+ <fields>
1086
+ <title translate="label">
1087
+ <label>Title</label>
1088
+ <frontend_type>text</frontend_type>
1089
+ <sort_order>10</sort_order>
1090
+ <show_in_default>1</show_in_default>
1091
+ <show_in_website>1</show_in_website>
1092
+ <show_in_store>1</show_in_store>
1093
+ </title>
1094
+ <active translate="label">
1095
+ <label>Enabled</label>
1096
+ <frontend_type>select</frontend_type>
1097
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1098
+ <sort_order>20</sort_order>
1099
+ <show_in_default>1</show_in_default>
1100
+ <show_in_website>1</show_in_website>
1101
+ <show_in_store>1</show_in_store>
1102
+ </active>
1103
+ <channel translate="label">
1104
+ <label>Channel ID</label>
1105
+ <frontend_type>text</frontend_type>
1106
+ <sort_order>40</sort_order>
1107
+ <show_in_default>1</show_in_default>
1108
+ <show_in_website>1</show_in_website>
1109
+ <show_in_store>1</show_in_store>
1110
+ </channel>
1111
+ <invioce translate="label">
1112
+ <label>Automatically invoiced</label>
1113
+ <frontend_type>select</frontend_type>
1114
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1115
+ <sort_order>70</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
+ </invioce>
1120
+ <sort_order translate="label">
1121
+ <label>Sort order</label>
1122
+ <frontend_type>text</frontend_type>
1123
+ <sort_order>110</sort_order>
1124
+ <show_in_default>1</show_in_default>
1125
+ <show_in_website>1</show_in_website>
1126
+ <show_in_store>1</show_in_store>
1127
+ </sort_order>
1128
+ <min_amount translate="label">
1129
+ <label>Minimum Amount (CENT)</label>
1130
+ <frontend_type>text</frontend_type>
1131
+ <sort_order>120</sort_order>
1132
+ <show_in_default>1</show_in_default>
1133
+ <show_in_website>1</show_in_website>
1134
+ <show_in_store>1</show_in_store>
1135
+ </min_amount>
1136
+ <max_amount translate="label">
1137
+ <label>Maximum Amount (CENT)</label>
1138
+ <frontend_type>text</frontend_type>
1139
+ <sort_order>130</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
+ </max_amount>
1144
+ <allowspecific translate="label">
1145
+ <label>allow specific countries</label>
1146
+ <frontend_type>allowspecific</frontend_type>
1147
+ <sort_order>140</sort_order>
1148
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1149
+ <show_in_default>1</show_in_default>
1150
+ <show_in_website>1</show_in_website>
1151
+ <show_in_store>1</show_in_store>
1152
+ </allowspecific>
1153
+ <specificcountry translate="label">
1154
+ <label>specific countries</label>
1155
+ <frontend_type>multiselect</frontend_type>
1156
+ <sort_order>150</sort_order>
1157
+ <source_model>adminhtml/system_config_source_country</source_model>
1158
+ <show_in_default>1</show_in_default>
1159
+ <show_in_website>1</show_in_website>
1160
+ <show_in_store>1</show_in_store>
1161
+ </specificcountry>
1162
+ </fields>
1163
+ </hcdpp>
1164
+ <hcdiv translate="label">
1165
+ <label>Heidelpay Invoice (hcd)</label>
1166
+ <frontend_type>text</frontend_type>
1167
+ <sort_order>110</sort_order>
1168
+ <show_in_default>1</show_in_default>
1169
+ <show_in_website>1</show_in_website>
1170
+ <show_in_store>1</show_in_store>
1171
+ <fields>
1172
+ <title translate="label">
1173
+ <label>Title</label>
1174
+ <frontend_type>text</frontend_type>
1175
+ <sort_order>10</sort_order>
1176
+ <show_in_default>1</show_in_default>
1177
+ <show_in_website>1</show_in_website>
1178
+ <show_in_store>1</show_in_store>
1179
+ </title>
1180
+ <active translate="label">
1181
+ <label>Enabled</label>
1182
+ <frontend_type>select</frontend_type>
1183
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1184
+ <sort_order>20</sort_order>
1185
+ <show_in_default>1</show_in_default>
1186
+ <show_in_website>1</show_in_website>
1187
+ <show_in_store>1</show_in_store>
1188
+ </active>
1189
+ <channel translate="label">
1190
+ <label>Channel ID</label>
1191
+ <frontend_type>text</frontend_type>
1192
+ <sort_order>40</sort_order>
1193
+ <show_in_default>1</show_in_default>
1194
+ <show_in_website>1</show_in_website>
1195
+ <show_in_store>1</show_in_store>
1196
+ </channel>
1197
+ <invioce translate="label">
1198
+ <label>Automatically invoiced</label>
1199
+ <frontend_type>select</frontend_type>
1200
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1201
+ <sort_order>70</sort_order>
1202
+ <show_in_default>1</show_in_default>
1203
+ <show_in_website>1</show_in_website>
1204
+ <show_in_store>1</show_in_store>
1205
+ </invioce>
1206
+ <sort_order translate="label">
1207
+ <label>Sort order</label>
1208
+ <frontend_type>text</frontend_type>
1209
+ <sort_order>110</sort_order>
1210
+ <show_in_default>1</show_in_default>
1211
+ <show_in_website>1</show_in_website>
1212
+ <show_in_store>1</show_in_store>
1213
+ </sort_order>
1214
+ <min_amount translate="label">
1215
+ <label>Minimum Amount (CENT)</label>
1216
+ <frontend_type>text</frontend_type>
1217
+ <sort_order>120</sort_order>
1218
+ <show_in_default>1</show_in_default>
1219
+ <show_in_website>1</show_in_website>
1220
+ <show_in_store>1</show_in_store>
1221
+ </min_amount>
1222
+ <max_amount translate="label">
1223
+ <label>Maximum Amount (CENT)</label>
1224
+ <frontend_type>text</frontend_type>
1225
+ <sort_order>130</sort_order>
1226
+ <show_in_default>1</show_in_default>
1227
+ <show_in_website>1</show_in_website>
1228
+ <show_in_store>1</show_in_store>
1229
+ </max_amount>
1230
+ <allowspecific translate="label">
1231
+ <label>allow specific countries</label>
1232
+ <frontend_type>allowspecific</frontend_type>
1233
+ <sort_order>140</sort_order>
1234
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1235
+ <show_in_default>1</show_in_default>
1236
+ <show_in_website>1</show_in_website>
1237
+ <show_in_store>1</show_in_store>
1238
+ </allowspecific>
1239
+ <specificcountry translate="label">
1240
+ <label>specific countries</label>
1241
+ <frontend_type>multiselect</frontend_type>
1242
+ <sort_order>150</sort_order>
1243
+ <source_model>adminhtml/system_config_source_country</source_model>
1244
+ <show_in_default>1</show_in_default>
1245
+ <show_in_website>1</show_in_website>
1246
+ <show_in_store>1</show_in_store>
1247
+ </specificcountry>
1248
+ </fields>
1249
+ </hcdiv>
1250
+ <hcdivsec translate="label">
1251
+ <label>Heidelpay invoice secured(hcd)</label>
1252
+ <frontend_type>text</frontend_type>
1253
+ <sort_order>115</sort_order>
1254
+ <show_in_default>1</show_in_default>
1255
+ <show_in_website>1</show_in_website>
1256
+ <show_in_store>1</show_in_store>
1257
+ <fields>
1258
+ <title translate="label">
1259
+ <label>Title</label>
1260
+ <frontend_type>text</frontend_type>
1261
+ <sort_order>10</sort_order>
1262
+ <show_in_default>1</show_in_default>
1263
+ <show_in_website>1</show_in_website>
1264
+ <show_in_store>1</show_in_store>
1265
+ </title>
1266
+ <active translate="label">
1267
+ <label>Enabled</label>
1268
+ <frontend_type>select</frontend_type>
1269
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1270
+ <sort_order>20</sort_order>
1271
+ <show_in_default>1</show_in_default>
1272
+ <show_in_website>1</show_in_website>
1273
+ <show_in_store>1</show_in_store>
1274
+ </active>
1275
+ <channel translate="label">
1276
+ <label>Channel ID</label>
1277
+ <frontend_type>text</frontend_type>
1278
+ <sort_order>40</sort_order>
1279
+ <show_in_default>1</show_in_default>
1280
+ <show_in_website>1</show_in_website>
1281
+ <show_in_store>1</show_in_store>
1282
+ </channel>
1283
+ <recognition translate="label">
1284
+ <label>Recognition</label>
1285
+ <frontend_type>select</frontend_type>
1286
+ <source_model>hcd/system_config_source_recognition</source_model>
1287
+ <sort_order>60</sort_order>
1288
+ <show_in_default>1</show_in_default>
1289
+ <show_in_website>1</show_in_website>
1290
+ <show_in_store>1</show_in_store>
1291
+ </recognition>
1292
+ <invioce translate="label">
1293
+ <label>Automatically invoiced</label>
1294
+ <frontend_type>select</frontend_type>
1295
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1296
+ <sort_order>70</sort_order>
1297
+ <show_in_default>1</show_in_default>
1298
+ <show_in_website>1</show_in_website>
1299
+ <show_in_store>1</show_in_store>
1300
+ </invioce>
1301
+ <sort_order translate="label">
1302
+ <label>Sort order</label>
1303
+ <frontend_type>text</frontend_type>
1304
+ <sort_order>110</sort_order>
1305
+ <show_in_default>1</show_in_default>
1306
+ <show_in_website>1</show_in_website>
1307
+ <show_in_store>1</show_in_store>
1308
+ </sort_order>
1309
+ <min_amount translate="label">
1310
+ <label>Minimum Amount (CENT)</label>
1311
+ <frontend_type>text</frontend_type>
1312
+ <sort_order>120</sort_order>
1313
+ <show_in_default>1</show_in_default>
1314
+ <show_in_website>1</show_in_website>
1315
+ <show_in_store>1</show_in_store>
1316
+ </min_amount>
1317
+ <max_amount translate="label">
1318
+ <label>Maximum Amount (CENT)</label>
1319
+ <frontend_type>text</frontend_type>
1320
+ <sort_order>130</sort_order>
1321
+ <show_in_default>1</show_in_default>
1322
+ <show_in_website>1</show_in_website>
1323
+ <show_in_store>1</show_in_store>
1324
+ </max_amount>
1325
+ <allowspecific translate="label">
1326
+ <label>allow specific countries</label>
1327
+ <frontend_type>allowspecific</frontend_type>
1328
+ <sort_order>140</sort_order>
1329
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1330
+ <show_in_default>1</show_in_default>
1331
+ <show_in_website>1</show_in_website>
1332
+ <show_in_store>1</show_in_store>
1333
+ </allowspecific>
1334
+ <specificcountry translate="label">
1335
+ <label>specific countries</label>
1336
+ <frontend_type>multiselect</frontend_type>
1337
+ <sort_order>150</sort_order>
1338
+ <source_model>adminhtml/system_config_source_country</source_model>
1339
+ <show_in_default>1</show_in_default>
1340
+ <show_in_website>1</show_in_website>
1341
+ <show_in_store>1</show_in_store>
1342
+ </specificcountry>
1343
+ </fields>
1344
+ </hcdivsec>
1345
+ <hcdpf translate="label">
1346
+ <label>Heidelpay Postfinance (hcd)</label>
1347
+ <frontend_type>text</frontend_type>
1348
+ <sort_order>140</sort_order>
1349
+ <show_in_default>1</show_in_default>
1350
+ <show_in_website>1</show_in_website>
1351
+ <show_in_store>1</show_in_store>
1352
+ <fields>
1353
+ <title translate="label">
1354
+ <label>Title</label>
1355
+ <frontend_type>text</frontend_type>
1356
+ <sort_order>10</sort_order>
1357
+ <show_in_default>1</show_in_default>
1358
+ <show_in_website>1</show_in_website>
1359
+ <show_in_store>1</show_in_store>
1360
+ </title>
1361
+ <active translate="label">
1362
+ <label>Enabled</label>
1363
+ <frontend_type>select</frontend_type>
1364
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1365
+ <sort_order>20</sort_order>
1366
+ <show_in_default>1</show_in_default>
1367
+ <show_in_website>1</show_in_website>
1368
+ <show_in_store>1</show_in_store>
1369
+ </active>
1370
+ <channel translate="label">
1371
+ <label>Channel ID</label>
1372
+ <frontend_type>text</frontend_type>
1373
+ <sort_order>40</sort_order>
1374
+ <show_in_default>1</show_in_default>
1375
+ <show_in_website>1</show_in_website>
1376
+ <show_in_store>1</show_in_store>
1377
+ </channel>
1378
+ <invioce translate="label">
1379
+ <label>Automatically invoiced</label>
1380
+ <frontend_type>select</frontend_type>
1381
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1382
+ <sort_order>70</sort_order>
1383
+ <show_in_default>1</show_in_default>
1384
+ <show_in_website>1</show_in_website>
1385
+ <show_in_store>1</show_in_store>
1386
+ </invioce>
1387
+ <sort_order translate="label">
1388
+ <label>Sort order</label>
1389
+ <frontend_type>text</frontend_type>
1390
+ <sort_order>110</sort_order>
1391
+ <show_in_default>1</show_in_default>
1392
+ <show_in_website>1</show_in_website>
1393
+ <show_in_store>1</show_in_store>
1394
+ </sort_order>
1395
+ <min_amount translate="label">
1396
+ <label>Minimum Amount (CENT)</label>
1397
+ <frontend_type>text</frontend_type>
1398
+ <sort_order>120</sort_order>
1399
+ <show_in_default>1</show_in_default>
1400
+ <show_in_website>1</show_in_website>
1401
+ <show_in_store>1</show_in_store>
1402
+ </min_amount>
1403
+ <max_amount translate="label">
1404
+ <label>Maximum Amount (CENT)</label>
1405
+ <frontend_type>text</frontend_type>
1406
+ <sort_order>130</sort_order>
1407
+ <show_in_default>1</show_in_default>
1408
+ <show_in_website>1</show_in_website>
1409
+ <show_in_store>1</show_in_store>
1410
+ </max_amount>
1411
+ <allowspecific translate="label">
1412
+ <label>allow specific countries</label>
1413
+ <frontend_type>allowspecific</frontend_type>
1414
+ <sort_order>140</sort_order>
1415
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1416
+ <show_in_default>1</show_in_default>
1417
+ <show_in_website>1</show_in_website>
1418
+ <show_in_store>1</show_in_store>
1419
+ </allowspecific>
1420
+ <specificcountry translate="label">
1421
+ <label>specific countries</label>
1422
+ <frontend_type>multiselect</frontend_type>
1423
+ <sort_order>150</sort_order>
1424
+ <source_model>adminhtml/system_config_source_country</source_model>
1425
+ <show_in_default>1</show_in_default>
1426
+ <show_in_website>1</show_in_website>
1427
+ <show_in_store>1</show_in_store>
1428
+ </specificcountry>
1429
+ </fields>
1430
+ </hcdpf>
1431
+ <hcdmpa translate="label">
1432
+ <label>Heidelpay MasterPass (hcd)</label>
1433
+ <frontend_type>text</frontend_type>
1434
+ <sort_order>140</sort_order>
1435
+ <show_in_default>1</show_in_default>
1436
+ <show_in_website>1</show_in_website>
1437
+ <show_in_store>1</show_in_store>
1438
+ <fields>
1439
+ <title translate="label">
1440
+ <label>Title</label>
1441
+ <frontend_type>text</frontend_type>
1442
+ <sort_order>10</sort_order>
1443
+ <show_in_default>1</show_in_default>
1444
+ <show_in_website>1</show_in_website>
1445
+ <show_in_store>1</show_in_store>
1446
+ </title>
1447
+ <active translate="label">
1448
+ <label>Enabled</label>
1449
+ <frontend_type>select</frontend_type>
1450
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1451
+ <sort_order>20</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
+ </active>
1456
+ <channel translate="label">
1457
+ <label>Channel ID</label>
1458
+ <frontend_type>text</frontend_type>
1459
+ <sort_order>40</sort_order>
1460
+ <show_in_default>1</show_in_default>
1461
+ <show_in_website>1</show_in_website>
1462
+ <show_in_store>1</show_in_store>
1463
+ </channel>
1464
+ <bookingmode translate="label">
1465
+ <label>Bookingmode</label>
1466
+ <frontend_type>select</frontend_type>
1467
+ <source_model>hcd/system_config_source_bookingmode</source_model>
1468
+ <sort_order>50</sort_order>
1469
+ <show_in_default>1</show_in_default>
1470
+ <show_in_website>1</show_in_website>
1471
+ <show_in_store>1</show_in_store>
1472
+ </bookingmode>
1473
+ <invioce translate="label">
1474
+ <label>Automatically invoiced</label>
1475
+ <frontend_type>select</frontend_type>
1476
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1477
+ <sort_order>70</sort_order>
1478
+ <show_in_default>1</show_in_default>
1479
+ <show_in_website>1</show_in_website>
1480
+ <show_in_store>1</show_in_store>
1481
+ </invioce>
1482
+ <!--<capture_on_delivery translate="label">
1483
+ <label>Automatically capture on delivery</label>
1484
+ <frontend_type>select</frontend_type>
1485
+ <source_model>adminhtml/system_config_source_yesno</source_model>
1486
+ <comment>please note that capture on delivery is only possible, when you set bookingmode to preauthorisation</comment>
1487
+ <sort_order>80</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
+ </capture_on_delivery>-->
1492
+ <sort_order translate="label">
1493
+ <label>Sort order</label>
1494
+ <frontend_type>text</frontend_type>
1495
+ <sort_order>110</sort_order>
1496
+ <show_in_default>1</show_in_default>
1497
+ <show_in_website>1</show_in_website>
1498
+ <show_in_store>1</show_in_store>
1499
+ </sort_order>
1500
+ <min_amount translate="label">
1501
+ <label>Minimum Amount (CENT)</label>
1502
+ <frontend_type>text</frontend_type>
1503
+ <sort_order>120</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
+ </min_amount>
1508
+ <max_amount translate="label">
1509
+ <label>Maximum Amount (CENT)</label>
1510
+ <frontend_type>text</frontend_type>
1511
+ <sort_order>130</sort_order>
1512
+ <show_in_default>1</show_in_default>
1513
+ <show_in_website>1</show_in_website>
1514
+ <show_in_store>1</show_in_store>
1515
+ </max_amount>
1516
+ <allowspecific translate="label">
1517
+ <label>allow specific countries</label>
1518
+ <frontend_type>allowspecific</frontend_type>
1519
+ <sort_order>140</sort_order>
1520
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
1521
+ <show_in_default>1</show_in_default>
1522
+ <show_in_website>1</show_in_website>
1523
+ <show_in_store>1</show_in_store>
1524
+ </allowspecific>
1525
+ <specificcountry translate="label">
1526
+ <label>specific countries</label>
1527
+ <frontend_type>multiselect</frontend_type>
1528
+ <sort_order>150</sort_order>
1529
+ <source_model>adminhtml/system_config_source_country</source_model>
1530
+ <show_in_default>1</show_in_default>
1531
+ <show_in_website>1</show_in_website>
1532
+ <show_in_store>1</show_in_store>
1533
+ </specificcountry>
1534
+ </fields>
1535
+ </hcdmpa>
1536
+ </groups>
1537
+ </payment>
1538
+ </sections>
1539
+ </config>
app/code/community/HeidelpayCD/Edition/Edition/sql/hcd_setup/install-15.1.30.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * install method
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $installer = $this;
17
+ $installer->startSetup();
18
+
19
+ /**
20
+ * create transactions table
21
+ */
22
+ $tablerealname = 'hcd/transaction';
23
+ $tablename = $installer->getTable($tablerealname);
24
+ if ($installer->getConnection()->isTableExists($tablename) != true) {
25
+ $table = $installer->getConnection()
26
+ ->newTable($tablename)
27
+ ->addColumn(
28
+ 'id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
29
+ array(
30
+ 'unsigned' => true,
31
+ 'nullable' => false,
32
+ 'primary' => true,
33
+ 'identity' => true,
34
+ 'auto_increment' => true
35
+ )
36
+ )
37
+ ->addColumn(
38
+ 'payment_methode', Varien_Db_Ddl_Table::TYPE_VARCHAR, 2,
39
+ array(
40
+ 'nullable' => false)
41
+ )
42
+ ->addColumn(
43
+ 'payment_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 2,
44
+ array(
45
+ 'nullable' => false
46
+ )
47
+ )
48
+ ->addColumn(
49
+ 'transactionid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50,
50
+ array(
51
+ 'nullable' => false,
52
+ 'COMMENT' => "normaly the order or basketId"
53
+ )
54
+ )
55
+ ->addColumn(
56
+ 'uniqeid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 32,
57
+ array(
58
+ 'nullable' => false,
59
+ 'COMMENT' => "heidelpay uniqe identification number"
60
+ )
61
+ )
62
+ ->addColumn(
63
+ 'shortid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 14,
64
+ array(
65
+ 'nullable' => false,
66
+ 'COMMENT' => "heidelpay sort identification number"
67
+ )
68
+ )
69
+ ->addColumn(
70
+ 'result', Varien_Db_Ddl_Table::TYPE_VARCHAR, 3,
71
+ array(
72
+ 'nullable' => false,
73
+ 'COMMENT' => "heidelpay processing result"
74
+ )
75
+ )
76
+ ->addColumn(
77
+ 'statuscode', Varien_Db_Ddl_Table::TYPE_SMALLINT, null,
78
+ array(
79
+ 'unsigned' => true,
80
+ 'nullable' => false,
81
+ 'COMMENT' => "heidelpay processing status code"
82
+ )
83
+ )
84
+ ->addColumn(
85
+ 'return', Varien_Db_Ddl_Table::TYPE_VARCHAR, 100,
86
+ array(
87
+ 'nullable' => false,
88
+ 'COMMENT' => "heidelpay processing return message"
89
+ )
90
+ )
91
+ ->addColumn(
92
+ 'returncode', Varien_Db_Ddl_Table::TYPE_VARCHAR, 12,
93
+ array(
94
+ 'nullable' => false,
95
+ 'COMMENT' => "heidelpay processing return code"
96
+ )
97
+ )
98
+ ->addColumn(
99
+ 'jsonresponse', Varien_Db_Ddl_Table::TYPE_BLOB, null,
100
+ array(
101
+ 'nullable' => false,
102
+ 'COMMENT' => "heidelpay response as json"
103
+ )
104
+ )
105
+ ->addColumn(
106
+ 'datetime', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null,
107
+ array(
108
+ 'nullable' => false,
109
+ 'COMMENT' => "create date"
110
+ )
111
+ )
112
+ ->addColumn(
113
+ 'source', Varien_Db_Ddl_Table::TYPE_VARCHAR, 100,
114
+ array(
115
+ 'nullable' => false,
116
+ 'COMMENT' => "heidelpay processing return message"
117
+ )
118
+ )
119
+ ->addIndex($installer->getIdxName($tablerealname, array('uniqeid')), array('uniqeid'))
120
+ ->addIndex($installer->getIdxName($tablerealname, array('transactionid')), array('transactionid'))
121
+ ->addIndex($installer->getIdxName($tablerealname, array('returncode')), array('returncode'))
122
+ ->addIndex($installer->getIdxName($tablerealname, array('source')), array('source'));
123
+ $installer->getConnection()->createTable($table);
124
+ }
125
+
126
+ /**
127
+ * create customer data table
128
+ */
129
+ $tablerealname = 'hcd/customer';
130
+ $tablename = $installer->getTable($tablerealname);
131
+ if ($installer->getConnection()->isTableExists($tablename) != true) {
132
+ $table = $installer->getConnection()
133
+ ->newTable($tablename)
134
+ ->addColumn(
135
+ 'id', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
136
+ array(
137
+ 'unsigned' => true,
138
+ 'nullable' => false,
139
+ 'primary' => true,
140
+ 'identity' => true,
141
+ 'auto_increment' => true
142
+ )
143
+ )
144
+ ->addColumn(
145
+ 'paymentmethode', Varien_Db_Ddl_Table::TYPE_VARCHAR, 10,
146
+ array(
147
+ 'nullable' => false)
148
+ )
149
+ ->addColumn(
150
+ 'uniqeid', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50,
151
+ array(
152
+ 'nullable' => false,
153
+ 'COMMENT' => "Heidelpay transaction identifier"
154
+ )
155
+ )
156
+ ->addColumn(
157
+ 'customerid', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
158
+ array(
159
+ 'unsigned' => true,
160
+ 'nullable' => false,
161
+ 'COMMENT' => "magento customer id"
162
+ )
163
+ )
164
+ ->addColumn(
165
+ 'storeid', Varien_Db_Ddl_Table::TYPE_INTEGER, null,
166
+ array(
167
+ 'unsigned' => true,
168
+ 'nullable' => false,
169
+ 'COMMENT' => "magento store id"
170
+ )
171
+ )
172
+ ->addColumn(
173
+ 'payment_data', Varien_Db_Ddl_Table::TYPE_BLOB, null,
174
+ array(
175
+ 'nullable' => false,
176
+ 'COMMENT' => "custumer payment data"
177
+ )
178
+ )
179
+ ->addIndex($installer->getIdxName($tablerealname, array('uniqeid')), array('uniqeid'))
180
+ ->addIndex($installer->getIdxName($tablerealname, array('customerid')), array('customerid'))
181
+ ->addIndex($installer->getIdxName($tablerealname, array('storeid')), array('storeid'))
182
+ ->addIndex($installer->getIdxName($tablerealname, array('paymentmethode')), array('paymentmethode'));
183
+ $installer->getConnection()->createTable($table);
184
+ }
185
+
186
+
187
+
188
+ $installer->endSetup();
app/code/community/HeidelpayCD/Edition/Helper/AbstractHelper.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Helper/BasketApi.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Helper/Data.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Helper/OrderState.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Helper/Payment.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Helper/Validator.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/LICENSE.txt ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ==== ENGLISH VERSION BELOW ====
3
+
4
+ Lizenzvereinbarung Plug-in
5
+
6
+ I. Präambel
7
+
8
+ Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der Heidelberger Payment GmbH (nachfolgend „heidelpay“).
9
+
10
+ Das Plug-in von heidelpay ist ein Software-Programm, welches die Schnittstelle zum Payment-System von heidelpay mit einer Anwendung (zum Beispiel: Shopsystem, Warenwirtschaft, Debitorenmanagement etc.) verbindet. Das Plug-in dient dem Datenaustausch zwischen dem Payment-System von heidelpay und der Anwendung. Das Plug-in erweitert den Funktionsumfang der Anwendung hinsichtlich der mit heidelpay gesondert vertraglich vereinbarten Leistungen.
11
+
12
+ Diese Vereinbarung regelt die Bestimmungen unter denen heidelpay die Nutzung des zur Verfügung gestellten Plug-in gestattet.
13
+
14
+ Dies vorausgeschickt, treffen der Nutzer und heidelpay die folgende Vereinbarung:
15
+
16
+ II. Begriffsbestimmungen
17
+
18
+ Object Code Die maschinenlesbare, übersetzte Form des Plug-ins.
19
+
20
+ Plug-in Das unter dieser Lizenzvereinbarung angebotene Programm, das von heidelpay nach den Bestim-mungen dieser Lizenzvereinbarung verbreitet oder öffentlich zugänglich gemacht hat.
21
+
22
+ Source Code Die für Menschen lesbare, in Programmiersprache dargestellte Form des Plug-in.
23
+
24
+ Verändern Jede Erweiterung, Kürzung und Bearbeitung des Plug-ins, insbesondere Weiterentwicklungen
25
+
26
+ Verbreiten Die öffentliche Weitergabe des Plug-ins, biespielsweise das Bereitstellen zum Download auf öffent-lich zugänglichen Internetseiten.
27
+
28
+ III. Geltenden Bestimmungen
29
+
30
+ Im Falle eines zwischen dem Nutzer und heidelpay abgeschlossenen Händlervertrages für die Abwicklung der dort bestimmten Leistungen, gilt der Händlervertrag ab Vertragsschluss und gilt in diesem Fall zusätzlich zu dieser Ver-einbarung. Im Falle des Widerspruchs zwischen dieser Vereinbarung und dem Händlervertrag hat der Händlerver-trag Vorrang.
31
+
32
+ IV. Lizenz
33
+
34
+ 1. Diese Vereinbarung räumt nur solchen Nutzern Nutzungsrechte ein, die Unternehmer im Sinne des BGB sind. Eine Nutzung durch Verbraucher ist nicht gestattet.
35
+ 2. Die von heidelpay im Rahmen dieser Vereinbarung gewährte Lizenz, ist für den Nutzer unentgeltlich.
36
+ 3. Unter der Voraussetzung der Einhaltung der Bestimmungen dieser Vereinbarung, erteilt heidelpay dem Nut-zer das zeitlich unbefristete, widerrufliche, räumlich auf Europa begrenzte Recht, das Plug-in zu verändern, unverändert oder in veränderter Form zu dem in der Präambel dargestellten Zweck für geschäftliche Zwecke zu nutzen, d.h. das Plug-in zu speichern, ablaufen zu lassen, zu vervielfältigen, zu verbreiten und öffentlich zugänglich zu machen.
37
+ 4. Heidelpay kann neue Versionen/Updates des Plug-ins anbieten, die zum Beispiel Fehlerbehebungen und neue Funktionalitäten beinhalten können. Heidelpay empfiehlt daher die regelmässige Überprüfung der Ak-tualität des Plug-in, dies wird auf der Seite http://dev.heidelpay.de veröffentlicht. Auch diese neuen Versio-nen/Updates unterliegen den Bedingungen dieser Vereinbarung.
38
+
39
+ V. Beschränkungen
40
+
41
+ 1. Durch diese Vereinbarung erfolgt keine Übertragung jedweder Schutzrechte von heidelpay.
42
+ 2. Das Recht, das Plug-in zu verändern und diese veränderte Version zu vervielfältigen, zu verbreiten oder öf-fentlich zugänglich zu machen, setzt voraus, dass
43
+ a. die im Source Code bzw. Object Code enthaltenen Hinweise auf diese Lizenz erhalten bleiben; und
44
+ b. alle Hinweise und Vermerke im Source Code bzw. Object Code, hinsichtlich des Urhebers des Plug-in un-verändert bleiben; und
45
+ c. ein deutlicher Hinweis erteilt wird, dass es sich um eine veränderte Version des Plug-in handelt, eine Do-kumentation darüber, welche Teile verändert wurden, mitgeliefert wird; und
46
+ d. Heidelpay für sämtliche aus der Veränderung resultierende Ansprüche freigestellt wird und zudem das veränderte Plug-in mit einer Klarstellung versehen wird, dass heidelpay für das Plug-in in der veränderten Form keine Haftung übernimmt; und
47
+ e. das veränderte Plug-in unter einer Lizenzvereinbarung zur Verfügung gestellt wird, die das Interesse von heidelpay entsprechend den Bedingungen dieser Vereinbarung schützt; und
48
+ f. die im Zusammenhang mit dem Plug-in angezeigten rechtlichen Hinweise nicht entfernt, verdeckt oder abgeändert werden.
49
+ 3. Der Nutzer sichert zu, dass er bei der Nutzung des Plug-in von heidelpay die geltenden nationalen und inter-nationalen Gesetze einhält;
50
+ 4. Der Nutzer sichert zu, heidelpay unverzüglich zu informieren, wenn Dritte ihm gegenüber Ansprüche im Zu-sammenhang mit dem Plug-in anmelden und/oder behaupten, das Plug-in verletze Rechte Dritter, und hei-delpay alle Dokumente und/oder Informationen zur Verfügung zu stellen, die der Nutzer im Zusammenhang mit einem solchen Anspruch erhält.
51
+
52
+ VI. Datenschutz
53
+
54
+ Es gelten die Datenschutzbestimmugen, abrufbar unter https://dev.heidelpay.de/datenschutzerklaerung/ .
55
+
56
+ VII. FREISTELLUNG
57
+
58
+ Der Nutzer erklärt sich einverstanden, heidelpay, deren Tochtergesellschaften, angeschlossenen Unternehmen, Geschäftsführer, leitenden Angestellten, Mitarbeiter, Vertreter, Geschäftspartner und Lizenzgeber gegen alle An-sprüche oder Forderungen Dritter, einschließlich Gerichtskosten, angemessener Anwaltsgebühren und Sachver-ständigenkosten, freizustellen, die entstehen weil:
59
+ (a) die Nutzung des Plug-ins von heidelpay unter Verletzung der Bestimmungen dieser Vereinbarung erfolgt; oder
60
+ (b) der Nutzer gegen geltende Gesetze oder aufsichtsrechtliche Bestimmungen verstösst oder
61
+ (c) der Nutzer seine Identität in einer falschen, betrügerischen, böswilligen oder unzutreffenden Weise dar-stellt.
62
+
63
+ VIII. TECHNISCHER SUPPORT
64
+
65
+ Heidelpay kann dem Nutzer, welcher das Plug-in in unverändertem Zustand nutzt, Support zur Verfügung stellen. Hierzu bedarf es einer gesonderten Vereinbarung zwischen dem Nutzer und heidelpay.
66
+
67
+ IX.LAUFZEIT UND KÜNDIGUNG
68
+
69
+ 1. Diese Vereinbarung kann von den Parteien jederzeit fristlos gekündigt werden.
70
+ 2. Es steht heidelpay frei, das Downloadangebot jederzeit einzustellen.
71
+ 3. Alle Rechte des Nutzers aus dieser Vereinbarung erlöschen unmittelbar, sobald der Nutzer wesentliche Best-immungen dieser Vereinbarung verletzt.
72
+ 4. Sobald diese Vereinbarung beendet ist oder der Nutzer seine Rechte gemäss Ziffer 3 verliert, hat der Nutzer sämtliche Kopien des Plug-ins (und alle entsprechenden Sicherungen) zu löschen.
73
+
74
+ X. HAFTUNG
75
+
76
+ 1. Da die Lizenz unentgeltlich zur Verfügung gestellt wird, handelt es sich um einen Schenkungsvertrag, Daher haftet heidelpay für etwaige Schäden nur gem. § 524 BGB.
77
+ 2. Soweit ein Schaden - unmittelbar oder mittelbar - auf einem Datenverlust beruht und heidelpay nach Ziffer 1 hierfür haftbar gemacht werden kann, ist die Haftung von heidelpay auf den Wiederherstellungsaufwand be-schränkt, der bei regelmäßiger gefahrentsprechender Datensicherung eingetreten wäre.
78
+ 3. Ansprüche auf Schadensersatz, ausgenommen solche aus einer vorsätzlichen oder grob fahrlässigen Pflicht-verletzung, einer Verletzung des Lebens, des Körpers, der Gesundheit, unerlaubter Handlung oder aus dem Produkthaftungsgesetz, verjähren spätestens in einem Jahr von dem Zeitpunkt an, an dem die geschädigte Partei von dem Schaden und den Umständen, aus denen sich die Anspruchsberechtigung ergibt, Kenntnis er-langt, ohne Rücksicht auf Kenntnis drei Jahre ab dem schädigenden Ereignis. Kürzere gesetzliche Verjäh-rungsfristen bleiben unberührt.
79
+
80
+ XI. Schlussbestimmungen
81
+
82
+ 1. Diese Vereinbarung unterliegt den Gesetzen der Bundesrepublik Deutschland unter Ausschluss des UN-Kaufrechts. Der ausschließliche Gerichtsstand ist das Landgericht Heidelberg.
83
+ 2. In einige Länder, inklusive der Vereinigten Staaten von Amerika, gelten Exportbeschränkungen. Das Plug-in kann solchen Beschränkungen unterliegen. Diese sind insbesondere zu beachten, als das Plug-in in andere Länder exportiert wird. Wenn der Nutzer das Plug-in exportiert, ist allein er für die Einhaltung der maßgebli-chen Regelungen verantwortlich. In jedem Fall ist es untersagt, das Plug-in in ein Land zu exportieren, wel-ches einem Embargo der Vereinigten Staaten von Amerika oder der Europäischen Union unterliegt, oder ei-ner Person zu überlassen, an die eine Lieferung nach U.S. amerikanischen oder europäischen Regelung un-tersagt ist.
84
+ 3. Diese Bestimmungen oder die Nutzung des Plug-ins begründet kein Joint Venture, keine Teilhaberschaft, kei-ne Beschäftigung mit heidelpay und keine Befugnis zur Vertretung von heidelpay.
85
+ 4. Die Bestimmungen der Abschnitte IV, V, VI, VII, X, XI. überdauern die Beendigung dieser Bestimmungen, gleich aus welchem Grund.
86
+
87
+ ==== ENGLISH VERSION ====
88
+
89
+ Plug-in Licence Agreement
90
+
91
+ I. Introduction
92
+
93
+ This Plug-in Licence Agreement (hereinafter 'Agreement') constitutes a contract between the plug-in user and Heidelberger Payment GmbH (hereinafter 'heidelpay').
94
+
95
+ The plug-in from heidelpay is a software programme which links the heidelpay payment system interface to an application (for example, shop system, merchandise management, debtor management etc.). The plug-in is used to exchange data between the heidelpay payment system and the application. The plug-in expands the range of features in the application with regard to the services agreed separately with heidelpay.
96
+
97
+ This Agreement sets out the terms and conditions under which heidelpay permits the use of the plug-in provided.
98
+
99
+ This having been said, the user and heidelpay agree the following:
100
+
101
+ II. Definitions
102
+
103
+ Object code Machine-readable, translated form of the plug-in.
104
+
105
+ Plug-in Programme offered under this Licence Agreement, which heidelpay has distributed or made availa-ble in the public domain in accordance with the terms and conditions of this Licence Agreement.
106
+
107
+ Source code Human-readable form of the programme presented in programming language.
108
+
109
+ Modify Any upgrade, reduction, adaptation of the plug-in, in particular enhancements
110
+
111
+ Distribute Public distribution of the plug-in, for example, making available for download on websites accessible to the general public.
112
+
113
+ III. Applicable terms and conditions
114
+
115
+ In the event that a merchant agreement has been reached between the user and heidelpay regarding the execu-tion of services defined therein, the merchant agreement shall apply from the respective date on which the agreement was reached and in this case shall apply in addition to this Agreement. In the event of a contradiction between this Agreement and the merchant agreement, the merchant agreement shall have priority.
116
+
117
+ IV. Licence
118
+
119
+ 1. This Agreement shall only grant rights of use to users who are entrepreneurs within the meaning of the Ger-man Civil Code (BGB). Use by consumers shall not be permitted.
120
+ 2. The licence granted by heidelpay under the terms of this Agreement shall be free of charge to the user.
121
+ 3. Subject to compliance with the terms and conditions set out in this Agreement, heidelpay shall grant the user a revocable right for an unlimited period and exclusively in Europe to modify the plug-in, use it for business purposes in unmodified or modified form for the purpose indicated in the introduction, i.e. to save the plug-in, run it, copy it, distribute it and make it accessible to the general public.
122
+ 4. heidelpay may offer new versions/updates of the plug-in which may contain bug fixes and new features, for example. heidelpay therefore recommends regular checking to ensure the plug-in is up-to-date. Details are published on the website at http://dev.heidelpay.de. Said new versions/updates shall also be subject to the terms and conditions in this Agreement.
123
+
124
+ V. Restrictions
125
+
126
+ 1. This Agreement shall not confer industrial property rights of any kind from heidelpay.
127
+ 2. The right to modify the plug-in and to copy, distribute or make such modified version available to the general public requires that
128
+ a. the references to this licence in the source code or object code remain intact; and
129
+ b. all references and notes in the source code or object code regarding the author of the plug-in remain unchanged; and
130
+ c. a clear indication is given that it is a modified version of the plug-in and documentation regarding the parts that have been modified is provided; and
131
+ d. heidelpay is exempted from any claims resulting from modification and clarification is also provided with the modified plug-in that heidelpay shall not accept any liability for the plug-in in its modified form; and
132
+ e. the modified plug-in is provided under a licence agreement, which protects heidelpay's interests in ac-cordance with the terms and conditions in this Agreement; and
133
+ f. the legal information indicated in connection with the plug-in are not removed, hidden or altered.
134
+ 3. The user guarantees compliance with applicable national and international legislation when using the plug-in from heidelpay;
135
+ 4. The user undertakes to inform heidelpay immediately if third parties file and/or assert claims against the user in connection with the plug-in, the plug-in infringes third party rights, and to provide heidelpay with all docu-mentation and/or information that the user receives in connection with such claims.
136
+
137
+ VI. Data protection
138
+
139
+ The data protection regulations, which are available from https://dev.heidelpay.de/datenschutzerklaerung/ shall apply.
140
+
141
+ VII. INDEMNITY
142
+
143
+ The user agrees to exempt heidelpay, its subsidiary companies, affiliated companies, managing directors, senior executives, employees, representatives, business partners and franchising companies from any claims or de-mands by third parties, including legal costs, reasonable solicitors' fees and experts' fees, which are incurred be-cause:
144
+ (a) use of the plug-in from heidelpay breaches the terms and conditions of this Agreement; or
145
+ (b) the user breaches applicable legislation or regulatory provisions or
146
+ (c) the user falsifies their identity or presents it in a malicious or inappropriate manner.
147
+
148
+ VIII. TECHNICAL SUPPORT
149
+
150
+ heidelpay can make support available to users using the plug-in in an unmodified state. A separate agreement be-tween the user and heidelpay shall be required for this.
151
+
152
+ IX. TERM AND TERMINATION
153
+
154
+ 1. This Agreement may be terminated by the parties at any time without notice.
155
+ 2. heidelpay shall be at liberty to stop the download offer at any time.
156
+ 3. All rights on the part of the user arising from this Agreement shall expire immediately as soon as the user breaches essential provisions in this Agreement.
157
+ 4. As soon as this Agreement is terminated or the user loses their rights pursuant to 3, the user shall delete all copies of the plug-in (and all corresponding back-ups).
158
+
159
+ X. LIABILITY
160
+
161
+ 1. Since the licence is made available free of charge, it constitutes a deed of gift and therefore heidelpay shall only be liable for damages pursuant to Section 524 BGB.
162
+ 2. Insofar as damage is based, directly or indirectly, on a loss of data and heidelpay can be held liable for this pursuant to 1, liability on the part of heidelpay shall be limited to the costs of recovery that would have arisen from data backups made at regularly scheduled intervals in accordance with the risk involved.
163
+ 3. Claims for compensation with the exception of those arising from a deliberate or grossly negligent breach of obligations, injury to life, limb or health, unlawful act or arising from the Product Liability Act, shall expire by limitation no later than one year from the date on which the injured party becomes aware of the damage and the circumstances giving rise to entitlement to claim, and, regardless of awareness, three years from the re-spective damage-causing event. Shorter statutory periods of limitation shall remain unaffected.
164
+
165
+ XI. Final provisions
166
+
167
+ 1. This Agreement shall be subject to the laws of the Federal Republic of Germany, excluding the United Nations Convention on Contracts for the International Sale of Goods (CISG). The sole place of jurisdiction shall be the Heidelberg District Court.
168
+ 2. Export restrictions shall apply in some countries, including the United States of America. The plug-in may be subject to such restrictions. These must be considered in particular when the plug-in is exported to other countries. If a user exports the plug-in, they shall be solely responsible for compliance with the relevant regu-lations. It shall be prohibited in any case to export the plug-in to a country which is subject to an embargo by the United States of America or the European Union, or give it to a person to whom delivery is prohibited in accordance with US or European regulations.
169
+ 3. These terms and conditions or use of the plug-in shall not constitute a joint venture, partnership or employ-ment with heidelpay or authority to represent heidelpay.
170
+ 4. The terms and conditions in Sections IV, V, VI, VII, X, XI shall outlast the termination of these terms and condi-tions, regardless of the reason.
app/code/community/HeidelpayCD/Edition/Model/Customer.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Mysql4/Customer.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Mysql4/Customer/Collection.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Mysql4/Transaction.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Mysql4/Transaction/Collection.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Observer.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Order/Pdf/Invoice.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Abstract.php CHANGED
@@ -725,13 +725,12 @@ class HeidelpayCD_Edition_Model_Payment_Abstract extends Mage_Payment_Model_Meth
725
 
726
  $order = $payment->getOrder();
727
  $this->log('StoreId' . $order->getStoreId());
728
- $authorisation = array();
729
  if ($this->canCapture()) {
730
- $authorisation = Mage::getModel('hcd/transaction');
731
  /**
732
  * @var $authorisation HeidelpayCD_Edition_Model_Transaction
733
  */
734
- $authorisation->getOneTransactionByMethode(
735
  $order->getRealOrderId(),
736
  'PA'
737
  );
725
 
726
  $order = $payment->getOrder();
727
  $this->log('StoreId' . $order->getStoreId());
 
728
  if ($this->canCapture()) {
729
+ $authorisationModel = Mage::getModel('hcd/transaction');
730
  /**
731
  * @var $authorisation HeidelpayCD_Edition_Model_Transaction
732
  */
733
+ $authorisation = $authorisationModel->getOneTransactionByMethode(
734
  $order->getRealOrderId(),
735
  'PA'
736
  );
app/code/community/HeidelpayCD/Edition/Model/Payment/AbstractSecuredPaymentMethods.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/HcdDirectDebitSecured.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/HcdInvoiceSecured.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdbs.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdcc.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcddc.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcddd.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdeps.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdgp.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdide.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdiv.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdmk.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdmpa.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpal.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpf.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdpp.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdsu.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Payment/Hcdyt.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Resource/Encryption.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Resource/Setup.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/System/Config/Source/Bookingmode.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/System/Config/Source/Recognition.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/System/Config/Source/Returnurl.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/Model/Transaction.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/4c8c379f94d64fd3813dffb260e8bdd6)](https://www.codacy.com/app/heidelpay/magento-cd-edition?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=heidelpay/magento-cd-edition&amp;utm_campaign=Badge_Grade)
3
+
4
+ ![Logo](https://dev.heidelpay.de/devHeidelpay_400_180.jpg)
5
+
6
+ # heidelpay payment extension for magento 1
7
+
8
+ This extension for Magento >=1.8 provides a direct integration of the heidelpay payment methods to your magento shop.
9
+
10
+ Currently supported payment methods are:
11
+ * credit card
12
+ * debit card
13
+ * SEPA direct debit
14
+ * Giropay
15
+ * Sofort
16
+ * PayPal
17
+ * prepayment
18
+ * invoice unsecured
19
+ * EPS
20
+ * iDeal
21
+ * BillSafe
22
+ * Postfinance
23
+ * SEPA direct debit secured
24
+
25
+ For more information please visit - https://dev.heidelpay.de/magento/
26
+
27
+ ## SYSTEM REQUIREMENTS
28
+
29
+ This extension requires PHP 5.6 or PHP 7.0
30
+
31
+
32
+ ## LICENSE
33
+
34
+ You can find a copy of this license in [LICENSE.txt](LICENSE.txt).
35
+
36
+ ## Installation
37
+
38
+ A manual can be fund on https://dev.heidelpay.de/handbuch-magento-cd-edition-plugin/ (DE)
app/code/community/HeidelpayCD/Edition/controllers/CheckoutController.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/controllers/IndexController.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/controllers/ResponseController.php CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <HeidelpayCD_Edition>
5
- <version>17.3.30</version>
6
  </HeidelpayCD_Edition>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <HeidelpayCD_Edition>
5
+ <version>17.5.17</version>
6
  </HeidelpayCD_Edition>
7
  </modules>
8
  <global>
app/code/community/HeidelpayCD/Edition/etc/system.xml CHANGED
File without changes
app/code/community/HeidelpayCD/Edition/sql/hcd_setup/install-15.1.30.php CHANGED
File without changes
app/design/adminhtml/base/default/template/hcd/info/info/pdf/directdebit.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Extend pdf template and add invoice information
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $data = array(
17
+ 'IDENTIFICATION_SHORTID' => '',
18
+ 'CONNECTOR_ACCOUNT_HOLDER' => '',
19
+ 'CONNECTOR_ACCOUNT_IBAN' => '',
20
+ 'CONNECTOR_ACCOUNT_BIC' => ''
21
+
22
+ );
23
+
24
+ $transactionId = ($this->getMethod()
25
+ ->getInfoInstance()
26
+ ->getLastTransId() === false) ? false : $this->getMethod()->getInfoInstance()->getLastTransId();
27
+
28
+ if ($transactionId !== False)
29
+ $data = Mage::getModel('hcd/transaction')->loadLastTransactionDataByUniqeId((string)$transactionId);
30
+
31
+ // title of the payment method
32
+ echo $this->escapeHtml($this->getMethod()->getTitle()); ?>
33
+ {{pdf_row_separator}}
34
+
35
+ {{pdf_row_separator}}
36
+ <?php echo $this->escapeHtml($this->__('The booking contains:')); ?>
37
+ {{pdf_row_separator}}
38
+ <?php echo $this->escapeHtml($this->__('mandate reference ID') . " : " . $data['ACCOUNT_IDENTIFICATION']) ?>
39
+ {{pdf_row_separator}}
40
+ <?php echo $this->escapeHtml($this->__('creditor identifier') . " : " . $data['IDENTIFICATION_CREDITOR_ID']) ?>
app/design/adminhtml/base/default/template/hcd/info/info/pdf/invoice.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Extend pdf template and add invoice information
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $data = array(
17
+ 'IDENTIFICATION_SHORTID' => '',
18
+ 'CONNECTOR_ACCOUNT_HOLDER' => '',
19
+ 'CONNECTOR_ACCOUNT_IBAN' => '',
20
+ 'CONNECTOR_ACCOUNT_BIC' => ''
21
+
22
+ );
23
+
24
+ $transactionId = ($this->getMethod()
25
+ ->getInfoInstance()
26
+ ->getLastTransId() === false) ? false : $this->getMethod()->getInfoInstance()->getLastTransId();
27
+
28
+ if ($transactionId !== False)
29
+ $data = Mage::getModel('hcd/transaction')->loadLastTransactionDataByUniqeId((string)$transactionId);
30
+
31
+ // title of the payment method
32
+ echo $this->escapeHtml($this->getMethod()->getTitle()); ?>
33
+ {{pdf_row_separator}}
34
+ <?php echo $this->escapeHtml($this->__('Holder') . " : " . $data['CONNECTOR_ACCOUNT_HOLDER']) ?>
35
+ {{pdf_row_separator}}
36
+ <?php echo $this->escapeHtml($this->__('IBAN') . " : " . $data['CONNECTOR_ACCOUNT_IBAN']) ?>
37
+ {{pdf_row_separator}}
38
+ <?php echo $this->escapeHtml($this->__('BIC') . " : " . $data['CONNECTOR_ACCOUNT_BIC']) ?>
39
+ {{pdf_row_separator}}
40
+ <?php echo $this->escapeHtml($this->__('Identification'). " : " . $data['IDENTIFICATION_SHORTID']) ?>
41
+
app/design/adminhtml/base/default/template/hcd/info/info/pdf/prepayment.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Extend pdf template and add prepayment information
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $data = array(
17
+ 'IDENTIFICATION_SHORTID' => '',
18
+ 'CONNECTOR_ACCOUNT_HOLDER' => '',
19
+ 'CONNECTOR_ACCOUNT_IBAN' => '',
20
+ 'CONNECTOR_ACCOUNT_BIC' => ''
21
+
22
+ );
23
+
24
+ $transactionId = ($this->getMethod()
25
+ ->getInfoInstance()
26
+ ->getLastTransId() === false) ? false : $this->getMethod()->getInfoInstance()->getLastTransId();
27
+
28
+ if ($transactionId !== False)
29
+ $data = Mage::getModel('hcd/transaction')->loadLastTransactionDataByUniqeId((string)$transactionId);
30
+
31
+ // title of the payment method
32
+ echo $this->escapeHtml($this->getMethod()->getTitle()); ?>
33
+ {{pdf_row_separator}}
34
+ <?php echo $this->escapeHtml($this->__('Holder') . " : " . $data['CONNECTOR_ACCOUNT_HOLDER']) ?>
35
+ {{pdf_row_separator}}
36
+ <?php echo $this->escapeHtml($this->__('IBAN') . " : " . $data['CONNECTOR_ACCOUNT_IBAN']) ?>
37
+ {{pdf_row_separator}}
38
+ <?php echo $this->escapeHtml($this->__('BIC') . " : " . $data['CONNECTOR_ACCOUNT_BIC']) ?>
39
+ {{pdf_row_separator}}
40
+ <?php echo $this->escapeHtml($this->__('Identification'). " : " . $data['IDENTIFICATION_SHORTID']) ?>
app/design/adminhtml/base/default/template/hcd/info/pdf/directdebit.phtml CHANGED
File without changes
app/design/adminhtml/base/default/template/hcd/info/pdf/invoice.phtml CHANGED
File without changes
app/design/adminhtml/base/default/template/hcd/info/pdf/prepayment.phtml CHANGED
File without changes
app/design/adminhtml/default/default/template/hcd/Info/Info/masterpass.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <button type="button" title="MasterPass"
2
+ class="btn-hcdmpa-info"
3
+ onclick="window.open('https://www.mastercard.com/mc_us/wallet/learnmore/<?php
4
+ $lang = Mage::app()->getLocale()->getLocaleCode();
5
+ switch ($lang) {
6
+ case 'de_DE':
7
+ case 'de_AT':
8
+ case 'de_CH':
9
+ echo 'de/DE';
10
+ break;
11
+ case 'fr_FR':
12
+ echo 'fr/FR';
13
+ break;
14
+ case 'en_GB':
15
+ case 'en_US':
16
+ default:
17
+ echo 'en/US';
18
+ break;
19
+ }?>')"
20
+ style="background: url('<?php echo Mage::getDesign()->getSkinUrl('images/hcd/'); ?>masterpass_100_28.jpg'
21
+ ) 0 0 no-repeat; height: 28px; width: 100px;"
22
+ ></button>
app/design/adminhtml/default/default/template/hcd/Info/masterpass.phtml CHANGED
File without changes
app/design/adminhtml/default/default/template/hcd/Info/pdf/invoice.phtml DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- //load transactions data
4
- $data = array(
5
- 'IDENTIFICATION_SHORTID' => '',
6
- 'CONNECTOR_ACCOUNT_HOLDER' => '',
7
- 'CONNECTOR_ACCOUNT_IBAN' => '',
8
- 'CONNECTOR_ACCOUNT_BIC' => ''
9
-
10
- );
11
-
12
- $TransactionId = ($this->getMethod()->getInfoInstance()->getLastTransId() === false) ? false : $this->getMethod()->getInfoInstance()->getLastTransId() ;
13
-
14
- if ($TransactionId !== False)
15
- $data = Mage::getModel('hcd/transaction')->loadLastTransactionDataByUniqeId((string)$TransactionId);
16
-
17
- // titel
18
- echo $this->escapeHtml($this->getMethod()->getTitle()); ?>
19
- {{pdf_row_separator}}
20
- <?php echo $this->__('Holder') . " : " . $this->escapeHtml($data['CONNECTOR_ACCOUNT_HOLDER']) ?>
21
- {{pdf_row_separator}}
22
- <?php echo $this->__('IBAN') . " : " . $this->escapeHtml($data['CONNECTOR_ACCOUNT_IBAN']) ?>
23
- {{pdf_row_separator}}
24
- <?php echo $this->__('BIC') . " : " . $this->escapeHtml($data['CONNECTOR_ACCOUNT_BIC']) ?>
25
- {{pdf_row_separator}}
26
- <?php echo $this->__('Identification'). " : " . $this->escapeHtml($data['IDENTIFICATION_SHORTID']) ?>
27
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/hcd.xml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/Info/Info/debit.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <button type="button" title="MasterPass"
2
+ class="btn-hcdmpa-info"
3
+ onclick="window.open('https://www.mastercard.com/mc_us/wallet/learnmore/<?php
4
+ $lang = Mage::app()->getLocale()->getLocaleCode();
5
+ switch ($lang) {
6
+ case 'de_DE':
7
+ case 'de_AT':
8
+ case 'de_CH':
9
+ echo 'de/DE';
10
+ break;
11
+ case 'fr_FR':
12
+ echo 'fr/FR';
13
+ break;
14
+ case 'en_GB':
15
+ case 'en_US':
16
+ default:
17
+ echo 'en/US';
18
+ break;
19
+ }?>')"
20
+ style="background: url('<?php echo Mage::getDesign()->getSkinUrl('images/hcd/'); ?>masterpass_100_28.jpg'
21
+ ) 0 0 no-repeat;"
22
+ ></button>
23
+ <div class="hcd-masterpass-payment-data-info"><?php echo $this->getMethod()->getPaymentData();?></div>
app/design/frontend/base/default/template/hcd/Info/Info/masterpass.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <button type="button" title="MasterPass"
2
+ class="btn-hcdmpa-info"
3
+ onclick="window.open('https://www.mastercard.com/mc_us/wallet/learnmore/<?php
4
+ $lang = Mage::app()->getLocale()->getLocaleCode();
5
+ switch ($lang) {
6
+ case 'de_DE':
7
+ case 'de_AT':
8
+ case 'de_CH':
9
+ echo 'de/DE';
10
+ break;
11
+ case 'fr_FR':
12
+ echo 'fr/FR';
13
+ break;
14
+ case 'en_GB':
15
+ case 'en_US':
16
+ default:
17
+ echo 'en/US';
18
+ break;
19
+ }?>')"
20
+ style="background: url('<?php echo Mage::getDesign()->getSkinUrl('images/hcd/'); ?>masterpass_100_28.jpg'
21
+ ) 0 0 no-repeat;"
22
+ ></button>
23
+ <div class="hcd-masterpass-payment-data-info"><?php echo $this->getMethod()->getPaymentData();?></div>
app/design/frontend/base/default/template/hcd/Info/debit.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/Info/masterpass.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/button.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/creditcard.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/debit.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/desconly.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/direct-debit-secured.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/eps.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/form/creditcard.phtml ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Credit card form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $data = array();
17
+ $userData = array();
18
+ $payment = '';
19
+
20
+ $code = $this->getMethodCode();
21
+ $payment = $this->getMethod();
22
+
23
+ $path = "payment/" . $code . "/";
24
+ $storeId = Mage::app()->getStore()->getId();
25
+ $recognition = Mage::getStoreConfig($path . 'recognition', $storeId);
26
+ ?>
27
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
28
+
29
+ <?php
30
+ $cId = $this->getMethod()->getCustomerId();
31
+
32
+ if ($recognition == 1 and $cId != 0) { // only if shipping address is unchanged
33
+ $hash = $this->getMethod()->getShippingHash();
34
+ $userData = $this->getMethod()->getCustomerData();
35
+ if (isset($userData['payment_data'])) {
36
+ if ($userData['payment_data']['SHIPPPING_HASH'] != $hash) {
37
+ $userData = array();
38
+ }
39
+ }
40
+ } elseif ($recognition == 2 and $cId != 0) { // allways
41
+ $userData = $this->getMethod()->getCustomerData();
42
+ }
43
+
44
+ if ($recognition != 0) {
45
+ $data = $payment->getHeidelpayUrl(true);
46
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
47
+ $userData = array();
48
+ }
49
+ }
50
+
51
+ ?>
52
+ <label class="hcd-singleline-label" <?php echo (isset($userData['payment_data'])) ? '' : 'style="display: none"';?>>
53
+ <?php if (isset($userData['payment_data']))
54
+ echo $this->htmlEscape(
55
+ str_replace(
56
+ '%CARD%', $userData['payment_data']['ACCOUNT_NUMBER'],
57
+ // @codingStandardsIgnoreLine
58
+ $this->__('You have used the card %CARD% befor, would you like to use this again?')
59
+ )
60
+ ) ?></label>
61
+ <div class="input-box" <?php echo (isset($userData['payment_data'])) ? '' : 'style="display: none"'; ?>>
62
+ <input type="radio"
63
+ onClick="Heidelpay.toggle.getInstance().hpform('<?php echo $this->htmlEscape($code) ?>','false')"
64
+ class="radio hcd-use_again" id="<?php echo $this->htmlEscape($code) ?>_use_again"
65
+ name="<?php echo $this->htmlEscape($code) ?>_use_again" value="0"
66
+ <?php echo (isset($userData['payment_data']) or $recognition == 0) ? 'checked' : ''; ?>>
67
+ <?php echo $this->htmlEscape($this->__('Yes')) ?>
68
+ <input type="radio"
69
+ onClick="Heidelpay.toggle.getInstance().hpform('<?php echo $this->htmlEscape($code) ?>','true')"
70
+ class="radio hcd-use_again" id="<?php echo $this->htmlEscape($code) ?>_use_again"
71
+ name="<?php echo $this->htmlEscape($code) ?>_use_again"
72
+ value="1" <?php echo (empty($userData['payment_data']) and $recognition > 0) ? 'checked' : ''; ?>>
73
+ <?php echo $this->htmlEscape($this->__('No')) ?>
74
+ </div>
75
+
76
+ <?php
77
+ if ($recognition != 0 and $data['PROCESSING_RESULT'] == 'NOK') {
78
+ echo '<div class="hcd-payment-desc hcd-payment-error">'
79
+ . $this->htmlEscape(Mage::helper('hcd/payment')->handleError($data['PROCESSING_RETURN'])) . '</div>';
80
+ } else {
81
+ if ($recognition != 0) {
82
+ ?>
83
+ <div id="<?php echo $this->htmlEscape($code) ?>_hpform"
84
+ <?php echo (isset($userData['payment_data']['ACCOUNT_NUMBER'])) ? 'style="display: none"' : ''; ?>>
85
+
86
+ <iframe id="<?php echo $this->htmlEscape($code) ?>_payment_frame"
87
+ class="<?php echo $this->htmlEscape($code) ?>_payment_frame"
88
+ src="<?php echo $this->htmlEscape(trim($data['FRONTEND_PAYMENT_FRAME_URL'])) ?>"></iframe>
89
+ </div>
90
+
91
+ <?php } ?>
92
+ <div class="hcd-payment-desc">
93
+ <?php echo $this->htmlEscape($this->__('Desc' . $code)); ?>
94
+ </div>
95
+ <?php } ?>
96
+ </div>
app/design/frontend/base/default/template/hcd/form/form/debit.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $code = $this->getMethodCode();
17
+
18
+ $path = "payment/" . $code . "/";
19
+ $storeId = Mage::app()->getStore()->getId();
20
+ $recognition = Mage::getStoreConfig($path . 'recognition', $storeId);
21
+
22
+ /*
23
+ * Look for customer recognition
24
+ */
25
+
26
+ $hash = $this->getMethod()->getShippingHash();
27
+ $userData = array ();
28
+
29
+ $cId = $this->getMethod()->getCustomerId();
30
+
31
+ if ($recognition == 1 and $cId != 0) { // only if shipping address is unchanged
32
+ $hash = $this->getMethod()->getShippingHash();
33
+ $userData = $this->getMethod()->getCustomerData();
34
+ if ($userData !== false and array_key_exists('payment_data', $userData)) {
35
+ if ($userData ['payment_data'] ['SHIPPPING_HASH'] != $hash)
36
+ $userData = array ();
37
+ }
38
+ } elseif ($recognition == 2 and $cId != 0) // allways
39
+ $userData = $this->getMethod()->getCustomerData();
40
+
41
+
42
+
43
+ ?>
44
+ <div class="form-list hcd-payment-info"
45
+ id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
46
+ <div class="input-box">
47
+ <label for="<?php echo $this->htmlEscape($code) ?>_holder"
48
+ class="required hcd-singleline-label"><em>*</em>
49
+ <?php echo $this->htmlEscape($this->__('Owner')) ?></label>
50
+
51
+ <input type="text" title="<?php echo $this->htmlEscape($this->__('Owner:')) ?>"
52
+ class="input-text required-entry" id="<?php echo $this->htmlEscape($code); ?>_holder"
53
+ name="payment[<?php echo $this->htmlEscape($code) ?>_holder]"
54
+ value="<?php echo $this->htmlEscape(
55
+ (isset($userData['payment_data']['ACCOUNT.HOLDER']))
56
+ ? $userData['payment_data']['ACCOUNT.HOLDER'] :$this->getMethod()->getCustomerName()
57
+ ) ?>" />
58
+ </div>
59
+ <div class="input-box">
60
+ <label for="<?php echo $this->htmlEscape($code) ?>_iban"
61
+ class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('IBAN')) ?></label>
62
+
63
+ <input type="text" title="<?php echo $this->htmlEscape($this->__('IBAN')) ?>"
64
+ class="input-text required-entry validate-alphanum" id="<?php echo $this->htmlEscape($code) ?>_iban"
65
+ name="payment[<?php echo $this->htmlEscape($code) ?>_iban]"
66
+ value="<?php if (isset($userData['payment_data']['ACCOUNT.IBAN']))
67
+ echo $this->htmlEscape($userData['payment_data']['ACCOUNT.IBAN']);?>"
68
+ size="25">
69
+ </div>
70
+ <div class="hcd-payment-desc">
71
+ <?php echo $this->htmlEscape($this->__('Desc'.$code));?>
72
+ </div>
73
+ </div>
app/design/frontend/base/default/template/hcd/form/form/desconly.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Description only form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $code=$this->getMethodCode()
17
+ ?>
18
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
19
+ <div class="hcd-payment-desc">
20
+ <?php echo $this->htmlEscape($this->__('Desc'.$code)); ?>
21
+ </div>
22
+ </div>
app/design/frontend/base/default/template/hcd/form/form/direct-debit-secured.phtml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Direct debit secured form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $code = $this->getMethodCode();
17
+ $dobyear = null;
18
+ $dobmounth = null;
19
+ $dobday = null;
20
+
21
+
22
+ $path = "payment/" . $code . "/";
23
+ $storeId = Mage::app()->getStore()->getId();
24
+ $recognition = Mage::getStoreConfig($path . 'recognition', $storeId);
25
+
26
+ $hash = $this->getMethod()->getShippingHash();
27
+ $userData = array();
28
+
29
+ $cId = $this->getMethod()->getCustomerId();
30
+
31
+ if ($recognition == 1 and $cId != 0) { // only if shipping address is unchanged
32
+ $hash = $this->getMethod()->getShippingHash();
33
+ $userData = $this->getMethod()->getCustomerData();
34
+ if ($userData !== false and array_key_exists('payment_data', $userData)) {
35
+ if ($userData ['payment_data'] ['SHIPPPING_HASH'] != $hash) {
36
+ $userData = array();
37
+ }
38
+ }
39
+ } elseif ($recognition == 2 and $cId != 0) {
40
+ $userData = $this->getMethod()->getCustomerData();
41
+ }
42
+
43
+ if (array_key_exists('payment_data', $userData) &&
44
+ array_key_exists('NAME.BIRTHDATE', $userData['payment_data'])
45
+ ) {
46
+ list($dobyear, $dobmounth, $dobday) = explode('-', $userData['payment_data']['NAME.BIRTHDATE']);
47
+ }
48
+
49
+
50
+ ?>
51
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
52
+ <div class="input-box">
53
+ <label for="<?php echo $this->htmlEscape($code) ?>_salutation"
54
+ class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('salutation')) ?>
55
+ </label>
56
+ <select title="<?php echo $this->htmlEscape($this->__('salutation')) ?>"
57
+ name="payment[<?php echo $this->htmlEscape($code) ?>_salutation]">
58
+ <option value="MR"><?php echo $this->htmlEscape($this->__('mr')) ?></option>
59
+ <option value="MRS" <?php if (array_key_exists('payment_data', $userData) and
60
+ array_key_exists('NAME.SALUTATION', $userData['payment_data']) and
61
+ $userData['payment_data']['NAME.SALUTATION'] == 'MRS'
62
+ ) echo 'selected="selected"' ?>>
63
+ <?php echo $this->htmlEscape($this->__('mrs')) ?>
64
+ </option>
65
+ </select>
66
+ </div>
67
+ <div class="input-box">
68
+ <label for="<?php echo $this->htmlEscape($code) ?>_holder"
69
+ class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('Owner')) ?>
70
+ </label>
71
+ <input type="text" title="<?php echo $this->htmlEscape($this->__('Owner:')) ?>"
72
+ class="input-text required-entry" id="<?php echo $this->htmlEscape($code) ?>_holder"
73
+ name="payment[<?php echo $this->htmlEscape($code) ?>_holder]"
74
+ value="<?php
75
+ echo $this->htmlEscape(
76
+ (isset($userData['payment_data']['ACCOUNT.HOLDER']))
77
+ ? $userData['payment_data']['ACCOUNT.HOLDER'] : $this->getMethod()->getCustomerName()
78
+ ) ?>"/>
79
+ </div>
80
+ <div class="input-box">
81
+ <label for="<?php echo $this->htmlEscape($code) ?>_iban"
82
+ class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('IBAN')) ?>
83
+ </label>
84
+
85
+ <input type="text" title="<?php echo $this->htmlEscape($this->__('IBAN')) ?>"
86
+ class="input-text required-entry validate-alphanum"
87
+ id="<?php echo $this->htmlEscape($code) ?>_iban"
88
+ name="payment[<?php echo $this->htmlEscape($code) ?>_iban]"
89
+ value="<?php if (isset($userData['payment_data']['ACCOUNT.IBAN'])) {
90
+ echo $this->htmlEscape($userData['payment_data']['ACCOUNT.IBAN']);
91
+ } ?>"
92
+ size="25">
93
+ </div>
94
+ <div class="input-box">
95
+ <label for="<?php echo $this->htmlEscape($code) ?>_dob"
96
+ class="required hcd-singleline-label"><em>*</em>
97
+ <?php echo $this->htmlEscape($this->__('Date of birth')) ?></label>
98
+ <select title="<?php echo $this->htmlEscape($this->__('day')) ?>"
99
+ name="payment[<?php echo $this->htmlEscape($code) ?>_dobday]">
100
+ <option><?php echo $this->htmlEscape($this->__('day')); ?></option>
101
+ <?php
102
+ $i = 0;
103
+ for ($i = 1; $i <= 31; $i++) {
104
+ $v = sprintf("%02d", $i);
105
+ $selected = ($dobday === $v) ? 'selected="selected"' : '';
106
+ echo '<option value="' . $this->htmlEscape($v) . '" ' . $this->htmlEscape($selected)
107
+ . '>' . $this->htmlEscape($v) . '</option>';
108
+ }
109
+ ?>
110
+ </select>
111
+ </div>
112
+ <div class="input-box">
113
+ <select title="<?php echo $this->htmlEscape($this->__('month')) ?>"
114
+ name="payment[<?php echo $this->htmlEscape($code) ?>_dobmonth]">
115
+ <option><?php echo $this->htmlEscape($this->__('month')); ?></option>
116
+ <?php
117
+ $i = 0;
118
+ for ($i = 1; $i <= 12; $i++) {
119
+ $v = sprintf("%02d", $i);
120
+ $selected = ($dobmounth == $v) ? 'selected="selected"' : '';
121
+ echo '<option value="' . $this->htmlEscape($v) . '" ' . $this->htmlEscape($selected) . '>' .
122
+ $this->htmlEscape($v) . '</option>';
123
+ }
124
+ ?>
125
+ </select>
126
+ </div>
127
+ <div class="input-box">
128
+ <select title="<?php echo $this->htmlEscape($this->__('year')) ?>"
129
+ name="payment[<?php echo $this->htmlEscape($code) ?>_dobyear]">
130
+ <option><?php echo $this->htmlEscape($this->__('year')); ?></option>
131
+ <?php
132
+ $i = 0;
133
+ for ($i = 17; $i <= 80; $i++) {
134
+ // @codingStandardsIgnoreLine should be refactored - issue #2
135
+ $year = date('Y', strtotime("last day of -$i year"));
136
+ $selected = ($dobyear === $year) ? 'selected="selected"' : '';
137
+ echo '<option value="' . $this->htmlEscape($year) . '" ' .
138
+ $this->htmlEscape($selected) . '>' . $this->htmlEscape($year) . '</option>';
139
+ }
140
+ ?>
141
+ </select>
142
+ </div>
143
+ <div class="hcd-payment-desc">
144
+ <?php echo $this->htmlEscape($this->__('Desc' . $code)); ?>
145
+ </div>
146
+
147
+ </div>
app/design/frontend/base/default/template/hcd/form/form/eps.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * EPS form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $payment = '';
17
+
18
+ $code = $this->getMethodCode();
19
+ $payment = $this->getMethod();
20
+
21
+ $data = $payment->getHeidelpayUrl(true);
22
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
23
+ $userData = array();
24
+ }
25
+
26
+ ?>
27
+
28
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
29
+ <?php
30
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
31
+ echo '<div class="hcd-payment-desc hcd-payment-error">' .
32
+ $this->htmlEscape(Mage::helper('hcd/payment')->handleError($data['PROCESSING_RETURN']))
33
+ . '</div>';
34
+ } else {
35
+ ?>
36
+ <label class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('Bank')) ?>
37
+ </label>
38
+ <div class="input-box">
39
+ <select class="input-text required-entry" name="payment[<?php echo $this->htmlEscape($code) ?>_bank]">
40
+ <?php
41
+ foreach (json_decode($data['CONFIG_BRANDS'], true) AS $value => $brand) {
42
+ echo '<option value=' . $this->htmlEscape($value) . ' >' . $this->htmlEscape($brand) . '</option>';
43
+ }
44
+ ?>
45
+ </select>
46
+ </div>
47
+ <div class="input-box">
48
+ <label for="<?php echo $this->htmlEscape($code) ?>_holder" class="required hcd-singleline-label">
49
+ <em>*</em><?php echo $this->htmlEscape($this->__('Owner')) ?></label>
50
+
51
+ <input type="text" title="<?php echo $this->htmlEscape($this->__('Owner:')) ?>"
52
+ class="input-text required-entry" id="<?php echo $this->htmlEscape($code) ?>_holder"
53
+ name="payment[<?php echo $this->htmlEscape($code) ?>_holder]"
54
+ value="<?php echo $this->htmlEscape($this->getMethod()->getCustomerName()) ?>"/>
55
+ </div>
56
+ <div class="hcd-payment-desc">
57
+ <?php echo $this->htmlEscape($this->__('Desc' . $code)); ?>
58
+ </div>
59
+ <?php } ?>
60
+ </div>
app/design/frontend/base/default/template/hcd/form/form/ideal.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ideal form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $payment = '';
17
+
18
+ $code = $this->getMethodCode();
19
+ $payment = $this->getMethod();
20
+
21
+ $data = $payment->getHeidelpayUrl(true);
22
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
23
+ $userData = array();
24
+ }
25
+
26
+ ?>
27
+
28
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
29
+ <?php
30
+ if ($data['PROCESSING_RESULT'] == 'NOK') {
31
+ echo '<div class="hcd-payment-desc hcd-payment-error">' .
32
+ $this->htmlEscape(Mage::helper('hcd/payment')->handleError($data['PROCESSING_RETURN']))
33
+ . '</div>';
34
+ } else {
35
+ ?>
36
+ <label class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('Bank')) ?>
37
+ </label>
38
+ <div class="input-box">
39
+ <select class="input-text required-entry" name="payment[<?php echo $this->htmlEscape($code) ?>_bank]">
40
+ <?php
41
+ foreach (json_decode($data['CONFIG_BRANDS'], true) AS $value => $brand) {
42
+ echo '<option value=' . $this->htmlEscape($value) . ' >' . $this->htmlEscape($brand) . '</option>';
43
+ }
44
+ ?>
45
+ </select>
46
+ </div>
47
+ <div class="input-box">
48
+ <label for="<?php echo $this->htmlEscape($code) ?>_holder" class="required hcd-singleline-label">
49
+ <em>*</em><?php echo $this->htmlEscape($this->__('Owner')) ?></label>
50
+
51
+ <input type="text" title="<?php echo $this->htmlEscape($this->__('Owner:')) ?>"
52
+ class="input-text required-entry" id="<?php echo $this->htmlEscape($code) ?>_holder"
53
+ name="payment[<?php echo $this->htmlEscape($code) ?>_holder]"
54
+ value="<?php echo $this->htmlEscape($this->getMethod()->getCustomerName()) ?>"/>
55
+ </div>
56
+ <div class="hcd-payment-desc">
57
+ <?php echo $this->htmlEscape($this->__('Desc' . $code)); ?>
58
+ </div>
59
+ <?php } ?>
60
+ </div>
app/design/frontend/base/default/template/hcd/form/form/invoice-secured.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Invoice secured form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $code = $this->getMethodCode();
17
+ $dobyear = null;
18
+ $dobmounth = null;
19
+ $dobday = null;
20
+
21
+ $path = "payment/" . $code . "/";
22
+ $storeId = Mage::app()->getStore()->getId();
23
+ $recognition = Mage::getStoreConfig($path . 'recognition', $storeId);
24
+
25
+ $hash = $this->getMethod()->getShippingHash();
26
+ $userData = array();
27
+
28
+ $cId = $this->getMethod()->getCustomerId();
29
+
30
+ if ($recognition == 1 and $cId != 0) {
31
+ // only if shipping address is unchanged
32
+ $hash = $this->getMethod()->getShippingHash();
33
+ $userData = $this->getMethod()->getCustomerData();
34
+ if ($userData !== false and array_key_exists('payment_data', $userData)) {
35
+ if ($userData ['payment_data'] ['SHIPPPING_HASH'] != $hash) {
36
+ $userData = array();
37
+ }
38
+ }
39
+ } elseif ($recognition == 2 and $cId != 0) {
40
+ $userData = $this->getMethod()->getCustomerData();
41
+ }
42
+
43
+ if (array_key_exists('payment_data', $userData) &&
44
+ array_key_exists('NAME.BIRTHDATE', $userData['payment_data'])
45
+ ) {
46
+ list($dobyear, $dobmounth, $dobday) = explode('-', $userData['payment_data']['NAME.BIRTHDATE']);
47
+ }
48
+
49
+ ?>
50
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
51
+ <div class="input-box">
52
+ <label for="<?php echo $this->htmlEscape($code) ?>_salutation"
53
+ class="required hcd-singleline-label"><em>*</em><?php echo $this->htmlEscape($this->__('salutation')) ?>
54
+ </label>
55
+ <select title="<?php echo $this->htmlEscape($this->__('salutation')) ?>"
56
+ name="payment[<?php echo $this->htmlEscape($code) ?>_salutation]">
57
+ <option value="MR"><?php echo $this->htmlEscape($this->__('mr')) ?></option>
58
+ <option value="MRS" <?php if (array_key_exists('payment_data', $userData) and
59
+ array_key_exists('NAME.SALUTATION', $userData['payment_data']) and
60
+ $userData['payment_data']['NAME.SALUTATION'] == 'MRS'
61
+ ) echo 'selected="selected"' ?>>
62
+ <?php echo $this->htmlEscape($this->__('mrs')) ?>
63
+ </option>
64
+ </select>
65
+ </div>
66
+ <div class="input-box">
67
+ <label for="<?php echo $this->htmlEscape($code) ?>_dob"
68
+ class="required hcd-singleline-label"><em>*</em>
69
+ <?php echo $this->htmlEscape($this->__('Date of birth')) ?></label>
70
+ <select title="<?php echo $this->htmlEscape($this->__('day')) ?>"
71
+ name="payment[<?php echo $this->htmlEscape($code) ?>_dobday]">
72
+ <option><?php echo $this->htmlEscape($this->__('day')); ?></option>
73
+ <?php
74
+ $i = 0;
75
+ for ($i = 1; $i <= 31; $i++) {
76
+ $v = sprintf("%02d", $i);
77
+ $selected = ($dobday === $v) ? 'selected="selected"' : '';
78
+ echo '<option value="' . $this->htmlEscape($v) . '" ' . $this->htmlEscape($selected)
79
+ . '>' . $this->htmlEscape($v) . '</option>';
80
+ }
81
+ ?>
82
+ </select>
83
+ </div>
84
+ <div class="input-box">
85
+ <select title="<?php echo $this->htmlEscape($this->__('month')) ?>"
86
+ name="payment[<?php echo $this->htmlEscape($code) ?>_dobmonth]">
87
+ <option><?php echo $this->htmlEscape($this->__('month')); ?></option>
88
+ <?php
89
+ $i = 0;
90
+ for ($i = 1; $i <= 12; $i++) {
91
+ $v = sprintf("%02d", $i);
92
+ $selected = ($dobmounth == $v) ? 'selected="selected"' : '';
93
+ echo '<option value="' . $this->htmlEscape($v) . '" ' . $this->htmlEscape($selected) . '>' .
94
+ $this->htmlEscape($v) . '</option>';
95
+ }
96
+ ?>
97
+ </select>
98
+ </div>
99
+ <div class="input-box">
100
+ <select title="<?php echo $this->htmlEscape($this->__('year')) ?>"
101
+ name="payment[<?php echo $this->htmlEscape($code) ?>_dobyear]">
102
+ <option><?php echo $this->htmlEscape($this->__('year')); ?></option>
103
+ <?php
104
+ $i = 0;
105
+ for ($i = 17; $i <= 80; $i++) {
106
+ // @codingStandardsIgnoreLine should be refactored - issue #2
107
+ $year = date('Y', strtotime("last day of -$i year"));
108
+ $selected = ($dobyear === $year) ? 'selected="selected"' : '';
109
+ echo '<option value="' . $this->htmlEscape($year) . '" ' .
110
+ $this->htmlEscape($selected) . '>' . $this->htmlEscape($year) . '</option>';
111
+ }
112
+ ?>
113
+ </select>
114
+ </div>
115
+ <div class="hcd-payment-desc">
116
+ <?php echo $this->htmlEscape($this->__('Desc' . $code)); ?>
117
+ </div>
118
+ </div>
app/design/frontend/base/default/template/hcd/form/form/masterpass.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Masterpass form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $data = array();
17
+ $userData = array();
18
+ $payment = '';
19
+
20
+ $code=$this->getMethodCode();
21
+
22
+ ?>
23
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
24
+ <div class="hcd-payment-desc" style="border-left: 0px;">
25
+ <button type="button" title="MasterPass"
26
+ class="btn-hcdmpa-payment-data"
27
+ onclick="window.open('https://www.mastercard.com/mc_us/wallet/learnmore/<?php
28
+ $lang = Mage::app()->getLocale()->getLocaleCode();
29
+ switch ($lang) {
30
+ case 'de_DE':
31
+ case 'de_AT':
32
+ case 'de_CH':
33
+ echo 'de/DE';
34
+ break;
35
+ case 'fr_FR':
36
+ echo 'fr/FR';
37
+ break;
38
+ case 'en_GB':
39
+ default:
40
+ echo 'en/US';
41
+ break;
42
+ }?>')"
43
+ ></button>
44
+ <div class="hcd-masterpass-payment-data">
45
+ <?php
46
+ $mpadata = $this->getMethod()->getPaymentData();
47
+ if (!empty($mpadata)) {
48
+ echo $this->htmlEscape($mpadata);
49
+ } else {
50
+ echo '<p>'.$this->htmlEscape($this->__('Deschcdmpa')).'</p>';
51
+ } ?>
52
+ </div>
53
+
54
+
55
+ </div>
56
+ </div>
app/design/frontend/base/default/template/hcd/form/form/postfinance.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Postfinance form template
4
+ *
5
+ * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
+ * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
7
+ *
8
+ * @link https://dev.heidelpay.de/magento
9
+ *
10
+ * @author Jens Richter
11
+ *
12
+ * @package Heidelpay
13
+ * @subpackage Magento
14
+ * @category Magento
15
+ */
16
+ $code=$this->getMethodCode();
17
+ ?>
18
+ <div class="form-list hcd-payment-info" id="payment_form_<?php echo $this->htmlEscape($code) ?>" style="display: none;">
19
+ <div class="input-box">
20
+ <input id="<?php echo $this->htmlEscape($code) ?>_pf" class="radio"
21
+ name="payment[<?php echo $this->htmlEscape($code) ?>_pf]"
22
+ value="PFEFINANCE" autocomplete="off" type="radio">
23
+
24
+ </input>
25
+ <label class="hco-inline-label">Post Finance E-Finance</label>
26
+ </div>
27
+ <div class="input-box">
28
+ <input id="<?php echo $this->htmlEscape($code) ?>_pf" class="radio"
29
+ name="payment[<?php echo $this->htmlEscape($code) ?>_pf]"
30
+ value="PFCARD" autocomplete="off" type="radio">
31
+ </input>
32
+ <label class="hco-inline-label">Post Finance Card</label>
33
+ <br style="clean:both;">
34
+ </div>
35
+ <div>
36
+ <div class="hcd-payment-desc">
37
+ <?php echo $this->htmlEscape($this->__('Deschcdpf'));?>
38
+ </div>
39
+
40
+ </div>
app/design/frontend/base/default/template/hcd/form/giropay.phtml DELETED
@@ -1,45 +0,0 @@
1
- <?php $_code=$this->getMethodCode();
2
-
3
- $path = "payment/".$_code."/";
4
- $storeId = Mage::app()->getStore()->getId();
5
- $recognation = Mage::getStoreConfig($path.'recognition', $storeId);
6
- /*
7
- * Look for customer recognation
8
- */
9
-
10
- $hash = $this->getMethod()->getShippingHash();
11
- $userData = array();
12
- $cId = $this->getMethod()->getCustomerId();
13
-
14
- if ( $recognation == 1 and $cId != 0 ) { // only if shipping address is unchanged
15
- $hash = $this->getMethod()->getShippingHash();
16
- $userData = $this->getMethod()->getCustomerData();
17
- if (array_key_exists('payment_data', $userData)) {
18
- if ( $userData['payment_data']['SHIPPPING_HASH'] != $hash)
19
- $userData = array();
20
- }
21
- } elseif ($recognation == 2 and $cId != 0 ) // allways
22
- $userData = $this->getMethod()->getCustomerData();
23
-
24
- ?>
25
-
26
- <div class="form-list hcd-payment-info" id="payment_form_<?php echo $_code ?>" style="display: none;">
27
- <div class="input-box">
28
- <label for="<?php echo $_code ?>_holder" class="required hcd-singleline-label"><em>*</em><?php echo $this->__('Owner') ?></label>
29
-
30
- <input type="text" title="<?php echo $this->__('Owner:') ?>" class="input-text required-entry" id="<?php echo $_code ?>_holder" name="payment[<?php echo $_code ?>_holder]" value="<?php echo $this->htmlEscape((isset( $userData['payment_data']['ACCOUNT.HOLDER'])) ? $userData['payment_data']['ACCOUNT.HOLDER'] :$this->getMethod()->getCustomerName()) ?>" />
31
- </div>
32
- <div class="input-box" >
33
- <label for="<?php echo $_code ?>_iban" class="required hcd-singleline-label"><em>*</em><?php echo $this->__('Account number or iban') ?></label>
34
-
35
- <input type="text" title="<?php echo $this->__('Account number or iban') ?>" class="input-text required-entry validate-alphanum" id="<?php echo $_code ?>_iban" name="payment[<?php echo $_code ?>_iban]" value="<?php if (isset($userData['payment_data']['ACCOUNT.IBAN'])) echo $this->htmlEscape($userData['payment_data']['ACCOUNT.IBAN']) ; if (isset($userData['payment_data']['ACCOUNT.NUMBER'])) echo $this->htmlEscape($userData['payment_data']['ACCOUNT.NUMBER']) ; ?>" size="25">
36
- </div>
37
- <div class="input-box">
38
- <label for="<?php echo $_code ?>_bic" class="required hcd-singleline-label"><em>*</em><?php echo $this->__('Bank code or bic') ?></label>
39
- <input type="text" title="<?php echo $this->__('Bank code or bic:') ?>" class="input-text required-entry validate-alphanum" id="<?php echo $_code ?>_bic" name="payment[<?php echo $_code ?>_bic]" value="<?php if (isset($userData['payment_data']['ACCOUNT.BIC'])) echo $this->htmlEscape($userData['payment_data']['ACCOUNT.BIC']) ; if (isset($userData['payment_data']['ACCOUNT.BANK'])) echo $this->htmlEscape($userData['payment_data']['ACCOUNT.BANK']) ; ?>" size="25"/>
40
- </div>
41
- <div class="hcd-payment-desc">
42
- <?php echo $this->__('Desc'.$_code);?>
43
- </div>
44
-
45
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/hcd/form/ideal.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/invoice-secured.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/masterpass.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/form/postfinance.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/index.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/mail/hcd_payment_info.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/mail/mail/hcd_payment_info.phtml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Heidelpay info area for creditmemo mails -->
2
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
3
+ <thead>
4
+ <tr>
5
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Zahlungsinformation:</th>
6
+ </tr>
7
+ </thead>
8
+ <tbody>
9
+ <tr>
10
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
11
+ {PAYMENTINFO}
12
+ &nbsp;
13
+ </td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
app/design/frontend/base/default/template/hcd/onepage.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/billing.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/onepage/billing.phtml ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form id="co-billing-form" action="">
2
+ <fieldset>
3
+ <ul class="form-list">
4
+ <?php if ($this->customerHasAddresses()): ?>
5
+ <li class="wide">
6
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
7
+ <div class="input-box">
8
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
9
+ </div>
10
+ </li>
11
+ <?php endif; ?>
12
+ <li id="billing-new-address-form">
13
+ <fieldset>
14
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
15
+ <ul>
16
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
17
+ <li class="fields">
18
+ <div class="field">
19
+ <label for="billing:company"><?php echo $this->__('Company') ?></label>
20
+ <div class="input-box">
21
+ <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
22
+ </div>
23
+ </div>
24
+ <?php if(!$this->isCustomerLoggedIn()): ?>
25
+ <div class="field">
26
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
27
+ <div class="input-box">
28
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
29
+ </div>
30
+ </div>
31
+ <?php endif; ?>
32
+ </li>
33
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
34
+ <li class="wide">
35
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
36
+ <div class="input-box">
37
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
38
+ </div>
39
+ </li>
40
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
41
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
42
+ <li class="wide">
43
+ <div class="input-box">
44
+ <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
45
+ </div>
46
+ </li>
47
+ <?php endfor; ?>
48
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
49
+ <li class="wide">
50
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
51
+ <div class="input-box">
52
+ <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
53
+ </div>
54
+ </li>
55
+ <?php endif; ?>
56
+ <li class="fields">
57
+ <div class="field">
58
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
59
+ <div class="input-box">
60
+ <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
61
+ </div>
62
+ </div>
63
+ <div class="field">
64
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
65
+ <div class="input-box">
66
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
67
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
68
+ </select>
69
+ <script type="text/javascript">
70
+ //<![CDATA[
71
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
72
+ //]]>
73
+ </script>
74
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
75
+ </div>
76
+ </div>
77
+ </li>
78
+ <li class="fields">
79
+ <div class="field">
80
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
81
+ <div class="input-box">
82
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
83
+ </div>
84
+ </div>
85
+ <div class="field">
86
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
87
+ <div class="input-box">
88
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
89
+ </div>
90
+ </div>
91
+ </li>
92
+ <li class="fields">
93
+ <div class="field">
94
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
95
+ <div class="input-box">
96
+ <input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
97
+ </div>
98
+ </div>
99
+ <div class="field">
100
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
101
+ <div class="input-box">
102
+ <input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
103
+ </div>
104
+ </div>
105
+ </li>
106
+ <?php if(!$this->isCustomerLoggedIn()): ?>
107
+
108
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
109
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
110
+ <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
111
+ <li class="fields">
112
+ <?php if ($_dob->isEnabled()): ?>
113
+ <div class="field">
114
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
115
+ </div>
116
+ <?php endif; ?>
117
+ <?php if ($_gender->isEnabled()): ?>
118
+ <div class="field">
119
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
120
+ </div>
121
+ <?php endif ?>
122
+ </li>
123
+ <?php endif ?>
124
+
125
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
126
+ <?php if ($_taxvat->isEnabled()): ?>
127
+ <li>
128
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
129
+ </li>
130
+ <?php endif ?>
131
+ <?php endif; ?>
132
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
133
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
134
+ </ul>
135
+ </fieldset>
136
+ </li>
137
+ <?php /* Extensions placeholder */ ?>
138
+ <?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
139
+ <?php if ($this->canShip()): ?>
140
+ <li class="control">
141
+ <input type="hidden" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0" checked="checked" title="<?php echo $this->__('Ship to different address') ?>" class="radio" />
142
+ </li>
143
+ <?php endif; ?>
144
+ </ul>
145
+ <?php if (!$this->canShip()): ?>
146
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
147
+ <?php endif; ?>
148
+ <div class="buttons-set" id="billing-buttons-container">
149
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
150
+ <button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
151
+ <span class="please-wait" id="billing-please-wait" style="display:none;">
152
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
153
+ </span>
154
+ </div>
155
+ </fieldset>
156
+ </form>
157
+ <script type="text/javascript">
158
+ //<![CDATA[
159
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('hcd/checkout/getAddress') ?>address/', '<?php echo $this->getUrl('hcd/checkout/saveBilling') ?>');
160
+ var shipping = new Shipping('co-billing-form', '<?php echo $this->getUrl('hcd/checkout/getAddress') ?>address/', '<?php echo $this->getUrl('hcd/checkout/saveShipping') ?>');
161
+ var billingForm = new VarienForm('co-billing-form');
162
+
163
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
164
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
165
+
166
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
167
+ //]]>
168
+ </script>
app/design/frontend/base/default/template/hcd/onepage/onepage/payment.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ //<![CDATA[
3
+ var quoteBaseGrandTotal = <?php echo (float)$this->getQuoteBaseGrandTotal(); ?>;
4
+ var checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
5
+ var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('hcd/checkout/savePayment') ?>');
6
+ var lastPrice;
7
+ //]]>
8
+ </script>
9
+ <form action="" id="co-payment-form">
10
+ <fieldset>
11
+ <?php echo $this->getChildHtml('methods') ?>
12
+ </fieldset>
13
+ </form>
14
+ <div class="tool-tip" id="payment-tool-tip" style="display:none;">
15
+ <div class="btn-close"><a href="#" id="payment-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
16
+ <div class="tool-tip-content"><img src="<?php echo $this->getSkinUrl('images/cvv.gif') ?>" alt="<?php echo $this->__('Card Verification Number Visual Reference') ?>" title="<?php echo $this->__('Card Verification Number Visual Reference') ?>" /></div>
17
+ </div>
18
+ <div class="buttons-set" id="payment-buttons-container">
19
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
20
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
21
+ <button type="button" class="button" onclick="payment.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
22
+ <span class="please-wait" id="payment-please-wait" style="display:none;">
23
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
24
+ </span>
25
+ </div>
26
+ <script type="text/javascript">
27
+ //<![CDATA[
28
+ function toggleToolTip(event){
29
+ if($('payment-tool-tip')){
30
+ $('payment-tool-tip').setStyle({
31
+ top: (Event.pointerY(event)-560)+'px'//,
32
+ //left: (Event.pointerX(event)+100)+'px'
33
+ })
34
+ $('payment-tool-tip').toggle();
35
+ }
36
+ Event.stop(event);
37
+ }
38
+ if($('payment-tool-tip-close')){
39
+ Event.observe($('payment-tool-tip-close'), 'click', toggleToolTip);
40
+ }
41
+ //]]>
42
+ </script>
43
+ <script type="text/javascript">
44
+ //<![CDATA[
45
+ payment.currentMethod = "<?php echo $this->getChild('methods')->getSelectedMethodCode() ?>";
46
+ //]]>
47
+ </script>
app/design/frontend/base/default/template/hcd/onepage/onepage/payment/methods.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * One page checkout payment methods
30
+ *
31
+ * @var $this Mage_Checkout_Block_Onepage_Payment_Methods
32
+ */
33
+ ?>
34
+
35
+ <?php
36
+ $methods = $this->getMethods();
37
+
38
+ $oneMethod = 1;
39
+ ?>
40
+ <?php if (empty($methods)): ?>
41
+ <dt>
42
+ <?php echo $this->__('No Payment Methods') ?>
43
+ </dt>
44
+ <?php else:
45
+ foreach ($methods as $_method):
46
+ $_code = $_method->getCode();
47
+ if ( $_code != "hcdmpa") continue;
48
+ ?>
49
+ <dt>
50
+ <?php if(!$oneMethod): ?>
51
+ <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
52
+ <?php else: ?>
53
+ <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
54
+ <?php $oneMethod = $_code; ?>
55
+ <?php endif; ?>
56
+ <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
57
+ </dt>
58
+ <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
59
+ <dd>
60
+ <?php echo $html; ?>
61
+ </dd>
62
+ <?php endif; ?>
63
+ <?php endforeach;
64
+ endif;
65
+ ?>
66
+ <?php echo $this->getChildChildHtml('additional'); ?>
67
+ <script type="text/javascript">
68
+ //<![CDATA[
69
+ <?php echo $this->getChildChildHtml('scripts'); ?>
70
+ payment.init();
71
+ <?php if (is_string($oneMethod)): ?>
72
+ payment.switchMethod('<?php echo $oneMethod ?>');
73
+ <?php endif; ?>
74
+ //]]>
75
+ </script>
app/design/frontend/base/default/template/hcd/onepage/onepage/progress.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="block block-progress opc-block-progress" sytle="opacity: 1;">
2
+ <div class="block-title">
3
+ <strong><span><?php echo $this->__('Your Checkout Progress') ?></span></strong>
4
+ </div>
5
+ <div class="block-content">
6
+ <dl>
7
+ <?php if ($this->getCheckout()->getStepData('billing', 'is_show')): ?>
8
+ <div id="billing-progress-opcheckout">
9
+ <?php echo $this->getChildHtml('billing.progress') ?>
10
+ </div>
11
+ <?php endif; ?>
12
+
13
+ <?php if (!$this->getCheckout()->getQuote()->isVirtual()): ?>
14
+ <div id="shipping-progress-opcheckout">
15
+ <?php echo $this->getChildHtml('shipping.progress') ?>
16
+ </div>
17
+ <?php endif; ?>
18
+
19
+ <?php if ($this->getCheckout()->getStepData('shipping_method', 'is_show')): ?>
20
+ <div id="shipping_method-progress-opcheckout">
21
+ <?php echo $this->getChildHtml('shippingmethod.progress') ?>
22
+ </div>
23
+ <?php endif; ?>
24
+
25
+ <?php if (true == true): ?>
26
+ <div id="payment-progress-opcheckout">
27
+ <?php echo $this->getChildHtml('payment.progress') ?>
28
+ </div>
29
+ <?php endif; ?>
30
+ </dl>
31
+ </div>
32
+ </div>
33
+
app/design/frontend/base/default/template/hcd/onepage/onepage/progress/payment.phtml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ($this->getCheckout()->getStepData('payment', 'complete')): ?>
2
+ <dt class="complete">
3
+ <?php echo $this->__('Payment Method') ?><span class="changelink"> <span class="separator">|</span> <a
4
+ href="<?php echo Mage::getUrl('hcd/index/wallet',array('_secure'=>true, '_wallet' =>'hcdmpa')); ?>"
5
+ onclick="window.location='<?php echo Mage::getUrl('hcd/index/wallet',array('_secure'=>true, '_wallet' =>'hcdmpa')); ?>';" style="text-transform: none; size: 10px; display: block;"><?php echo Mage::helper('hcd')->__('Change at MasterPass') ?> </a></span>
6
+ </dt>
7
+ <dd>
8
+ <button type="button" title="MasterPass"
9
+ class="btn-hcdmpa-info"
10
+ onclick="window.open('https://www.mastercard.com/mc_us/wallet/learnmore/<?php
11
+ $lang = Mage::app()->getLocale()->getLocaleCode();
12
+ switch ($lang) {
13
+ case 'de_DE':
14
+ case 'de_AT':
15
+ case 'de_CH':
16
+ echo 'de/DE';
17
+ break;
18
+ case 'fr_FR':
19
+ echo 'fr/FR';
20
+ break;
21
+ case 'en_GB':
22
+ case 'en_US':
23
+ default:
24
+ echo 'en/US';
25
+ break;
26
+ }?>')"
27
+ style="background: url('<?php echo Mage::getDesign()->getSkinUrl('images/hcd/'); ?>masterpass_100_28.jpg'
28
+ ) 0 0 no-repeat;"
29
+ ></button>
30
+ <div class="hcd-masterpass-payment-data-info"><?php
31
+ $session = Mage::getSingleton('checkout/session');
32
+
33
+ if ($session->getHcdWallet() !== false) {
34
+
35
+ $hpdata = $session->getHcdWallet();
36
+
37
+ echo (array_key_exists('mail', $hpdata)) ? $hpdata['mail'].'<br />' : '' ;
38
+ echo (array_key_exists('brand', $hpdata)) ? Mage::helper('hcd')->__($hpdata['brand']).' ' : '' ;
39
+ echo (array_key_exists('number', $hpdata)) ? $hpdata['number'].'<br/>' : '' ;
40
+ echo (array_key_exists('expiryMonth', $hpdata)) ? Mage::helper('hcd')->__('Expires').' '.$hpdata['expiryMonth'].'/' : '' ;
41
+ echo (array_key_exists('expiryYear', $hpdata)) ? $hpdata['expiryYear'] : '' ;
42
+ }
43
+
44
+ ?></div>
45
+ </dd>
46
+ <?php else: ?>
47
+ <dt>
48
+ <?php echo $this->__('Payment Method') ?>
49
+ </dt>
50
+ <?php endif; ?>
51
+
app/design/frontend/base/default/template/hcd/onepage/onepage/progress/shipping.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if ($this->getCheckout()->getStepData('shipping', 'complete')): ?>
28
+ <?php $completeClass = $this->getCheckout()->getStepData('shipping', 'complete') ? 'complete' : ''; ?>
29
+ <dt class="<?php echo $completeClass ?>">
30
+ <?php echo $this->__('Shipping Address') ?> <span class="changelink" ><span class="separator">|</span> <a
31
+ href="<?php echo Mage::getUrl('hcd/index/wallet',array('_secure'=>true, '_wallet' =>'hcdmpa')); ?>"
32
+ onclick="window.location='<?php echo Mage::getUrl('hcd/index/wallet',array('_secure'=>true, '_wallet' =>'hcdmpa')); ?>';" style="text-transform: none; size: 10px; display: block;"><?php echo Mage::helper('hcd')->__('Change at MasterPass') ?></a></span>
33
+ </dt>
34
+ <dd class="<?php echo $completeClass ?>">
35
+ <?php if ($this->getCheckout()->getStepData('shipping', 'complete')): ?>
36
+ <address><?php echo $this->getShipping()->format('html') ?></address>
37
+ <?php endif; ?>
38
+ </dd>
39
+ <?php else: ?>
40
+ <dt>
41
+ <?php echo $this->__('Shipping Address') ?>
42
+ </dt>
43
+ <?php endif; ?>
44
+
app/design/frontend/base/default/template/hcd/onepage/onepage/shipping_method.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form id="co-shipping-method-form" action="">
2
+ <div id="checkout-shipping-method-load">
3
+ <!-- Content loaded dynamically -->
4
+ </div>
5
+ <script type="text/javascript">
6
+ //<![CDATA[
7
+ var shippingMethod = new ShippingMethod('co-shipping-method-form', "<?php echo $this->getUrl('hcd/checkout/saveShippingMethod') ?>");
8
+ //]]>
9
+ </script>
10
+ <div id="onepage-checkout-shipping-method-additional-load">
11
+ <?php echo $this->getChildHtml('additional') ?>
12
+ </div>
13
+ <div class="buttons-set" id="shipping-method-buttons-container">
14
+ <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
15
+ <button type="button" class="button" onclick="shippingMethod.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
16
+ <span id="shipping-method-please-wait" class="please-wait" style="display:none;">
17
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
18
+ </span>
19
+ </div>
20
+ </form>
app/design/frontend/base/default/template/hcd/onepage/payment.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/payment/methods.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/progress.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/progress/payment.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/progress/shipping.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/onepage/shipping_method.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/response.phtml CHANGED
File without changes
app/design/frontend/base/default/template/hcd/success.phtml CHANGED
File without changes
app/etc/modules/HeidelpayCD_Edition.xml CHANGED
File without changes
app/locale/de_DE/HeidelpayCD_Edition.csv CHANGED
File without changes
app/locale/en_US/HeidelpayCD_Edition.csv CHANGED
File without changes
js/hcd/heidelpaycd.js CHANGED
File without changes
js/hcd/heidelpaypci3.js CHANGED
File without changes
js/hcd/opcheckout.js CHANGED
File without changes
package.xml CHANGED
@@ -1,9 +1,9 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HeidelpayCDEdition</name>
4
- <version>17.3.30</version>
5
  <stability>stable</stability>
6
- <license uri="https://github.com/heidelpay/magento-cd-edition/blob/master/LICENSE.txt">See License.txt</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Heidelpay CD-Edition Payment Plugin</summary>
@@ -36,15 +36,12 @@ Telefon: +49 (0) 6221 / 65 170-20&lt;br /&gt;&#xD;
36
  E-Mail: sales@heidelpay.de&lt;br /&gt;&#xD;
37
  Internet: www.heidelpay.de&lt;br /&gt;&#xD;
38
  </description>
39
- <notes>- new payment method invoice secured&#xD;
40
- - new payment method direct debit secured&#xD;
41
- &#xD;
42
- See CHANGELOG.md for the full list of changes.&#xD;
43
  </notes>
44
  <authors><author><name>Heidelberger Payment GmbH</name><user>Heidelpay</user><email>magento@heidelpay.de</email></author></authors>
45
- <date>2017-03-30</date>
46
- <time>09:31:16</time>
47
- <contents><target name="magecommunity"><dir name="HeidelpayCD"><dir name="Edition"><dir name="Block"><file name="Abstract.php" hash="2b057d05c400cdd17b295862d6a23fdf"/><file name="Button.php" hash="92d233b5f867604a69012c8a02b40977"/><dir name="Form"><file name="Creditcard.php" hash="717c40fd8e4e16681303c5e4c1d95fe8"/><file name="Debit.php" hash="4475b024c855e37edd0ba02042753a1b"/><file name="Desconly.php" hash="3c07575a005918639578457aa984151b"/><file name="DirectDebitSecured.php" hash="35ded7efeb03b9d28ecf469d6fb59449"/><file name="Eps.php" hash="6520615f6e4a455d11021950605e2514"/><file name="Giropay.php" hash="aba0b69429706944ae1ac4466ab9ce3b"/><file name="Ideal.php" hash="3b5d6f7b27d7d03dcfd7603a83d352f7"/><file name="InvoiceSecured.php" hash="44f160fe3169986776bf69939e6b0e48"/><file name="Masterpass.php" hash="a81a3143ebcbfa72df716973c1c55318"/><file name="Postfinance.php" hash="b2f477144d0ec9df31eea1c6119e54a3"/></dir><file name="Index.php" hash="a690c390d4f939c3619fc87bb3c3c10c"/><dir name="Info"><file name="Debit.php" hash="888f8a1c1aaaf6974131970969caa5f2"/><file name="DirectDebit.php" hash="c9f2ba7e9f37616969fe9b217a999d50"/><file name="Invoice.php" hash="b2f4dbf7905a1e94341217b8a2a3819a"/><file name="Masterpass.php" hash="7e928254dc3d3818d3c6ddf83eb84ac3"/><file name="Prepayment.php" hash="306443d84137b409ad73b4ab78aa8e72"/></dir><dir name="Onepage"><file name="Billing.php" hash="ea5c6dc3c609cfd1452cd132e626e25f"/><file name="Progress.php" hash="b9f1a33cee97615fcc2888c89f26a902"/><file name="Shipping.php" hash="6ba425f5b94cd41003dc4f4c82fddbc2"/></dir><file name="Onepage.php" hash="3e8ee081267736f4493a22f5693587c4"/><file name="Response.php" hash="b905f0b138e2107d5922277ac9f173cb"/><file name="Success.php" hash="43dc95a2e2387dba8c7da33f372c9e94"/></dir><dir name="Helper"><file name="AbstractHelper.php" hash="d03018c5377104b444910b09c13eea3b"/><file name="BasketApi.php" hash="17fb81c28b632e2d582044cc205a330f"/><file name="Data.php" hash="6e2b23004df9a9c03fde3c61f3150747"/><file name="OrderState.php" hash="464e6f8b451dc5397714d9cb86c2a081"/><file name="Payment.php" hash="99b00ac0f9abb9a29fc1764ee3afeead"/><file name="Validator.php" hash="15d69234ea566db7bb481183cb59767b"/></dir><dir name="Model"><file name="Customer.php" hash="bd32084ebca847bcd60c95f08b2da080"/><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="f8634f728d32e6c40c3f20ec92d279bd"/></dir><file name="Customer.php" hash="a3e2126379f1f7731e1f7216559b8b4b"/><dir name="Transaction"><file name="Collection.php" hash="7495874d2d1b27adef970410db28bf4f"/></dir><file name="Transaction.php" hash="9b50bcbe6f5092242d07d7f46a4d925c"/></dir><file name="Observer.php" hash="7f8b8015e463e2c4151ac33e0f2564a3"/><dir name="Order"><dir name="Pdf"><file name="Invoice.php" hash="c4281e931bbba4f6e5ee1b061e40960d"/></dir></dir><dir name="Payment"><file name="Abstract.php" hash="e911d1d3b044c8b45e2e4bf72cf0c187"/><file name="AbstractSecuredPaymentMethods.php" hash="e34c39c5a4a3a9742577f013bcc93423"/><file name="HcdDirectDebitSecured.php" hash="4daf0606b1b09447cbe1476d6fdbe6bc"/><file name="HcdInvoiceSecured.php" hash="2a843e04dd3640a6053f5d49ccdc2c84"/><file name="Hcdbs.php" hash="e761054021d2ee5d2b233f2a9e9ef0cb"/><file name="Hcdcc.php" hash="04be67f03f66fbaf7f7615796cef4eaa"/><file name="Hcddc.php" hash="d7953e4c7bb237adebdff7547ade01af"/><file name="Hcddd.php" hash="3f88025d17daad6441c1f2f4493cb957"/><file name="Hcdeps.php" hash="724af12f038ea2e8ab4545da28529bea"/><file name="Hcdgp.php" hash="c25899b07d407357b255166521be8e5b"/><file name="Hcdide.php" hash="011a116ecca0339c405aae2566f0e16b"/><file name="Hcdiv.php" hash="cb240c3c53e3797a6998262324c9c248"/><file name="Hcdmk.php" hash="75572cce005f2ecd33c7d552724796dc"/><file name="Hcdmpa.php" hash="05319d69791165c0393ecd9b5fe5459b"/><file name="Hcdpal.php" hash="ddedb86eaec7a66d97721cf080baabaf"/><file name="Hcdpf.php" hash="520f55eac6499bb061b9e79c25bf028b"/><file name="Hcdpp.php" hash="f928d16a2f5b7094d066f412dcd1949a"/><file name="Hcdsu.php" hash="357857ca8f073b69d8321d3bfc7fdd1a"/><file name="Hcdyt.php" hash="de6e549fce6daca70dad9233be9ceb27"/></dir><dir name="Resource"><file name="Encryption.php" hash="d3e12608684d89f39b378114602dacaf"/><file name="Setup.php" hash="33dd67ce8aee90fffdf3de62c850d3ee"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Bookingmode.php" hash="9133af26f8df450cbfd9ff5ed116adf1"/><file name="Recognition.php" hash="007b73ca273fe1a93ec09c6bd1bc7cab"/><file name="Returnurl.php" hash="df8357de873019dbbdef935d2ad73978"/></dir></dir></dir><file name="Transaction.php" hash="638481f33d2a6333d20ad351df680eda"/></dir><dir name="controllers"><file name="CheckoutController.php" hash="fb665e715c857c606484379691c87b24"/><file name="IndexController.php" hash="478fa789a61c15f5bcd8f154575e8238"/><file name="ResponseController.php" hash="d3cf44d607571a20b2fa1e9ec0339669"/></dir><dir name="etc"><file name="config.xml" hash="6218500c4772ec183639e007b3572aeb"/><file name="system.xml" hash="9da4da78db3bb50e50dbf9b04a7819bd"/></dir><dir name="sql"><dir name="hcd_setup"><file name="install-15.1.30.php" hash="139e3c9e316dad5329d40de3e3cd43a2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="hcd.xml" hash="b1d22100ced439a653421eb15a7be538"/></dir><dir name="template"><dir name="hcd"><dir name="Info"><file name="debit.phtml" hash="0632fa163fa5bb7df9c0da2b4010c7dc"/><file name="masterpass.phtml" hash="0632fa163fa5bb7df9c0da2b4010c7dc"/></dir><file name="button.phtml" hash="66ff2e82c4db439d3c616c455e8654f8"/><dir name="form"><file name="creditcard.phtml" hash="46cbc9443f1a1b92d8cee22afca17569"/><file name="debit.phtml" hash="d6b6912c94a2eab14fc82032049860d7"/><file name="desconly.phtml" hash="c96412bdf87c99c648c285d7669146a5"/><file name="direct-debit-secured.phtml" hash="37011aa236244920022c6dcef9e9e642"/><file name="eps.phtml" hash="b42c8ea8c536c6251487338503b4292b"/><file name="giropay.phtml" hash="ebcb9379429b3d47263ee97243688f3c"/><file name="ideal.phtml" hash="20292c1b434d94255368a664c6bcfff9"/><file name="invoice-secured.phtml" hash="f14777bb5b8e744fa2117b067a9e26d1"/><file name="masterpass.phtml" hash="2a4c0b9d1d8d0b9f797094e99e7c46b0"/><file name="postfinance.phtml" hash="9f537b0b203b75651609136fc98ea183"/></dir><file name="index.phtml" hash="d76db58b6fba89c113144b5e5065539a"/><dir name="mail"><file name="hcd_payment_info.phtml" hash="1ec6d33fbb5bc8391a8295be1ffa5b38"/></dir><dir name="onepage"><file name="billing.phtml" hash="14b57c38161e6749fbc37813337c2379"/><dir name="payment"><file name="methods.phtml" hash="0e2f9e12e7dfc1070404af7dfdd7b024"/></dir><file name="payment.phtml" hash="6d452186f51dc088c5007c16ddd1cf08"/><dir name="progress"><file name="payment.phtml" hash="440f57443141d1280cf18c798cc8af10"/><file name="shipping.phtml" hash="c659abf65a13a4f1fadcec6221afd1a1"/></dir><file name="progress.phtml" hash="9527eb86ec29030f4b111455d3122388"/><file name="shipping_method.phtml" hash="79f1cc31d10a35df619b15db481e9543"/></dir><file name="onepage.phtml" hash="df4e2760e3804f7a2ff51d4b4cf74538"/><file name="response.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="success.phtml" hash="9cac258cb96b057b3de00ab971bf7855"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="hcd"><dir name="Info"><file name="masterpass.phtml" hash="53c30caa1d8838256686aaeef48f42eb"/><dir name="pdf"><file name="invoice.phtml" hash="c87bc83feeac048800f923a9bff2ca8d"/></dir></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="hcd"><dir><dir name="info"><dir name="pdf"><file name="directdebit.phtml" hash="58b78aba68ac0ccb2dd5ce6a55d62d5c"/><file name="invoice.phtml" hash="8f9cd8f1f71b2669c5a3ee266a7d7bfe"/><file name="prepayment.phtml" hash="96382d5d69ef69414f49efb4176f8e23"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HeidelpayCD_Edition.xml" hash="268d503b4a88bc5bbd76f47794f78f7e"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="HeidelpayCD_Edition.csv" hash="b1e1f0017484f29a9a1f4d0c3a938833"/></dir><dir name="en_US"><file name="HeidelpayCD_Edition.csv" hash="54bf196d06fc21e43c3039ba012a8cac"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="hcd"><file name="loading.gif" hash="29868a3a7094b078733caba6b192b080"/><file name="masterpass_100_28.jpg" hash="e0907959b1e345de6a3d73f32a5f5369"/><file name="masterpass_240_66.jpg" hash="7ad0078b8a27914aceb590c4100f3aa8"/></dir></dir><dir name="css"><file name="heidelpaycd.css" hash="da93e9bb03447be97c071b5160bdc81f"/><file name="hcdcc_payment_frame.css" hash="b1f9522942c14b15fe8ef81a6d8ac4b2"/><file name="hcddc_payment_frame.css" hash="b1f9522942c14b15fe8ef81a6d8ac4b2"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="hcd"><file name="masterpass_100_28.jpg" hash="e0907959b1e345de6a3d73f32a5f5369"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="hcd"><file name="heidelpaycd.js" hash="783491bc26c795408de517240eea18a0"/><file name="heidelpaypci3.js" hash="47c0ff6f0160f2dcfacf42e00df0ea7c"/><file name="opcheckout.js" hash="7d2f7f55c3e4d0864958e1bfe05a9e74"/></dir></dir></target></contents>
48
  <compatible/>
49
  <dependencies><required><php><min>5.6.0</min><max>7.0.99</max></php></required></dependencies>
50
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HeidelpayCDEdition</name>
4
+ <version>17.5.17</version>
5
  <stability>stable</stability>
6
+ <license>heidelpay license</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Heidelpay CD-Edition Payment Plugin</summary>
36
  E-Mail: sales@heidelpay.de&lt;br /&gt;&#xD;
37
  Internet: www.heidelpay.de&lt;br /&gt;&#xD;
38
  </description>
39
+ <notes>- Bugfix capture does not have reference id&#xD;
 
 
 
40
  </notes>
41
  <authors><author><name>Heidelberger Payment GmbH</name><user>Heidelpay</user><email>magento@heidelpay.de</email></author></authors>
42
+ <date>2017-05-17</date>
43
+ <time>13:51:19</time>
44
+ <contents><target name="magecommunity"><dir name="HeidelpayCD"><dir name="Edition"><dir name="Block"><file name="Abstract.php" hash="2b057d05c400cdd17b295862d6a23fdf"/><file name="Button.php" hash="92d233b5f867604a69012c8a02b40977"/><dir name="Form"><file name="Creditcard.php" hash="717c40fd8e4e16681303c5e4c1d95fe8"/><file name="Debit.php" hash="4475b024c855e37edd0ba02042753a1b"/><file name="Desconly.php" hash="3c07575a005918639578457aa984151b"/><file name="DirectDebitSecured.php" hash="35ded7efeb03b9d28ecf469d6fb59449"/><file name="Eps.php" hash="6520615f6e4a455d11021950605e2514"/><file name="Ideal.php" hash="3b5d6f7b27d7d03dcfd7603a83d352f7"/><file name="InvoiceSecured.php" hash="44f160fe3169986776bf69939e6b0e48"/><file name="Masterpass.php" hash="a81a3143ebcbfa72df716973c1c55318"/><file name="Postfinance.php" hash="b2f477144d0ec9df31eea1c6119e54a3"/></dir><file name="Index.php" hash="a690c390d4f939c3619fc87bb3c3c10c"/><dir name="Info"><file name="DirectDebit.php" hash="c9f2ba7e9f37616969fe9b217a999d50"/><file name="Invoice.php" hash="b2f4dbf7905a1e94341217b8a2a3819a"/><file name="Masterpass.php" hash="7e928254dc3d3818d3c6ddf83eb84ac3"/><file name="Prepayment.php" hash="306443d84137b409ad73b4ab78aa8e72"/></dir><dir name="Onepage"><file name="Billing.php" hash="ea5c6dc3c609cfd1452cd132e626e25f"/><file name="Progress.php" hash="b9f1a33cee97615fcc2888c89f26a902"/><file name="Shipping.php" hash="6ba425f5b94cd41003dc4f4c82fddbc2"/></dir><file name="Onepage.php" hash="3e8ee081267736f4493a22f5693587c4"/><file name="Response.php" hash="b905f0b138e2107d5922277ac9f173cb"/><file name="Success.php" hash="43dc95a2e2387dba8c7da33f372c9e94"/></dir><file name="CHANGELOG.md" hash="bc7c79b09a6dfc55c8308b8a5970ba2b"/><dir name="Edition"><dir name="Block"><file name="Abstract.php" hash="2b057d05c400cdd17b295862d6a23fdf"/><file name="Button.php" hash="92d233b5f867604a69012c8a02b40977"/><dir name="Form"><file name="Creditcard.php" hash="717c40fd8e4e16681303c5e4c1d95fe8"/><file name="Debit.php" hash="4475b024c855e37edd0ba02042753a1b"/><file name="Desconly.php" hash="3c07575a005918639578457aa984151b"/><file name="DirectDebitSecured.php" hash="35ded7efeb03b9d28ecf469d6fb59449"/><file name="Eps.php" hash="6520615f6e4a455d11021950605e2514"/><file name="Ideal.php" hash="3b5d6f7b27d7d03dcfd7603a83d352f7"/><file name="InvoiceSecured.php" hash="44f160fe3169986776bf69939e6b0e48"/><file name="Masterpass.php" hash="a81a3143ebcbfa72df716973c1c55318"/><file name="Postfinance.php" hash="b2f477144d0ec9df31eea1c6119e54a3"/></dir><file name="Index.php" hash="a690c390d4f939c3619fc87bb3c3c10c"/><dir name="Info"><file name="DirectDebit.php" hash="c9f2ba7e9f37616969fe9b217a999d50"/><file name="Invoice.php" hash="b2f4dbf7905a1e94341217b8a2a3819a"/><file name="Masterpass.php" hash="7e928254dc3d3818d3c6ddf83eb84ac3"/><file name="Prepayment.php" hash="306443d84137b409ad73b4ab78aa8e72"/></dir><dir name="Onepage"><file name="Billing.php" hash="ea5c6dc3c609cfd1452cd132e626e25f"/><file name="Progress.php" hash="b9f1a33cee97615fcc2888c89f26a902"/><file name="Shipping.php" hash="6ba425f5b94cd41003dc4f4c82fddbc2"/></dir><file name="Onepage.php" hash="3e8ee081267736f4493a22f5693587c4"/><file name="Response.php" hash="b905f0b138e2107d5922277ac9f173cb"/><file name="Success.php" hash="43dc95a2e2387dba8c7da33f372c9e94"/></dir><dir name="Edition"><dir name="Block"><file name="Abstract.php" hash="2b057d05c400cdd17b295862d6a23fdf"/><file name="Button.php" hash="92d233b5f867604a69012c8a02b40977"/><dir name="Form"><file name="Creditcard.php" hash="717c40fd8e4e16681303c5e4c1d95fe8"/><file name="Debit.php" hash="4475b024c855e37edd0ba02042753a1b"/><file name="Desconly.php" hash="3c07575a005918639578457aa984151b"/><file name="DirectDebitSecured.php" hash="35ded7efeb03b9d28ecf469d6fb59449"/><file name="Eps.php" hash="6520615f6e4a455d11021950605e2514"/><file name="Ideal.php" hash="3b5d6f7b27d7d03dcfd7603a83d352f7"/><file name="InvoiceSecured.php" hash="44f160fe3169986776bf69939e6b0e48"/><file name="Masterpass.php" hash="a81a3143ebcbfa72df716973c1c55318"/><file name="Postfinance.php" hash="b2f477144d0ec9df31eea1c6119e54a3"/></dir><file name="Index.php" hash="a690c390d4f939c3619fc87bb3c3c10c"/><dir name="Info"><file name="DirectDebit.php" hash="c9f2ba7e9f37616969fe9b217a999d50"/><file name="Invoice.php" hash="b2f4dbf7905a1e94341217b8a2a3819a"/><file name="Masterpass.php" hash="7e928254dc3d3818d3c6ddf83eb84ac3"/><file name="Prepayment.php" hash="306443d84137b409ad73b4ab78aa8e72"/></dir><dir name="Onepage"><file name="Billing.php" hash="ea5c6dc3c609cfd1452cd132e626e25f"/><file name="Progress.php" hash="b9f1a33cee97615fcc2888c89f26a902"/><file name="Shipping.php" hash="6ba425f5b94cd41003dc4f4c82fddbc2"/></dir><file name="Onepage.php" hash="3e8ee081267736f4493a22f5693587c4"/><file name="Response.php" hash="b905f0b138e2107d5922277ac9f173cb"/><file name="Success.php" hash="43dc95a2e2387dba8c7da33f372c9e94"/></dir><dir name="Helper"><file name="AbstractHelper.php" hash="d03018c5377104b444910b09c13eea3b"/><file name="BasketApi.php" hash="17fb81c28b632e2d582044cc205a330f"/><file name="Data.php" hash="6e2b23004df9a9c03fde3c61f3150747"/><file name="OrderState.php" hash="464e6f8b451dc5397714d9cb86c2a081"/><file name="Payment.php" hash="99b00ac0f9abb9a29fc1764ee3afeead"/><file name="Validator.php" hash="15d69234ea566db7bb481183cb59767b"/></dir><dir name="Model"><file name="Customer.php" hash="bd32084ebca847bcd60c95f08b2da080"/><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="f8634f728d32e6c40c3f20ec92d279bd"/></dir><file name="Customer.php" hash="a3e2126379f1f7731e1f7216559b8b4b"/><dir name="Transaction"><file name="Collection.php" hash="7495874d2d1b27adef970410db28bf4f"/></dir><file name="Transaction.php" hash="9b50bcbe6f5092242d07d7f46a4d925c"/></dir><file name="Observer.php" hash="7f8b8015e463e2c4151ac33e0f2564a3"/><dir name="Order"><dir name="Pdf"><file name="Invoice.php" hash="c4281e931bbba4f6e5ee1b061e40960d"/></dir></dir><dir name="Payment"><file name="Abstract.php" hash="246a8ef023dbab0fb6d0d6c8ff4d4ff8"/><file name="AbstractSecuredPaymentMethods.php" hash="e34c39c5a4a3a9742577f013bcc93423"/><file name="HcdDirectDebitSecured.php" hash="4daf0606b1b09447cbe1476d6fdbe6bc"/><file name="HcdInvoiceSecured.php" hash="2a843e04dd3640a6053f5d49ccdc2c84"/><file name="Hcdbs.php" hash="e761054021d2ee5d2b233f2a9e9ef0cb"/><file name="Hcdcc.php" hash="04be67f03f66fbaf7f7615796cef4eaa"/><file name="Hcddc.php" hash="d7953e4c7bb237adebdff7547ade01af"/><file name="Hcddd.php" hash="3f88025d17daad6441c1f2f4493cb957"/><file name="Hcdeps.php" hash="724af12f038ea2e8ab4545da28529bea"/><file name="Hcdgp.php" hash="c25899b07d407357b255166521be8e5b"/><file name="Hcdide.php" hash="011a116ecca0339c405aae2566f0e16b"/><file name="Hcdiv.php" hash="cb240c3c53e3797a6998262324c9c248"/><file name="Hcdmk.php" hash="75572cce005f2ecd33c7d552724796dc"/><file name="Hcdmpa.php" hash="05319d69791165c0393ecd9b5fe5459b"/><file name="Hcdpal.php" hash="ddedb86eaec7a66d97721cf080baabaf"/><file name="Hcdpf.php" hash="520f55eac6499bb061b9e79c25bf028b"/><file name="Hcdpp.php" hash="f928d16a2f5b7094d066f412dcd1949a"/><file name="Hcdsu.php" hash="357857ca8f073b69d8321d3bfc7fdd1a"/><file name="Hcdyt.php" hash="de6e549fce6daca70dad9233be9ceb27"/></dir><dir name="Resource"><file name="Encryption.php" hash="d3e12608684d89f39b378114602dacaf"/><file name="Setup.php" hash="33dd67ce8aee90fffdf3de62c850d3ee"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Bookingmode.php" hash="9133af26f8df450cbfd9ff5ed116adf1"/><file name="Recognition.php" hash="007b73ca273fe1a93ec09c6bd1bc7cab"/><file name="Returnurl.php" hash="df8357de873019dbbdef935d2ad73978"/></dir></dir></dir><file name="Transaction.php" hash="638481f33d2a6333d20ad351df680eda"/></dir><dir name="controllers"><file name="CheckoutController.php" hash="fb665e715c857c606484379691c87b24"/><file name="IndexController.php" hash="478fa789a61c15f5bcd8f154575e8238"/><file name="ResponseController.php" hash="d3cf44d607571a20b2fa1e9ec0339669"/></dir><dir name="etc"><file name="config.xml" hash="62a25bfc0a3a19ca15d6add7a2bb56eb"/><file name="system.xml" hash="9da4da78db3bb50e50dbf9b04a7819bd"/></dir><dir name="sql"><dir name="hcd_setup"><file name="install-15.1.30.php" hash="139e3c9e316dad5329d40de3e3cd43a2"/></dir></dir></dir><dir name="Helper"><file name="AbstractHelper.php" hash="d03018c5377104b444910b09c13eea3b"/><file name="BasketApi.php" hash="17fb81c28b632e2d582044cc205a330f"/><file name="Data.php" hash="6e2b23004df9a9c03fde3c61f3150747"/><file name="OrderState.php" hash="464e6f8b451dc5397714d9cb86c2a081"/><file name="Payment.php" hash="99b00ac0f9abb9a29fc1764ee3afeead"/><file name="Validator.php" hash="15d69234ea566db7bb481183cb59767b"/></dir><dir name="Model"><file name="Customer.php" hash="bd32084ebca847bcd60c95f08b2da080"/><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="f8634f728d32e6c40c3f20ec92d279bd"/></dir><file name="Customer.php" hash="a3e2126379f1f7731e1f7216559b8b4b"/><dir name="Transaction"><file name="Collection.php" hash="7495874d2d1b27adef970410db28bf4f"/></dir><file name="Transaction.php" hash="9b50bcbe6f5092242d07d7f46a4d925c"/></dir><file name="Observer.php" hash="7f8b8015e463e2c4151ac33e0f2564a3"/><dir name="Order"><dir name="Pdf"><file name="Invoice.php" hash="c4281e931bbba4f6e5ee1b061e40960d"/></dir></dir><dir name="Payment"><file name="Abstract.php" hash="246a8ef023dbab0fb6d0d6c8ff4d4ff8"/><file name="AbstractSecuredPaymentMethods.php" hash="e34c39c5a4a3a9742577f013bcc93423"/><file name="HcdDirectDebitSecured.php" hash="4daf0606b1b09447cbe1476d6fdbe6bc"/><file name="HcdInvoiceSecured.php" hash="2a843e04dd3640a6053f5d49ccdc2c84"/><file name="Hcdbs.php" hash="e761054021d2ee5d2b233f2a9e9ef0cb"/><file name="Hcdcc.php" hash="04be67f03f66fbaf7f7615796cef4eaa"/><file name="Hcddc.php" hash="d7953e4c7bb237adebdff7547ade01af"/><file name="Hcddd.php" hash="3f88025d17daad6441c1f2f4493cb957"/><file name="Hcdeps.php" hash="724af12f038ea2e8ab4545da28529bea"/><file name="Hcdgp.php" hash="c25899b07d407357b255166521be8e5b"/><file name="Hcdide.php" hash="011a116ecca0339c405aae2566f0e16b"/><file name="Hcdiv.php" hash="cb240c3c53e3797a6998262324c9c248"/><file name="Hcdmk.php" hash="75572cce005f2ecd33c7d552724796dc"/><file name="Hcdmpa.php" hash="05319d69791165c0393ecd9b5fe5459b"/><file name="Hcdpal.php" hash="ddedb86eaec7a66d97721cf080baabaf"/><file name="Hcdpf.php" hash="520f55eac6499bb061b9e79c25bf028b"/><file name="Hcdpp.php" hash="f928d16a2f5b7094d066f412dcd1949a"/><file name="Hcdsu.php" hash="357857ca8f073b69d8321d3bfc7fdd1a"/><file name="Hcdyt.php" hash="de6e549fce6daca70dad9233be9ceb27"/></dir><dir name="Resource"><file name="Encryption.php" hash="d3e12608684d89f39b378114602dacaf"/><file name="Setup.php" hash="33dd67ce8aee90fffdf3de62c850d3ee"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Bookingmode.php" hash="9133af26f8df450cbfd9ff5ed116adf1"/><file name="Recognition.php" hash="007b73ca273fe1a93ec09c6bd1bc7cab"/><file name="Returnurl.php" hash="df8357de873019dbbdef935d2ad73978"/></dir></dir></dir><file name="Transaction.php" hash="638481f33d2a6333d20ad351df680eda"/></dir><dir name="controllers"><file name="CheckoutController.php" hash="fb665e715c857c606484379691c87b24"/><file name="IndexController.php" hash="478fa789a61c15f5bcd8f154575e8238"/><file name="ResponseController.php" hash="d3cf44d607571a20b2fa1e9ec0339669"/></dir><dir name="etc"><file name="config.xml" hash="62a25bfc0a3a19ca15d6add7a2bb56eb"/><file name="system.xml" hash="9da4da78db3bb50e50dbf9b04a7819bd"/></dir><dir name="sql"><dir name="hcd_setup"><file name="install-15.1.30.php" hash="139e3c9e316dad5329d40de3e3cd43a2"/></dir></dir></dir><dir name="Helper"><file name="AbstractHelper.php" hash="d03018c5377104b444910b09c13eea3b"/><file name="BasketApi.php" hash="17fb81c28b632e2d582044cc205a330f"/><file name="Data.php" hash="6e2b23004df9a9c03fde3c61f3150747"/><file name="OrderState.php" hash="464e6f8b451dc5397714d9cb86c2a081"/><file name="Payment.php" hash="99b00ac0f9abb9a29fc1764ee3afeead"/><file name="Validator.php" hash="15d69234ea566db7bb481183cb59767b"/></dir><file name="LICENSE.txt" hash="0367823a347f0dab8e38d5717f9855f3"/><dir name="Model"><file name="Customer.php" hash="bd32084ebca847bcd60c95f08b2da080"/><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="f8634f728d32e6c40c3f20ec92d279bd"/></dir><file name="Customer.php" hash="a3e2126379f1f7731e1f7216559b8b4b"/><dir name="Transaction"><file name="Collection.php" hash="7495874d2d1b27adef970410db28bf4f"/></dir><file name="Transaction.php" hash="9b50bcbe6f5092242d07d7f46a4d925c"/></dir><file name="Observer.php" hash="7f8b8015e463e2c4151ac33e0f2564a3"/><dir name="Order"><dir name="Pdf"><file name="Invoice.php" hash="c4281e931bbba4f6e5ee1b061e40960d"/></dir></dir><dir name="Payment"><file name="Abstract.php" hash="246a8ef023dbab0fb6d0d6c8ff4d4ff8"/><file name="AbstractSecuredPaymentMethods.php" hash="e34c39c5a4a3a9742577f013bcc93423"/><file name="HcdDirectDebitSecured.php" hash="4daf0606b1b09447cbe1476d6fdbe6bc"/><file name="HcdInvoiceSecured.php" hash="2a843e04dd3640a6053f5d49ccdc2c84"/><file name="Hcdbs.php" hash="e761054021d2ee5d2b233f2a9e9ef0cb"/><file name="Hcdcc.php" hash="04be67f03f66fbaf7f7615796cef4eaa"/><file name="Hcddc.php" hash="d7953e4c7bb237adebdff7547ade01af"/><file name="Hcddd.php" hash="3f88025d17daad6441c1f2f4493cb957"/><file name="Hcdeps.php" hash="724af12f038ea2e8ab4545da28529bea"/><file name="Hcdgp.php" hash="c25899b07d407357b255166521be8e5b"/><file name="Hcdide.php" hash="011a116ecca0339c405aae2566f0e16b"/><file name="Hcdiv.php" hash="cb240c3c53e3797a6998262324c9c248"/><file name="Hcdmk.php" hash="75572cce005f2ecd33c7d552724796dc"/><file name="Hcdmpa.php" hash="05319d69791165c0393ecd9b5fe5459b"/><file name="Hcdpal.php" hash="ddedb86eaec7a66d97721cf080baabaf"/><file name="Hcdpf.php" hash="520f55eac6499bb061b9e79c25bf028b"/><file name="Hcdpp.php" hash="f928d16a2f5b7094d066f412dcd1949a"/><file name="Hcdsu.php" hash="357857ca8f073b69d8321d3bfc7fdd1a"/><file name="Hcdyt.php" hash="de6e549fce6daca70dad9233be9ceb27"/></dir><dir name="Resource"><file name="Encryption.php" hash="d3e12608684d89f39b378114602dacaf"/><file name="Setup.php" hash="33dd67ce8aee90fffdf3de62c850d3ee"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Bookingmode.php" hash="9133af26f8df450cbfd9ff5ed116adf1"/><file name="Recognition.php" hash="007b73ca273fe1a93ec09c6bd1bc7cab"/><file name="Returnurl.php" hash="df8357de873019dbbdef935d2ad73978"/></dir></dir></dir><file name="Transaction.php" hash="638481f33d2a6333d20ad351df680eda"/></dir><file name="README.md" hash="0a9f9310566b0fbbe67509eb600c3ac5"/><dir name="controllers"><file name="CheckoutController.php" hash="fb665e715c857c606484379691c87b24"/><file name="IndexController.php" hash="478fa789a61c15f5bcd8f154575e8238"/><file name="ResponseController.php" hash="d3cf44d607571a20b2fa1e9ec0339669"/></dir><dir name="etc"><file name="config.xml" hash="62a25bfc0a3a19ca15d6add7a2bb56eb"/><file name="system.xml" hash="9da4da78db3bb50e50dbf9b04a7819bd"/></dir><dir name="sql"><dir name="hcd_setup"><file name="install-15.1.30.php" hash="139e3c9e316dad5329d40de3e3cd43a2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="hcd.xml" hash="b1d22100ced439a653421eb15a7be538"/></dir><dir name="template"><dir name="hcd"><dir name="Info"><dir name="Info"><file name="debit.phtml" hash="0632fa163fa5bb7df9c0da2b4010c7dc"/><file name="masterpass.phtml" hash="0632fa163fa5bb7df9c0da2b4010c7dc"/></dir><file name="debit.phtml" hash="0632fa163fa5bb7df9c0da2b4010c7dc"/><file name="masterpass.phtml" hash="0632fa163fa5bb7df9c0da2b4010c7dc"/></dir><file name="button.phtml" hash="66ff2e82c4db439d3c616c455e8654f8"/><dir name="form"><file name="creditcard.phtml" hash="46cbc9443f1a1b92d8cee22afca17569"/><file name="debit.phtml" hash="d6b6912c94a2eab14fc82032049860d7"/><file name="desconly.phtml" hash="c96412bdf87c99c648c285d7669146a5"/><file name="direct-debit-secured.phtml" hash="37011aa236244920022c6dcef9e9e642"/><file name="eps.phtml" hash="b42c8ea8c536c6251487338503b4292b"/><dir name="form"><file name="creditcard.phtml" hash="46cbc9443f1a1b92d8cee22afca17569"/><file name="debit.phtml" hash="d6b6912c94a2eab14fc82032049860d7"/><file name="desconly.phtml" hash="c96412bdf87c99c648c285d7669146a5"/><file name="direct-debit-secured.phtml" hash="37011aa236244920022c6dcef9e9e642"/><file name="eps.phtml" hash="b42c8ea8c536c6251487338503b4292b"/><file name="ideal.phtml" hash="20292c1b434d94255368a664c6bcfff9"/><file name="invoice-secured.phtml" hash="f14777bb5b8e744fa2117b067a9e26d1"/><file name="masterpass.phtml" hash="2a4c0b9d1d8d0b9f797094e99e7c46b0"/><file name="postfinance.phtml" hash="9f537b0b203b75651609136fc98ea183"/></dir><file name="ideal.phtml" hash="20292c1b434d94255368a664c6bcfff9"/><file name="invoice-secured.phtml" hash="f14777bb5b8e744fa2117b067a9e26d1"/><file name="masterpass.phtml" hash="2a4c0b9d1d8d0b9f797094e99e7c46b0"/><file name="postfinance.phtml" hash="9f537b0b203b75651609136fc98ea183"/></dir><file name="index.phtml" hash="d76db58b6fba89c113144b5e5065539a"/><dir name="mail"><file name="hcd_payment_info.phtml" hash="1ec6d33fbb5bc8391a8295be1ffa5b38"/><dir name="mail"><file name="hcd_payment_info.phtml" hash="1ec6d33fbb5bc8391a8295be1ffa5b38"/></dir></dir><dir name="onepage"><file name="billing.phtml" hash="14b57c38161e6749fbc37813337c2379"/><dir name="onepage"><file name="billing.phtml" hash="14b57c38161e6749fbc37813337c2379"/><dir name="payment"><file name="methods.phtml" hash="0e2f9e12e7dfc1070404af7dfdd7b024"/></dir><file name="payment.phtml" hash="6d452186f51dc088c5007c16ddd1cf08"/><dir name="progress"><file name="payment.phtml" hash="440f57443141d1280cf18c798cc8af10"/><file name="shipping.phtml" hash="c659abf65a13a4f1fadcec6221afd1a1"/></dir><file name="progress.phtml" hash="9527eb86ec29030f4b111455d3122388"/><file name="shipping_method.phtml" hash="79f1cc31d10a35df619b15db481e9543"/></dir><dir name="payment"><file name="methods.phtml" hash="0e2f9e12e7dfc1070404af7dfdd7b024"/></dir><file name="payment.phtml" hash="6d452186f51dc088c5007c16ddd1cf08"/><dir name="progress"><file name="payment.phtml" hash="440f57443141d1280cf18c798cc8af10"/><file name="shipping.phtml" hash="c659abf65a13a4f1fadcec6221afd1a1"/></dir><file name="progress.phtml" hash="9527eb86ec29030f4b111455d3122388"/><file name="shipping_method.phtml" hash="79f1cc31d10a35df619b15db481e9543"/></dir><file name="onepage.phtml" hash="df4e2760e3804f7a2ff51d4b4cf74538"/><file name="response.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="success.phtml" hash="9cac258cb96b057b3de00ab971bf7855"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="hcd"><dir name="Info"><dir name="Info"><file name="masterpass.phtml" hash="53c30caa1d8838256686aaeef48f42eb"/></dir><file name="masterpass.phtml" hash="53c30caa1d8838256686aaeef48f42eb"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="hcd"><dir><dir name="info"><dir name="info"><dir name="pdf"><file name="directdebit.phtml" hash="58b78aba68ac0ccb2dd5ce6a55d62d5c"/><file name="invoice.phtml" hash="8f9cd8f1f71b2669c5a3ee266a7d7bfe"/><file name="prepayment.phtml" hash="96382d5d69ef69414f49efb4176f8e23"/></dir></dir><dir name="pdf"><file name="directdebit.phtml" hash="58b78aba68ac0ccb2dd5ce6a55d62d5c"/><file name="invoice.phtml" hash="8f9cd8f1f71b2669c5a3ee266a7d7bfe"/><file name="prepayment.phtml" hash="96382d5d69ef69414f49efb4176f8e23"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HeidelpayCD_Edition.xml" hash="268d503b4a88bc5bbd76f47794f78f7e"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="HeidelpayCD_Edition.csv" hash="b1e1f0017484f29a9a1f4d0c3a938833"/></dir><dir name="en_US"><file name="HeidelpayCD_Edition.csv" hash="54bf196d06fc21e43c3039ba012a8cac"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="hcd"><file name="loading.gif" hash="29868a3a7094b078733caba6b192b080"/><file name="masterpass_100_28.jpg" hash="e0907959b1e345de6a3d73f32a5f5369"/><file name="masterpass_240_66.jpg" hash="7ad0078b8a27914aceb590c4100f3aa8"/></dir></dir><dir name="css"><file name="heidelpaycd.css" hash="da93e9bb03447be97c071b5160bdc81f"/><file name="hcdcc_payment_frame.css" hash="b1f9522942c14b15fe8ef81a6d8ac4b2"/><file name="hcddc_payment_frame.css" hash="b1f9522942c14b15fe8ef81a6d8ac4b2"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="hcd"><file name="masterpass_100_28.jpg" hash="e0907959b1e345de6a3d73f32a5f5369"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="hcd"><file name="heidelpaycd.js" hash="783491bc26c795408de517240eea18a0"/><file name="heidelpaypci3.js" hash="47c0ff6f0160f2dcfacf42e00df0ea7c"/><file name="opcheckout.js" hash="7d2f7f55c3e4d0864958e1bfe05a9e74"/></dir></dir></target></contents>
45
  <compatible/>
46
  <dependencies><required><php><min>5.6.0</min><max>7.0.99</max></php></required></dependencies>
47
  </package>
skin/adminhtml/base/default/images/hcd/masterpass_100_28.jpg CHANGED
File without changes
skin/frontend/base/default/css/hcdcc_payment_frame.css CHANGED
File without changes
skin/frontend/base/default/css/hcddc_payment_frame.css CHANGED
File without changes
skin/frontend/base/default/css/heidelpaycd.css CHANGED
File without changes
skin/frontend/base/default/images/hcd/loading.gif CHANGED
File without changes
skin/frontend/base/default/images/hcd/masterpass_100_28.jpg CHANGED
File without changes
skin/frontend/base/default/images/hcd/masterpass_240_66.jpg CHANGED
File without changes