Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
b9b62c23
Unverified
Commit
b9b62c23
authored
3 years ago
by
Seamus Lee
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #21279 from eileenmcnaughton/upsub
[Ref] Deprecate Core_Error handling
parents
4869af71
e4407ea7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Contribute/Form/UpdateSubscription.php
+10
-11
10 additions, 11 deletions
CRM/Contribute/Form/UpdateSubscription.php
with
10 additions
and
11 deletions
CRM/Contribute/Form/UpdateSubscription.php
+
10
−
11
View file @
b9b62c23
...
...
@@ -14,6 +14,7 @@
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
use
Civi\Payment\Exception\PaymentProcessorException
;
/**
* This class generates form components generic to recurring contributions.
...
...
@@ -111,7 +112,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
$this
->
assign
(
'editableScheduleFields'
,
array_diff
(
$this
->
editableScheduleFields
,
$alreadyHardCodedFields
));
if
(
$this
->
_subscriptionDetails
->
contact_id
)
{
list
(
$this
->
_donorDisplayName
,
$this
->
_donorEmail
)
=
CRM_Contact_BAO_Contact
::
getContactDetails
(
$this
->
_subscriptionDetails
->
contact_id
);
[
$this
->
_donorDisplayName
,
$this
->
_donorEmail
]
=
CRM_Contact_BAO_Contact
::
getContactDetails
(
$this
->
_subscriptionDetails
->
contact_id
);
}
CRM_Utils_System
::
setTitle
(
ts
(
'Update Recurring Contribution'
));
...
...
@@ -210,18 +211,16 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
if
(
$this
->
_paymentProcessorObj
->
supports
(
'changeSubscriptionAmount'
))
{
try
{
$updateSubscription
=
$this
->
_paymentProcessorObj
->
changeSubscriptionAmount
(
$message
,
$params
);
if
(
$updateSubscription
instanceof
CRM_Core_Error
)
{
CRM_Core_Error
::
deprecatedWarning
(
'An exception should be thrown'
);
throw
new
PaymentProcessorException
(
ts
(
'Could not update the Recurring contribution details'
));
}
}
catch
(
\Civi\Payment\Exception\
PaymentProcessorException
$e
)
{
catch
(
PaymentProcessorException
$e
)
{
CRM_Core_Error
::
statusBounce
(
$e
->
getMessage
());
}
}
if
(
is_a
(
$updateSubscription
,
'CRM_Core_Error'
))
{
CRM_Core_Error
::
displaySessionError
(
$updateSubscription
);
$status
=
ts
(
'Could not update the Recurring contribution details'
);
$msgTitle
=
ts
(
'Update Error'
);
$msgType
=
'error'
;
}
elseif
(
$updateSubscription
)
{
if
(
$updateSubscription
)
{
// Handle custom data
$params
[
'custom'
]
=
CRM_Core_BAO_CustomField
::
postProcess
(
$params
,
$this
->
contributionRecurID
,
'ContributionRecur'
);
// save the changes
...
...
@@ -296,7 +295,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
$receiptFrom
=
"
$domainValues[0]
<
$domainValues[1]
>"
;
}
list
(
$donorDisplayName
,
$donorEmail
)
=
CRM_Contact_BAO_Contact
::
getContactDetails
(
$contactID
);
[
$donorDisplayName
,
$donorEmail
]
=
CRM_Contact_BAO_Contact
::
getContactDetails
(
$contactID
);
$tplParams
=
[
'recur_frequency_interval'
=>
$this
->
_subscriptionDetails
->
frequency_interval
,
...
...
@@ -319,7 +318,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_Contrib
'toName'
=>
$donorDisplayName
,
'toEmail'
=>
$donorEmail
,
];
list
(
$sent
)
=
CRM_Core_BAO_MessageTemplate
::
sendTemplate
(
$sendTemplateParams
);
[
$sent
]
=
CRM_Core_BAO_MessageTemplate
::
sendTemplate
(
$sendTemplateParams
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment