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
95c4e89e
Commit
95c4e89e
authored
9 years ago
by
Pradeep Nayak
Browse files
Options
Downloads
Patches
Plain Diff
--CRM-16188, added changes suggested by Eileen
parent
5f44f698
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/v3/Order.php
+3
-3
3 additions, 3 deletions
api/v3/Order.php
tests/phpunit/api/v3/OrderTest.php
+1
-1
1 addition, 1 deletion
tests/phpunit/api/v3/OrderTest.php
with
4 additions
and
4 deletions
api/v3/Order.php
+
3
−
3
View file @
95c4e89e
...
...
@@ -137,15 +137,15 @@ function civicrm_api3_order_create(&$params) {
function
civicrm_api3_order_delete
(
$params
)
{
$contribution
=
civicrm_api3
(
'Contribution'
,
'get'
,
array
(
'return'
=>
array
(
'is_test'
),
'id'
=>
CRM_Utils_Array
::
value
(
'contribution_id'
,
$params
,
$params
[
'id'
]
)
,
'id'
=>
$params
[
'id'
],
));
if
(
$contribution
[
'id'
]
&&
$contribution
[
'values'
][
$contribution
[
'id'
]][
'is_test'
]
==
TRUE
)
{
$result
=
civicrm_api3
(
'Contribution'
,
'delete'
,
$params
);
}
else
{
throw
new
API_Exception
(
'
Could not
delete
Order
.'
);
throw
new
API_Exception
(
'
Only test orders can be
delete
d
.'
);
}
return
civicrm_api3_create_success
(
CRM_Utils_Array
::
value
(
'values'
,
$result
)
,
$params
,
'Order'
,
'delete'
);
return
civicrm_api3_create_success
(
$result
[
'values'
]
,
$params
,
'Order'
,
'delete'
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/api/v3/OrderTest.php
+
1
−
1
View file @
95c4e89e
...
...
@@ -446,7 +446,7 @@ class api_v3_OrderTest extends CiviUnitTestCase {
$this
->
fail
(
"Missed expected exception"
);
}
catch
(
Exception
$expected
)
{
$this
->
callAPISuccess
(
'
c
ontribution'
,
'create'
,
array
(
$this
->
callAPISuccess
(
'
C
ontribution'
,
'create'
,
array
(
'contribution_id'
=>
$order
[
'id'
],
'is_test'
=>
TRUE
,
));
...
...
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