Skip to content

Commit

Permalink
(dev/core#3844) Dummy payment processor should be flagged as such on …
Browse files Browse the repository at this point in the history
…LIVE page
  • Loading branch information
yashodha committed Jan 5, 2023
1 parent f9b8226 commit 8f92566
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CRM/Contribute/Form/Contribution/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/Contribution/Main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</script>
{/literal}

{if $action & 1024}
{if ($action & 1024) or $dummy}
{include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"}
{/if}

Expand Down
12 changes: 10 additions & 2 deletions templates/CRM/Contribute/Form/Contribution/PreviewHeader.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@
+--------------------------------------------------------------------+
*}
{* Displays Test-drive mode header for Contribution pages. *}
<div class="messages status no-popup">
{if $action & 1024}
<div class="messages status no-popup">
<i class="crm-i fa-cogs" aria-hidden="true"></i>
<strong>{ts}Test-drive Your Contribution Page{/ts}</strong>
<p>{ts}This page is currently running in <strong>test-drive mode</strong>. Transactions will be sent to your payment processor's test server. <strong>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.</strong> Refer to your payment processor's documentation for information on values to use for test credit card number, security code, postal code, etc.{/ts}</p>
</div>
</div>
{else}
<div class="messages status no-popup">
<i class="crm-i fa-cogs"></i>
<strong>{ts}Test payment processor on Your Contribution Page{/ts}</strong>
<p>{ts}This page is currently configured with <strong>test payment processor</strong>. <strong>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.</strong>{/ts}</p>
</div>
{/if}

0 comments on commit 8f92566

Please sign in to comment.