[#24] added option to drop twingle mandate reference

This commit is contained in:
B. Endres 2020-05-24 19:47:11 +02:00
parent 0e8534619e
commit ad8fb0eee7
4 changed files with 29 additions and 0 deletions

View file

@ -28,6 +28,7 @@ class CRM_Twingle_Form_Settings extends CRM_Core_Form {
public static $SETTINGS_LIST = [
'twingle_prefix',
'twingle_use_sepa',
'twingle_dont_use_reference',
'twingle_protect_recurring',
'twingle_protect_recurring_activity_type',
'twingle_protect_recurring_activity_subject',
@ -54,6 +55,12 @@ class CRM_Twingle_Form_Settings extends CRM_Core_Form {
E::ts("Use CiviSEPA")
);
$this->add(
'checkbox',
'twingle_dont_use_reference',
E::ts("Use CiviSEPA generated reference")
);
$this->add(
'select',
'twingle_protect_recurring',

View file

@ -604,6 +604,12 @@ function civicrm_api3_twingle_donation_Submit($params) {
// mandate type.
unset($mandate_data['payment_instrument_id']);
// If requested, let CiviSEPA generate the mandate reference
$use_own_mandate_reference = Civi::settings()->get('twingle_dont_use_reference');
if (!empty($use_own_mandate_reference)) {
unset($mandate_data['reference']);
}
// Create the mandate.
$mandate = civicrm_api3('SepaMandate', 'createfull', $mandate_data);

View file

@ -16,6 +16,10 @@
{ts domain="de.systopia.twingle" 1="<a href=\"https://github.com/project60/org.project60.sepa\" target=\"_blank\">CiviSEPA (<kbd>org.project60.sepa</kbd>) extension</a>"}When the %1 is enabled and one of its payment instruments is assigned to a Twingle payment method (practically the <em>debit_manual</em> payment method), submitting a Twingle donation through the API will create a SEPA mandate with the given data.{/ts}
{/htxt}
{htxt id='id-twingle_dont_use_reference'}
{ts domain="de.systopia.twingle" 1="<a href=\"https://github.com/project60/org.project60.sepa\" target=\"_blank\">CiviSEPA (<kbd>org.project60.sepa</kbd>) extension</a>"}When the %1 is enabled, you can activate this to use your own references instead of the ones submitted by Twingle.{/ts}
{/htxt}
{htxt id='id-twingle_protect_recurring'}
{ts domain="de.systopia.twingle"}Will protect all recurring contributions created by Twingle from termination, since this does NOT terminate the Twingle collection process{/ts}
{/htxt}

View file

@ -28,6 +28,18 @@
</td>
</tr>
<tr class="crm-twingle-form-block-use-sepa-reference">
<td class="label">{$form.twingle_dont_use_reference.label} &nbsp; <a onclick='CRM.help("{$form.twingle_dont_use_reference.label}", {literal}{"id":"id-{/literal}{$form.twingle_dont_use_reference.name}{literal}","file":"CRM\/Twingle\/Form\/Settings"}{/literal}); return false;' href="#" title="{ts domain="de.systopia.twingle"}Help{/ts}" class="helpicon"></a></td>
<td>
{$form.twingle_dont_use_reference.html}
<br />
<span class="description">
{$formElements.twingle_dont_use_reference.description}
</span>
</td>
</tr>
<tr class="crm-twingle-form-block-prefix">
<td class="label">{$form.twingle_prefix.label} &nbsp;<a onclick='CRM.help("{$form.twingle_prefix.label}", {literal}{"id":"id-{/literal}{$form.twingle_prefix.name}{literal}","file":"CRM\/Twingle\/Form\/Settings"}{/literal}); return false;' href="#" title="{ts domain="de.systopia.twingle"}Help{/ts}" class="helpicon"></a></td>
<td>