Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed May 10, 2021
1 parent fe063ab commit 43f5232
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 43 deletions.
81 changes: 41 additions & 40 deletions ang/gocardless/GoCardlessSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,67 @@
<h1 crm-page-title>{{ts('GoCardless settings')}}</h1>

<form name="myForm" crm-ui-id-scope>
<div class="messages help">
<p ng-bind-html="ts('Please see <a %1>reference documentation</a> for these settings',
<div class="messages help">
<p ng-bind-html="ts('Please see <a %1>reference documentation</a> for these settings',
{1: 'href=&quot;https://docs.civicrm.org/gocardless/en/latest/reference/settings/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;'})"></p>
</div>
</div>

<div class="crm-block">
<div class="crm-section">
<div class="label"><label crm-ui-for="myForm.forceRecurring">Force Recurring</label></div>
<div class="content">
<label>
<input
type="checkbox"
crm-ui-id="myForm.forceRecurring"
name="forceRecurring"
ng-model="gcSettings.forceRecurring"
class="crm-form-checkbox"
/>
&nbsp; {{ts('Force recurring contributions when a GoCardless payment processor is chosen')}}
</label>
</div>
<div class="crm-block crm-form-block">
<div class="crm-section">
<div class="label"><label crm-ui-for="myForm.forceRecurring">Force Recurring</label></div>
<div class="content">
<label>
<input
type="checkbox"
crm-ui-id="myForm.forceRecurring"
name="forceRecurring"
ng-model="gcSettings.forceRecurring"
class="crm-form-checkbox"
/>
&nbsp; {{ts('Force recurring contributions when a GoCardless payment processor is chosen')}}
</label>
</div>
</div>

<div class="crm-section">
<div crm-ui-field="{name: 'myForm.sendReceiptsForCustomPayments', title: ts('Receipts')}">
<select
crm-ui-id="myForm.sendReceiptsForCustomPayments"
ng-model="gcSettings.sendReceiptsForCustomPayments"
name="sendReceiptsForCustomPayments"
class="crm-form-select"
>
>
<option value="never" >{{ts('Never send receipts')}}</option>
<option value="always" >{{ts('Always send receipts')}}</option>
<option value="recur" >{{ts('Defer to Contribution Recur record’s <code>is_email_receipt</code> field')}}</option>
</select>
<p>Whether to send receipts for non-Contribution-Page-created recurring contributions</p>
</div>

</div>

<div>
<button ng-click="$ctrl.save()">{{ts('Save')}}</button>
</div>
<h2>Active Payment processors</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Test Webhook endpoint URL</th>
<th>Live Webhook endpoint URL</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="pp in ppTable" >
<td>{{pp.name}}</td>
<td><input type="text" value="{{pp.urlTest}}"/></td>
<td><input type="text" value="{{pp.urlLive}}"/></td>
</tr>
</tbody>
</table>
</div>

<div>
<button ng-click="$ctrl.save()">{{ts('Save')}}</button>
</div>
<h2>Active Payment processors</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Test Webhook endpoint URL</th>
<th>Live Webhook endpoint URL</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="pp in ppTable" >
<td>{{pp.name}}</td>
<td><input type="text" value="{{pp.urlTest}}"/></td>
<td><input type="text" value="{{pp.urlLive}}"/></td>
</tr>
</tbody>
</table>

</form>

</div>
6 changes: 3 additions & 3 deletions gocardless.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ function gocardless_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
* Various intercepts.
*
*/
function gocardless_civicrm_buildForm( $formName, &$form ) {
function gocardless_civicrm_buildForm($formName, &$form) {

if ($formName === 'CRM_Contribute_Form_Contribution_ThankYou') {
if (!empty($_GET['redirect_flow_id'])) {
// Looks like a GoCardless thank you page. Complete redirect flow.
CRM_GoCardlessUtils::handleContributeFormThanks($form);
CRM_GoCardlessUtils::handleContributeFormThanks();
}
}
elseif ($formName === 'CRM_Contribute_Form_Contribution_Main') {
CRM_GoCardlessUtils::handleContributeFormHacks($form);
CRM_GoCardlessUtils::handleContributeFormHacks();
}
}

Expand Down

0 comments on commit 43f5232

Please sign in to comment.