// Set URL
switch ($action) {
case 'cancel':
+ if (!$this->supports('cancelRecurring')) {
+ return NULL;
+ }
$url = 'civicrm/contribute/unsubscribe';
break;
break;
case 'update':
+ if (!$this->supports('changeSubscriptionAmount') && !$this->supports('editRecurringContribution')) {
+ return NULL;
+ }
$url = 'civicrm/contribute/updaterecur';
break;
}
return array('amount', 'next_sched_contribution_date');
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return bool|object
+ */
+ public function cancelSubscription(&$message = '', $params = array()) {
+ return TRUE;
+ }
+
}
'templates' => [
['name' => 'contribution_invoice_receipt', 'type' => 'html'],
]
+ ],
+ [
+ 'version' => '5.10.alpha1',
+ 'upgrade_descriptor' => ts('Show recurring cancel/update URLs in receipt based on payment processor capabilities'),
+ 'label' => ts('Receipts - cancel/update subscription URLs'),
+ 'templates' => [
+ ['name' => 'contribution_online_receipt', 'type' => 'text'],
+ ['name' => 'contribution_online_receipt', 'type' => 'html'],
+ ['name' => 'contribution_recurring_notify', 'type' => 'text'],
+ ['name' => 'contribution_recurring_notify', 'type' => 'html'],
+ ['name' => 'membership_online_receipt', 'type' => 'text'],
+ ['name' => 'membership_online_receipt', 'type' => 'html'],
+ ]
]
];
}
</tr>
{/if}
- {if $is_recur}
- {if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'}
- <tr>
+ {if $is_recur}
+ <tr>
<td colspan="2" {$labelStyle}>
- {ts 1=$cancelSubscriptionUrl}This is a recurring contribution. You can cancel future contributions by <a href="%1">visiting this web page</a>.{/ts}
- </td>
- {if $updateSubscriptionBillingUrl}
- </tr>
- <tr>
- <td colspan="2" {$labelStyle}>
- {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
- </td>
- {/if}
- </tr>
- <tr>
- <td colspan="2" {$labelStyle}>
- {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
+ {ts}This is a recurring contribution.{/ts}
+ {if $cancelSubscriptionUrl}
+ {ts 1=$cancelSubscriptionUrl}You can cancel future contributions by <a href="%1">visiting this web page</a>.{/ts}
+ {/if}
</td>
- </tr>
+ </tr>
+ {if $updateSubscriptionBillingUrl}
+ <tr>
+ <td colspan="2" {$labelStyle}>
+ {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
+ </td>
+ </tr>
{/if}
- {/if}
+ {if $updateSubscriptionUrl}
+ <tr>
+ <td colspan="2" {$labelStyle}>
+ {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
+ </td>
+ </tr>
+ {/if}
+ {/if}
{if $honor_block_is_active}
<tr>
{ts}Transaction #{/ts}: {$trxn_id}
{/if}
-{if $is_recur and ($contributeMode eq 'notify' or $contributeMode eq 'directIPN')}
-{ts}This is a recurring contribution. You can cancel future contributions at:{/ts}
+{if $is_recur}
+{ts}This is a recurring contribution.{/ts}
+
+{if $cancelSubscriptionUrl}
+{ts}You can cancel future contributions at:{/ts}
{$cancelSubscriptionUrl}
+{/if}
+
{if $updateSubscriptionBillingUrl}
{ts}You can update billing details for this recurring contribution at:{/ts}
{$updateSubscriptionBillingUrl}
{/if}
+
+{if $updateSubscriptionUrl}
{ts}You can update recurring contribution amount or change the number of installments for this recurring contribution at:{/ts}
{$updateSubscriptionUrl}
+{/if}
{/if}
{if $honor_block_is_active}
<p>{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s). {/ts}</p>
</td>
</tr>
+ {if $cancelSubscriptionUrl}
<tr>
- <td {$labelStyle}>
- {ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
- </td>
+ <td {$labelStyle}>
+ {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
+ </td>
</tr>
+ {/if}
{if $updateSubscriptionBillingUrl}
<tr>
<td {$labelStyle}>
<p>{ts}Start Date{/ts}: {$recur_start_date|crmDate}</p>
</td>
</tr>
+ {if $cancelSubscriptionUrl}
<tr>
<td {$labelStyle}>
- {ts 1=$cancelSubscriptionUrl} You can cancel the recurring contribution option by <a href="%1">visiting this web page</a>.{/ts}
+ {ts 1=$cancelSubscriptionUrl} You can cancel the recurring contribution option by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
+ {/if}
{if $updateSubscriptionBillingUrl}
<tr>
<td {$labelStyle}>
- {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
+ {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
</td>
</tr>
{/if}
+ {if $updateSubscriptionUrl}
<tr>
<td {$labelStyle}>
- {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
+ {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
</td>
- </tr>
+ </tr>
+ {/if}
{/if}
{elseif $recur_txnType eq 'END'}
{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s).{/ts}
-{ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
+{if $cancelSubscriptionUrl}
+{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
+
+{/if}
{if $updateSubscriptionBillingUrl}
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by <a href="%1">visiting this web page</a>.{/ts}
{ts}Start Date{/ts}: {$recur_start_date|crmDate}
+{if $cancelSubscriptionUrl}
{ts 1=$cancelSubscriptionUrl}You can cancel the recurring contribution option by <a href="%1">visiting this web page</a>.{/ts}
+{/if}
+
{if $updateSubscriptionBillingUrl}
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
{/if}
+
+{if $updateSubscriptionUrl}
{ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by <a href="%1">visiting this web page</a>.{/ts}
+
+{/if}
{/if}
{elseif $recur_txnType eq 'END'}
</tr>
{/if}
{if $is_recur}
- {if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'}
<tr>
<td colspan="2" {$labelStyle}>
- {ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
+ {ts}This membership will be renewed automatically.{/ts}
+ {if $cancelSubscriptionUrl}
+ {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by <a href="%1">visiting this web page</a>.{/ts}
+ {/if}
</td>
</tr>
{if $updateSubscriptionBillingUrl}
</td>
</tr>
{/if}
- {/if}
{/if}
{if $honor_block_is_active}
{/if}
{if $is_recur}
-{if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'}
-{ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by visiting this web page: %1.{/ts}
+{ts}This membership will be renewed automatically.{/ts}
+{if $cancelSubscriptionUrl}
+
+{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page: %1.{/ts}
+
+{/if}
+
{if $updateSubscriptionBillingUrl}
{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by <a href="%1">visiting this web page</a>.{/ts}
{/if}
{/if}
-{/if}
{if $honor_block_is_active }
===========================================================