PageRenderTime 43ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/home/administrator/components/com_hikashop/extensions/plg_hikashoppayment_bf_rbsglobalgateway/bf_rbsglobalgateway_configuration.php

https://bitbucket.org/rubbystar/carimod
PHP | 354 lines | 341 code | 0 blank | 13 comment | 10 complexity | 510e12c256d8be128362014ef10c3007 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, GPL-3.0
  1. <?php
  2. /**
  3. * @package HikaShop for Joomla!
  4. * @subpackage Payment Plug-in for Worldpay Global Gateway using XML Redirect.
  5. * @version 0.0.1
  6. * @author brainforge.co.uk
  7. * @copyright (C) 2011 Brainforge derived from Paypal plug-in by HIKARI SOFTWARE. All rights reserved.
  8. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
  9. *
  10. * See: http://www.worldpay.com/support/kb/gg/submittingtransactionsredirect/rxml.html
  11. *
  12. * In order to configure and use this plug-in you must have a RBS Worldpay Global Gateway account.
  13. * Worldpay Global Gateway is sometimes referred to as 'BiBit'.
  14. */
  15. defined('_JEXEC') or die('Restricted access');
  16. if(!function_exists('curl_init')){ ?>
  17. <tr><td colspan="2" style="color:red;">This plugin needs the CURL library installed but it is not available on your server.<br />Please contact your web hosting to set it up.</td></tr>
  18. <?php }
  19. if(!class_exists('SimpleXMLElement')){ ?>
  20. <tr><td colspan="2" style="color:red;">This plugin needs the SimpleXML library of PHP5 installed but it is not available on your server.<br />Please contact your web hosting to set it up.</td></tr>
  21. <?php }
  22. ?>
  23. <tr><td colspan="2"><hr /></td></tr>
  24. <tr id="instid"><td colspan="2">Required for <a href="http://www.worldpay.com/support/kb/gg/payment-pages-pilot/Redirectamends.pdf" target="wpkbggpppr">Hosted Payment Pages</a>.</td></tr>
  25. <tr title="Only required for hosted payment pages.">
  26. <td class="key">
  27. <label for="data[payment][payment_params][instid]">
  28. <?php echo 'Installation ID'; ?>
  29. </label>
  30. </td>
  31. <td>
  32. <input type="text" name="data[payment][payment_params][instid]" value="<?php echo @$this->element->payment_params->instid; ?>" />
  33. </td>
  34. </tr>
  35. <tr><td colspan="2"><hr /></td></tr>
  36. <tr>
  37. <td class="key">
  38. <label for="data[payment][payment_params][adminCode]">Admin Code</label>
  39. </td>
  40. <td>
  41. <input type="text" name="data[payment][payment_params][adminCode]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->adminCode); ?>" />
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="key">
  46. <label for="data[payment][payment_params][merchantCode]">Merchant Code</label>
  47. </td>
  48. <td>
  49. <input type="text" name="data[payment][payment_params][merchantCode]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->merchantCode); ?>" />
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="key">
  54. <label for="data[payment][payment_params][macSecret]">MAC Secret</label>
  55. </td>
  56. <td>
  57. <input type="text" name="data[payment][payment_params][macSecret]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->macSecret); ?>" />
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="key">
  62. <label for="data[payment][payment_params][xmlurl]">XML Order URL</label>
  63. </td>
  64. <td>
  65. <input type="text" name="data[payment][payment_params][xmlurl]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->xmlurl); ?>" />
  66. </td>
  67. </tr>
  68. <tr>
  69. <td class="key">
  70. <label for="data[payment][payment_params][paymentRefField]">WorldPay Reference Order Field<br /><div style="font-size:70%;">(Commercial version only)</div></label>
  71. </td>
  72. <td>
  73. <input type="text" name="data[payment][payment_params][paymentRefField]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->paymentRefField); ?>" />
  74. </td>
  75. </tr>
  76. <tr>
  77. <td class="key">
  78. <label for="data[payment][payment_params][responseRefField]">WorldPay Enquiry Response Field<div style="font-size:70%;">(Commercial version only)</div></label>
  79. </td>
  80. <td>
  81. <input type="text" name="data[payment][payment_params][responseRefField]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->responseRefField); ?>" />
  82. </td>
  83. </tr>
  84. <tr><td colspan="2"><hr /></td></tr>
  85. <tr>
  86. <td class="key">
  87. <label for="data[payment][payment_params][redirect_button]">Redirect to WorldPay Button</label>
  88. </td>
  89. <td>
  90. <textarea name="data[payment][payment_params][redirect_button]" rows="5" cols="40"><?php echo htmlspecialchars($this->element->payment_params->redirect_button); ?></textarea>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td class="key">
  95. <label for="data[payment][payment_params][debug]">
  96. <?php echo JText::_( 'DEBUG' ); ?>
  97. </label>
  98. </td>
  99. <td>
  100. <?php echo JHTML::_('hikaselect.booleanlist', "data[payment][payment_params][debug]" , '',@$this->element->payment_params->debug ); ?>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class="key">
  105. <label for="data[payment][payment_params][showVars]">
  106. <?php echo 'Show Parameters'; ?>
  107. </label>
  108. </td>
  109. <td>
  110. <?php echo JHTML::_('hikaselect.booleanlist', "data[payment][payment_params][showVars]" , '',@$this->element->payment_params->showVars ); ?>
  111. </td>
  112. </tr>
  113. <tr><td colspan="2"><hr /></td></tr>
  114. <tr>
  115. <td class="key">
  116. <label for="data[payment][payment_params][htmllayout]">
  117. <?php echo 'Order Content HTML Layout'; ?>
  118. </label>
  119. </td>
  120. <td>
  121. <?php
  122. jimport('joomla.filesystem.folder');
  123. $files = JFolder::files(dirname(__FILE__),'bf_rbsglobalgateway_template_.*');
  124. sort($files);
  125. $values = array();
  126. foreach ($files as $file) {
  127. $name = basename($file, '.php');
  128. if ($name != $file) $values[] = JHTML::_('select.option', $file, $name );
  129. }
  130. echo JHTML::_('select.genericlist', $values, 'data[payment][payment_params][htmllayout]', 'class="inputbox" size="1"', 'value', 'text', @$this->element->payment_params->htmllayout);
  131. ?>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td class="key">
  136. <label for="data[payment][payment_params][show_tax_amount]">Show Tax Amount</label>
  137. </td>
  138. <td>
  139. <?php echo JHTML::_('hikaselect.booleanlist', "data[payment][payment_params][show_tax_amount]" , '',@$this->element->payment_params->show_tax_amount ); ?>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td class="key">
  144. <label for="data[payment][payment_params][description]">Order Description</label>
  145. </td>
  146. <td>
  147. <textarea name="data[payment][payment_params][description]" rows="2" cols="40"><?php echo htmlspecialchars($this->element->payment_params->description); ?></textarea>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td class="key">
  152. <label for="data[payment][payment_params][paymentMethodMask]">Payment Method Mask</label>
  153. </td>
  154. <td>
  155. <textarea id="paymentMethodMask" name="data[payment][payment_params][paymentMethodMask]" rows="3" cols="40"><?php echo $this->element->payment_params->paymentMethodMask; ?></textarea>
  156. </td>
  157. </tr>
  158. <tr>
  159. <td class="key">
  160. <label for="data[payment][payment_params][address_type]">
  161. <?php echo 'Customer Address'; ?>
  162. </label>
  163. </td>
  164. <td>
  165. <?php
  166. $values = array();
  167. $values[] = JHTML::_('select.option', '',JText::_('NO_ADDRESS') );
  168. $values[] = JHTML::_('select.option', 'billing',JText::_('HIKASHOP_BILLING_ADDRESS'));
  169. $values[] = JHTML::_('select.option', 'shipping',JText::_('HIKASHOP_SHIPPING_ADDRESS'));
  170. $values[] = JHTML::_('select.option', 'billing,shipping','Both addresses');
  171. echo JHTML::_('select.genericlist', $values, 'data[payment][payment_params][address_type]', 'class="inputbox" size="1"', 'value', 'text', @$this->element->payment_params->address_type);
  172. ?>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td class="key">
  177. <label for="data[payment][payment_params][houseNoField]">House Number Field</label>
  178. </td>
  179. <td>
  180. <input type="text" name="data[payment][payment_params][houseNoField]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->houseNoField); ?>" />
  181. </td>
  182. </tr>
  183. <tr>
  184. <td class="key">
  185. <label for="data[payment][payment_params][houseNoField]">House Name Field</label>
  186. </td>
  187. <td>
  188. <input type="text" name="data[payment][payment_params][houseNameField]" size="40" value="<?php echo htmlspecialchars(@$this->element->payment_params->houseNameField); ?>" />
  189. </td>
  190. </tr>
  191. <tr><td colspan="2"><hr /></td></tr>
  192. <tr>
  193. <td class="key">
  194. <label for="data[payment][payment_params][notification]">
  195. <?php echo JText::sprintf( 'ALLOW_NOTIFICATIONS_FROM_X', '<br/>' . $this->element->payment_name); ?>
  196. </label>
  197. </td>
  198. <td>
  199. <?php echo JHTML::_('hikaselect.booleanlist', "data[payment][payment_params][notification]" , '',@$this->element->payment_params->notification ); ?>
  200. </td>
  201. </tr>
  202. <tr>
  203. <td class="key">
  204. <label for="data[payment][payment_params][invalid_status]">
  205. <?php echo JText::_( 'INVALID_STATUS' ); ?>
  206. </label>
  207. </td>
  208. <td>
  209. <?php echo $this->data['category']->display("data[payment][payment_params][invalid_status]",@$this->element->payment_params->invalid_status); ?>
  210. </td>
  211. </tr>
  212. <tr>
  213. <td class="key">
  214. <label for="data[payment][payment_params][pending_status]">
  215. <?php echo JText::_( 'PENDING_STATUS' ); ?>
  216. </label>
  217. </td>
  218. <td>
  219. <?php echo $this->data['category']->display("data[payment][payment_params][pending_status]",@$this->element->payment_params->pending_status); ?>
  220. </td>
  221. </tr>
  222. <tr>
  223. <td class="key">
  224. <label for="data[payment][payment_params][verified_status]">
  225. <?php echo JText::_( 'VERIFIED_STATUS' ); ?>
  226. </label>
  227. </td>
  228. <td>
  229. <?php echo $this->data['category']->display("data[payment][payment_params][verified_status]",@$this->element->payment_params->verified_status); ?>
  230. </td>
  231. </tr>
  232. <tr>
  233. <td class="key">
  234. <label for="data[payment][payment_params][cancelled_status]">Cancelled Status</label>
  235. </td>
  236. <td>
  237. <?php echo $this->data['category']->display("data[payment][payment_params][cancelled_status]",@$this->element->payment_params->cancelled_status); ?>
  238. </td>
  239. </tr>
  240. <tr>
  241. <td class="key">
  242. <label for="data[payment][payment_params][invalidURL]">Customer Invalid URL</label>
  243. </td>
  244. <td>
  245. <input type="text" name="data[payment][payment_params][invalidURL]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->invalidURL); ?>" />
  246. </td>
  247. </tr>
  248. <tr>
  249. <td class="key">
  250. <label for="data[payment][payment_params][pendingURL]">Customer Pending URL</label>
  251. </td>
  252. <td>
  253. <input type="text" name="data[payment][payment_params][pendingURL]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->pendingURL); ?>" />
  254. </td>
  255. </tr>
  256. <tr>
  257. <td class="key">
  258. <label for="data[payment][payment_params][verifiedURL]">Customer Confirmed URL</label>
  259. </td>
  260. <td>
  261. <input type="text" name="data[payment][payment_params][verifiedURL]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->verifiedURL); ?>" />
  262. </td>
  263. </tr>
  264. <tr>
  265. <td class="key">
  266. <label for="data[payment][payment_params][cancelledURL]">Customer Cancelled URL</label>
  267. </td>
  268. <td>
  269. <input type="text" name="data[payment][payment_params][cancelledURL]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->cancelledURL); ?>" />
  270. </td>
  271. </tr>
  272. <tr>
  273. <td class="key">
  274. <label for="data[payment][payment_params][invalidMessage]">Invalid Notification Message</label>
  275. </td>
  276. <td>
  277. <textarea name="data[payment][payment_params][invalidMessage]" rows="3" cols="40"><?php echo htmlspecialchars($this->element->payment_params->invalidMessage); ?></textarea>
  278. </td>
  279. </tr>
  280. <tr>
  281. <td class="key">
  282. <label for="data[payment][payment_params][pendingMessage]">Pending Notification Message</label>
  283. </td>
  284. <td>
  285. <textarea name="data[payment][payment_params][pendingMessage]" rows="3" cols="40"><?php echo htmlspecialchars($this->element->payment_params->pendingMessage); ?></textarea>
  286. </td>
  287. </tr>
  288. <tr>
  289. <td class="key">
  290. <label for="data[payment][payment_params][verifiedMessage]">Verified Notification Message</label>
  291. </td>
  292. <td>
  293. <textarea name="data[payment][payment_params][verifiedMessage]" rows="3" cols="40"><?php echo htmlspecialchars($this->element->payment_params->verifiedMessage); ?></textarea>
  294. </td>
  295. </tr>
  296. <tr>
  297. <td class="key">
  298. <label for="data[payment][payment_params][cancelledMessage]">Cancelled Notification Message</label>
  299. </td>
  300. <td>
  301. <textarea name="data[payment][payment_params][cancelledMessage]" rows="3" cols="40"><?php echo htmlspecialchars($this->element->payment_params->cancelledMessage); ?></textarea>
  302. </td>
  303. </tr>
  304. <tr><td colspan="2"><hr /></td></tr>
  305. <tr><td colspan="2">These fields are not used if you are using <a href="http://www.worldpay.com/support/kb/gg/payment-pages-pilot/Redirectamends.pdf" target="wpkbggpppr">Hosted Payment Pages</a> and have specified an <a href="#instid">Installation ID</a>.</td></tr>
  306. <tr>
  307. <td class="key">
  308. <label for="data[payment][payment_params][bodyAttr]">Body Attributes (bodyAttr Parameter)</label>
  309. </td>
  310. <td>
  311. <input type="text" name="data[payment][payment_params][bodyAttr]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->bodyAttr); ?>" />
  312. </td>
  313. </tr>
  314. <tr>
  315. <td class="key">
  316. <label for="data[payment][payment_params][fontAttr]">Font Attributes (fontAttr Parameter)</label>
  317. </td>
  318. <td>
  319. <input type="text" name="data[payment][payment_params][fontAttr]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->fontAttr); ?>" />
  320. </td>
  321. </tr>
  322. <tr title="Custom CSS which is inserted into the XML Order Content field and used by the selected layout.">
  323. <td class="key">
  324. <label for="data[payment][payment_params][orderContentCSS]">Order Content CSS</label>
  325. </td>
  326. <td>
  327. <textarea name="data[payment][payment_params][orderContentCSS]" rows="5" cols="40"><?php echo htmlspecialchars($this->element->payment_params->orderContentCSS); ?></textarea>
  328. </td>
  329. </tr>
  330. <tr title="Site logo available for use by the selected layout.">
  331. <td class="key">
  332. <label for="data[payment][payment_params][siteLogo]">Site Logo</label>
  333. </td>
  334. <td>
  335. <input type="text" name="data[payment][payment_params][siteLogo]" size="60" value="<?php echo htmlspecialchars(@$this->element->payment_params->siteLogo); ?>" />
  336. </td>
  337. </tr>
  338. <tr title="Information available for use by the selected layout.">
  339. <td class="key">
  340. <label for="data[payment][payment_params][contactInformation]">Contact Information</label>
  341. </td>
  342. <td>
  343. <textarea id="contactInformation" name="data[payment][payment_params][contactInformation]" rows="3" cols="40"><?php echo htmlspecialchars($this->element->payment_params->contactInformation); ?></textarea>
  344. </td>
  345. </tr>
  346. <tr title="Information available for use by the selected layout.">
  347. <td class="key">
  348. <label for="data[payment][payment_params][billingNotice]">Billing Notice</label>
  349. </td>
  350. <td>
  351. <textarea id="billingNotice" name="data[payment][payment_params][billingNotice]" rows="3" cols="40"><?php echo htmlspecialchars($this->element->payment_params->billingNotice); ?></textarea>
  352. </td>
  353. </tr>
  354. <tr><td colspan="2"><hr /></td></tr>