From b04a5cdfda6f1679bc0ee2ea98c22e78e2cfdfb0 Mon Sep 17 00:00:00 2001 From: yashodha Date: Thu, 5 Jan 2023 12:41:54 +0530 Subject: [PATCH] (dev/core#3844) Dummy payment processor should be flagged as such on LIVE page --- CRM/Contribute/Form/Contribution/Main.php | 9 +++++++++ templates/CRM/Contribute/Form/Contribution/Main.tpl | 2 +- .../Contribute/Form/Contribution/PreviewHeader.tpl | 12 ++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 0056d1f727..d09ea9c253 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1406,6 +1406,15 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu * Set form variables if contribution ID is found */ public function assignFormVariablesByContributionID() { + $dummyTitle = 0; + foreach ($this->_paymentProcessors as $pp) { + if ($pp['class_name'] == 'Payment_Dummy') { + $dummyTitle = $pp['name']; + break; + } + } + $this->assign('dummyTitle', $dummyTitle); + if (empty($this->_ccid)) { return; } diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index cbdf2cbc2a..0c46bda378 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -46,7 +46,7 @@ {/literal} - {if $action & 1024} + {if ($action & 1024) or $dummyTitle} {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"} {/if} diff --git a/templates/CRM/Contribute/Form/Contribution/PreviewHeader.tpl b/templates/CRM/Contribute/Form/Contribution/PreviewHeader.tpl index fe160753f4..5570e26d88 100644 --- a/templates/CRM/Contribute/Form/Contribution/PreviewHeader.tpl +++ b/templates/CRM/Contribute/Form/Contribution/PreviewHeader.tpl @@ -8,8 +8,16 @@ +--------------------------------------------------------------------+ *} {* Displays Test-drive mode header for Contribution pages. *} -
+{if $action & 1024} +
{ts}Test-drive Your Contribution Page{/ts}

{ts}This page is currently running in test-drive mode. Transactions will be sent to your payment processor's test server. No live financial transactions will be submitted. However, a contact record will be created or updated and a test contribution record will be saved to the database. Use obvious test contact names so you can review and delete these records as needed. Test contributions are not visible on the Contributions tab, but can be viewed by searching for 'Test Contributions' in the CiviContribute search form. Refer to your payment processor's documentation for information on values to use for test credit card number, security code, postal code, etc.{/ts}

-
+
+{else} +
+ + {ts}Test payment processor on Your Contribution Page{/ts} +

{ts 1=$dummyTitle|escape}This page is currently configured to use the %1 payment processor. No live financial transactions will be submitted if %1 payment processor is selected. However, a contact record will be created or updated and a live contribution record will be saved to the database with no actual financial transaction. Remove %1 payment processor before going live.{/ts}

+
+{/if} \ No newline at end of file -- 2.25.1