Merge pull request #15813 from eileenmcnaughton/fee
[civicrm-core.git] / CRM / Contribute / Page / PaymentInfo.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17 class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page {
18
19 public function preProcess() {
20 $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this, TRUE);
21 $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
22 $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
23 $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, TRUE);
24 $this->_cid = CRM_Utils_Request::retrieve('cid', 'String', $this, TRUE);
25
26 $this->assign('cid', $this->_cid);
27 $this->assign('id', $this->_id);
28 $this->assign('context', $this->_context);
29 $this->assign('component', $this->_component);
30 if ($this->_component != 'event') {
31 $this->assign('hideButtonLinks', TRUE);
32 }
33 }
34
35 public function browse() {
36 $getTrxnInfo = $this->_context == 'transaction' ? TRUE : FALSE;
37 $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($this->_id, $this->_component, $getTrxnInfo, TRUE);
38 if ($this->_context == 'payment_info') {
39 $this->assign('paymentInfo', $paymentInfo);
40 }
41 }
42
43 /**
44 * Run page.
45 *
46 * This typically involves assigning the appropriate
47 * smarty variable :)
48 *
49 * @return string
50 * The content generated by running this page
51 */
52 public function run() {
53 $this->preProcess();
54 if ($this->_action) {
55 $this->browse();
56 }
57
58 return parent::run();
59 }
60
61 }