From 8f9256699dd1228df696493b85712ca81d53796e 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 0056d1f72706..5741a2d4fdea 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1406,6 +1406,15 @@ protected function skipToThankYouPage() { * Set form variables if contribution ID is found */ public function assignFormVariablesByContributionID() { + $dummy = 0; + foreach ($this->_paymentProcessors as $pp) { + if ($pp['class_name'] == 'Payment_Dummy') { + $dummy = 1; + break; + } + } + $this->assign('dummy', $dummy); + if (empty($this->_ccid)) { return; } diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index cbdf2cbc2a34..eb98276ad515 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 $dummy} {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 fe160753f418..a90541f04941 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}This page is currently configured with test payment processor. No live financial transactions will be submitted if the test 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 the test payment processor before going live.{/ts}

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