Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sluc23
mjwshared
Commits
edd64cfc
Commit
edd64cfc
authored
Apr 05, 2021
by
mattwire
Committed by
mattwire
Apr 10, 2021
Browse files
Add ability to force (re)processing of a PaymentprocessorWebhook via API
parent
b63826be
Changes
2
Hide whitespace changes
Inline
Side-by-side
api/v3/Job/ProcessPaymentprocessorWebhooks.php
View file @
edd64cfc
...
...
@@ -29,11 +29,21 @@ function civicrm_api3_job_process_paymentprocessor_webhooks($params) {
->
execute
();
}
$paymentProcessorWebhooks
=
PaymentprocessorWebhook
::
get
()
->
setCheckPermissions
(
FALSE
)
// Replace with ::update(FALSE) when minversion = 5.29
->
addWhere
(
'processed_date'
,
'IS NULL'
)
->
addWhere
(
'status'
,
'IS NULL'
)
->
execute
();
if
(
!
empty
(
$params
[
'id'
]))
{
// Allow to force processing of a single record
$paymentProcessorWebhooks
=
PaymentprocessorWebhook
::
get
()
->
setCheckPermissions
(
FALSE
)
// Replace with ::update(FALSE) when minversion = 5.29
->
addWhere
(
'id'
,
'='
,
$params
[
'id'
])
->
execute
();
}
else
{
$paymentProcessorWebhooks
=
PaymentprocessorWebhook
::
get
()
->
setCheckPermissions
(
FALSE
)
// Replace with ::update(FALSE) when minversion = 5.29
->
addWhere
(
'processed_date'
,
'IS NULL'
)
->
addWhere
(
'status'
,
'IS NULL'
)
->
execute
();
}
$results
=
[];
if
(
!
empty
(
$paymentProcessorWebhooks
->
rowCount
))
{
PaymentprocessorWebhook
::
update
()
...
...
@@ -77,4 +87,8 @@ function _civicrm_api3_job_process_paymentprocessor_webhooks_spec(&$params) {
$params
[
'delete_old'
][
'api.default'
]
=
'-3 month'
;
$params
[
'delete_old'
][
'title'
]
=
'Delete old records after (default: -3 month)'
;
$params
[
'delete_old'
][
'description'
]
=
'Delete old records from database. Specify 0 to disable. Default is "-3 month"'
;
$params
[
'delete_old'
][
'type'
]
=
CRM_Utils_Type
::
T_STRING
;
$params
[
'id'
][
'title'
]
=
'ID of PaymentprocessorWebhook record (for debugging)'
;
$params
[
'id'
][
'description'
]
=
'Specify an ID to FORCE processing and ignore the state of the status/processed_date fields'
;
$params
[
'id'
][
'type'
]
=
CRM_Utils_TYPE
::
T_INT
;
}
info.xml
View file @
edd64cfc
...
...
@@ -14,7 +14,7 @@
<url
desc=
"Release Notes"
>
https://lab.civicrm.org/extensions/mjwshared/-/blob/master/docs/releasenotes.md
</url>
<url
desc=
"Licensing"
>
http://www.gnu.org/licenses/agpl-3.0.html
</url>
</urls>
<releaseDate>
2021-0
3-28
</releaseDate>
<releaseDate>
2021-0
4-05
</releaseDate>
<version>
1.0-dev
</version>
<develStage>
beta
</develStage>
<compatibility>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment