commit
0b9c1709fd
4 changed files with 12 additions and 8 deletions
|
@ -607,7 +607,8 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
||||||
if (!isset($profile_data[$key]) && $required) {
|
if (!isset($profile_data[$key]) && $required) {
|
||||||
CRM_Core_Session::setStatus(
|
CRM_Core_Session::setStatus(
|
||||||
E::ts(
|
E::ts(
|
||||||
'The required configuration option "%1" has no value. Saving the profile might set this option to a possibly unwanted default value.',
|
'The required configuration option "%1" has no value.'
|
||||||
|
. ' Saving the profile might set this option to a possibly unwanted default value.',
|
||||||
[1 => $metadata['label'] ?? $key]
|
[1 => $metadata['label'] ?? $key]
|
||||||
),
|
),
|
||||||
E::ts('Error'),
|
E::ts('Error'),
|
||||||
|
|
|
@ -73,7 +73,7 @@ class CRM_Twingle_Submission {
|
||||||
// Get the payment instrument defined within the profile, or return an error
|
// Get the payment instrument defined within the profile, or return an error
|
||||||
// if none matches (i.e. an unknown payment method was submitted).
|
// if none matches (i.e. an unknown payment method was submitted).
|
||||||
$payment_instrument_id = $profile->getAttribute('pi_' . $params['payment_method'], '');
|
$payment_instrument_id = $profile->getAttribute('pi_' . $params['payment_method'], '');
|
||||||
if ('' !== $payment_instrument_id) {
|
if ('' === $payment_instrument_id) {
|
||||||
throw new CRM_Core_Exception(
|
throw new CRM_Core_Exception(
|
||||||
E::ts('Payment method could not be matched to existing payment instrument.'),
|
E::ts('Payment method could not be matched to existing payment instrument.'),
|
||||||
'invalid_format'
|
'invalid_format'
|
||||||
|
|
|
@ -116,7 +116,10 @@ class CRM_Twingle_Tools {
|
||||||
* Recurring contribution fields.
|
* Recurring contribution fields.
|
||||||
* @throws Exception could be one of the measures
|
* @throws Exception could be one of the measures
|
||||||
*/
|
*/
|
||||||
public static function processRecurringContributionTermination(int $recurring_contribution_id, array $recurring_contribution) {
|
public static function processRecurringContributionTermination(
|
||||||
|
int $recurring_contribution_id,
|
||||||
|
array $recurring_contribution
|
||||||
|
) {
|
||||||
// check if we're suspended
|
// check if we're suspended
|
||||||
if (self::$protection_suspended) {
|
if (self::$protection_suspended) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -532,7 +532,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
: 'false';
|
: 'false';
|
||||||
if (
|
if (
|
||||||
(bool) $profile->getAttribute('newsletter_double_opt_in')
|
(bool) $profile->getAttribute('newsletter_double_opt_in')
|
||||||
&& isset($params['newsletter'])
|
&& (bool) ($params['newsletter'] ?? FALSE)
|
||||||
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
||||||
) {
|
) {
|
||||||
$group_memberships = array_column(
|
$group_memberships = array_column(
|
||||||
|
@ -572,7 +572,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
// If requested, add contact to newsletter groups defined in the profile.
|
// If requested, add contact to newsletter groups defined in the profile.
|
||||||
}
|
}
|
||||||
elseif (
|
elseif (
|
||||||
isset($params['newsletter'])
|
(bool) ($params['newsletter'] ?? FALSE)
|
||||||
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
&& is_array($groups = $profile->getAttribute('newsletter_groups'))
|
||||||
) {
|
) {
|
||||||
foreach ($groups as $group_id) {
|
foreach ($groups as $group_id) {
|
||||||
|
@ -591,7 +591,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
|
|
||||||
// If requested, add contact to postinfo groups defined in the profile.
|
// If requested, add contact to postinfo groups defined in the profile.
|
||||||
if (
|
if (
|
||||||
isset($params['postinfo'])
|
(bool) ($params['postinfo'] ?? FALSE)
|
||||||
&& is_array($groups = $profile->getAttribute('postinfo_groups'))
|
&& is_array($groups = $profile->getAttribute('postinfo_groups'))
|
||||||
) {
|
) {
|
||||||
foreach ($groups as $group_id) {
|
foreach ($groups as $group_id) {
|
||||||
|
@ -608,7 +608,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
// profile. If an organisation is provided, add it to the groups instead.
|
// profile. If an organisation is provided, add it to the groups instead.
|
||||||
// (see issue #83)
|
// (see issue #83)
|
||||||
if (
|
if (
|
||||||
isset($params['donation_receipt'])
|
(bool) ($params['donation_receipt'] ?? FALSE)
|
||||||
&& is_array($groups = $profile->getAttribute('donation_receipt_groups'))
|
&& is_array($groups = $profile->getAttribute('donation_receipt_groups'))
|
||||||
) {
|
) {
|
||||||
foreach ($groups as $group_id) {
|
foreach ($groups as $group_id) {
|
||||||
|
@ -666,7 +666,7 @@ function civicrm_api3_twingle_donation_Submit($params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$creditor_id = $profile->getAttribute('sepa_creditor_id');
|
$creditor_id = $profile->getAttribute('sepa_creditor_id');
|
||||||
if (!is_int($creditor_id)) {
|
if (!isset($creditor_id) || '' === $creditor_id) {
|
||||||
throw new BaseException(
|
throw new BaseException(
|
||||||
E::ts('SEPA creditor is not configured for profile "%1".', [1 => $profile->getName()])
|
E::ts('SEPA creditor is not configured for profile "%1".', [1 => $profile->getName()])
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue