--- /dev/null
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved. |
+ | |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * Class CRM_Event_Tokens
+ *
+ * Generate "event.*" tokens.
+ */
+class CRM_Financial_FinancialTrxnTokens extends CRM_Core_EntityTokens {
+
+ /**
+ * Get the entity name for api v4 calls.
+ *
+ * @return string
+ */
+ protected function getApiEntityName(): string {
+ return 'FinancialTrxn';
+ }
+
+}
[]
))->addTag('kernel.event_subscriber')->setPublic(TRUE);
}
+ $container->setDefinition("crm_financial_trxn_tokens", new Definition(
+ 'CRM_Financial_FinancialTrxnTokens',
+ []
+ ))->addTag('kernel.event_subscriber')->setPublic(TRUE);
+
$container->setDefinition('civi_token_impliedcontext', new Definition(
'Civi\Token\ImpliedContextSubscriber',
[]
+--------------------------------------------------------------------+
*/
+use Civi\Api4\FinancialTrxn;
use Civi\Token\TokenProcessor;
use Civi\Api4\LocBlock;
use Civi\Api4\Email;
The End
Czech Republic
', $text);
+ $financialTrxn = FinancialTrxn::get()->addWhere('is_payment', '=', TRUE)->execute()->first();
+ $text = $this->renderText(['financial_trxnId' => $financialTrxn['id']], '{financial_trxn.total_amount}', [], FALSE);
+ $this->assertEquals('$100.00', $text);
}
/**