Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stripe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Extensions
Stripe
Commits
08e045d0
Commit
08e045d0
authored
4 years ago
by
Jamie McClelland
Committed by
mattwire
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ensure limit works when filtering out processed records.
parent
e0cf8fb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!152
6.6 to master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/v3/Stripe/Listevents.php
+15
-9
15 additions, 9 deletions
api/v3/Stripe/Listevents.php
with
15 additions
and
9 deletions
api/v3/Stripe/Listevents.php
+
15
−
9
View file @
08e045d0
...
...
@@ -265,12 +265,11 @@ function civicrm_api3_stripe_Listevents($params) {
// list.
$sql
=
'SELECT id, context FROM civicrm_system_log WHERE message = %0 AND
context LIKE %1 AND (context LIKE "%invoice.payment_failed%" OR context LIKE
"%invoice.payment_succeeded%") ORDER BY timestamp DESC
limit %2
'
;
"%invoice.payment_succeeded%") ORDER BY timestamp DESC'
;
$sql_params
=
[
0
=>
[
'payment_notification processor_id='
.
$params
[
'ppid'
],
'String'
],
1
=>
[
'%'
.
$subscription
.
'%'
,
'String'
],
2
=>
[
$limit
,
'Integer'
]
];
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
$sql_params
);
...
...
@@ -326,9 +325,8 @@ function civicrm_api3_stripe_Listevents($params) {
if
(
$created
)
{
$args
[
'created'
]
=
$created
;
}
if
(
$limit
)
{
$args
[
'limit'
]
=
$limit
;
}
// 100 is the max we can request.
$args
[
'limit'
]
=
100
;
if
(
$starting_after
)
{
$args
[
'starting_after'
]
=
$starting_after
;
}
...
...
@@ -337,11 +335,10 @@ function civicrm_api3_stripe_Listevents($params) {
// Query the system log.
else
{
$sql
=
'SELECT id, context FROM civicrm_system_log WHERE message = %0 AND context LIKE %1 ORDER BY timestamp DESC
limit %2
'
;
$sql
=
'SELECT id, context FROM civicrm_system_log WHERE message = %0 AND context LIKE %1 ORDER BY timestamp DESC'
;
$sql_params
=
[
0
=>
[
'payment_notification processor_id='
.
$params
[
'ppid'
],
'String'
],
1
=>
[
'%'
.
$type
.
'%'
,
'String'
],
2
=>
[
$limit
,
'Integer'
]
];
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
$sql_params
);
...
...
@@ -352,10 +349,18 @@ function civicrm_api3_stripe_Listevents($params) {
}
}
$out
=
$data_list
;
if
(
$params
[
'output'
]
==
'brief'
)
{
if
(
$params
[
'output'
]
!=
'brief'
)
{
$out
=
$data_list
;
// Only return the requested number of results.
$out
[
'data'
]
=
array_slice
(
$data_list
[
'data'
],
0
,
$limit
);
}
else
{
$out
=
[];
$count
=
0
;
foreach
(
$data_list
[
'data'
]
as
$data
)
{
if
(
$count
>
$limit
)
{
break
;
}
$item
=
[];
if
(
array_key_exists
(
'system_log_id'
,
$data
))
{
$item
[
'system_log_id'
]
=
$data
[
'system_log_id'
];
...
...
@@ -444,6 +449,7 @@ function civicrm_api3_stripe_Listevents($params) {
}
}
}
$count
++
;
$out
[]
=
$item
;
}
}
...
...
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