Your IP : 216.73.216.240
<?php
/**
*----------------------------------------------------------------------------
* iCagenda Plugin iCagenda - Payment Paypal
*----------------------------------------------------------------------------
* @version 2.0.0 2024-02-12
*
* @package iCagenda
* @subpackage Plugin.Icagenda.Payment_Paypal
* @link https://www.icagenda.com
*
* @author Cyril Rezé
* @copyright (c) 2012-2024 Cyril Rezé / iCagenda. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
*
* @since 1.0
*----------------------------------------------------------------------------
*/
use iCutilities\Event\Event as icagendaEvent;
use Joomla\CMS\Component\ComponentHelper as JComponentHelper;
use Joomla\CMS\Language\Text as JText;
use Joomla\CMS\HTML\HTMLHelper as JHtml;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
JHtml::_('bootstrap.popover', '.hasPopover', ['trigger' => 'hover focus']);
$payments = $displayData['item']->actions['payment_paypal.payment_details'];
$evtParams = icagendaEvent::getParams($displayData['item']->eventid);
$iCparams = JComponentHelper::getParams('com_icagenda');
$action_set = $evtParams->get('registration_actions', $iCparams->get('registration_actions'));
$ticket_set = $evtParams->get('ticket_price', $iCparams->get('ticket_price'));
$consentParams = ($evtParams->get('consent_payment') == '') ? $iCparams : $evtParams;
$consentboxLabel = $consentParams->get('consent_payment_label', 'COM_ICAGENDA_REGISTRATION_CONSENT_PAYMENT_LABEL');
$labelClass = 'small iC-italic-grey';
$defaultBadgeClass = (version_compare(JVERSION, '4.0', 'lt')) ? 'label label-default' : 'badge bg-secondary';
$infoBadgeClass = (version_compare(JVERSION, '4.0', 'lt')) ? 'label label-info' : 'badge bg-info';
?>
<?php if ($ticket_set && $action_set == 'tickets.payment') : ?>
<div class="ic-payment-title">
<strong><?php echo JText::_('PLG_ICAGENDA_PAYMENT_DETAILS_LABEL'); ?></strong>
</div>
<?php foreach ($payments as $payment) : ?>
<small>
<?php if ($displayData['item']->status == 2) : ?>
<?php echo JText::sprintf('PLG_ICAGENDA_PAYMENT_PAYPAL_ABANDONED_STRING', '<span class="label">' . JText::_('PLG_ICAGENDA_PAYMENT_PAYPAL_PAYMENT_NOT_PROCESSED') . '</span>'); ?>
<?php else : ?>
<div class="mb-1">
<span class="<?php echo $labelClass; ?>">
<?php echo JText::_('PLG_ICAGENDA_PAYMENT_METHOD_LABEL'); ?>
</span>
<span class="<?php echo $defaultBadgeClass; ?>">
<?php echo $this->escape($payment->order_processor); ?>
</span>
</div>
<div class="mb-1">
<span class="<?php echo $labelClass; ?>">
<?php echo JText::_('PLG_ICAGENDA_PAYMENT_STATE_LABEL'); ?>
</span>
<span class="<?php echo $defaultBadgeClass; ?>">
<?php echo JText::_('IC_' . strtoupper($this->escape($payment->order_state))); ?>
</span>
</div>
<div class="mb-1">
<span class="<?php echo $labelClass; ?>">
<?php echo JText::_('PLG_ICAGENDA_PAYMENT_TRANSACTION_ID_LABEL'); ?>
</span>
<span class="<?php echo $defaultBadgeClass; ?>">
<?php echo $this->escape($payment->order_transaction_id); ?>
</span>
</div>
<div class="mb-1">
<span class="<?php echo $labelClass; ?>">
<?php echo JText::_('PLG_ICAGENDA_PAYMENT_TOTAL_AMOUNT_LABEL'); ?>
</span>
<span class="<?php echo $infoBadgeClass; ?>">
<?php echo $this->escape($payment->order_amount_total); ?> <?php echo $this->escape($payment->order_currency); ?>
</span>
</div>
</small>
<?php endif; ?>
<?php endforeach; ?>
<?php if (isset($displayData['user_actions']['consent_payment'])) : ?>
<div class="ic-payment-consent">
<span class="badge bg-success hasPopover"
data-bs-placement="top" data-placement="top"
title="<?php echo $displayData['user_actions']['consent_payment']['action_subject']; ?>"
data-bs-content="<?php echo $displayData['user_actions']['consent_payment']['action_body']; ?>"
data-content="<?php echo $displayData['user_actions']['consent_payment']['action_body']; ?>">
✓ <?php echo JText::_($consentboxLabel); ?>
</span>
</div>
<?php endif; ?>
<?php endif; ?>