Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
justinfreeman (Agileware)
Core
Commits
8196c759
Commit
8196c759
authored
11 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
add some comments to the code
parent
59fe57f7
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/Core/Payment/BaseIPN.php
+46
-1
46 additions, 1 deletion
CRM/Core/Payment/BaseIPN.php
with
46 additions
and
1 deletion
CRM/Core/Payment/BaseIPN.php
+
46
−
1
View file @
8196c759
...
...
@@ -35,10 +35,29 @@
class
CRM_Core_Payment_BaseIPN
{
static
$_now
=
NULL
;
/**
* Constructor
*/
function
__construct
()
{
self
::
$_now
=
date
(
'YmdHis'
);
}
/**
* Validate incoming data. This function is intended to ensure that incoming data matches
* It provides a form of pseudo-authentication - by checking the calling fn already knows
* the correct contact id & contribution id (this can be problematic when that has changed in
* the meantime for transactions that are delayed & contacts are merged in-between. e.g
* Paypal allows you to resend Instant Payment Notifications if you, for example, moved site
* and didn't update your IPN URL.
*
* @param array $input interpreted values from the values returned through the IPN
* @param array $ids more interpreted values (ids) from the values returned through the IPN
* @param array $objects an empty array that will be populated with loaded object
* @param boolean $required boolean Return FALSE if the relevant objects don't exist
* @param integer $paymentProcessorID Id of the payment processor ID in use
* @return boolean
*/
function
validateData
(
&
$input
,
&
$ids
,
&
$objects
,
$required
=
TRUE
,
$paymentProcessorID
=
NULL
)
{
// make sure contact exists and is valid
...
...
@@ -92,10 +111,16 @@ class CRM_Core_Payment_BaseIPN {
return
TRUE
;
}
/*
/*
*
* Load objects related to contribution
*
* @input array information from Payment processor
* @param array $ids
* @param array $objects
* @param boolean $required
* @param integer $paymentProcessorID
* @param array $error_handling
* @return multitype:number NULL |boolean
*/
function
loadObjects
(
&
$input
,
&
$ids
,
&
$objects
,
$required
,
$paymentProcessorID
,
$error_handling
=
NULL
)
{
if
(
empty
(
$error_handling
))
{
...
...
@@ -139,6 +164,13 @@ class CRM_Core_Payment_BaseIPN {
return
$success
;
}
/**
* Set contribution to failed
* @param array $objects
* @param object $transaction
* @param array $input
* @return boolean
*/
function
failed
(
&
$objects
,
&
$transaction
,
$input
=
array
())
{
$contribution
=
&
$objects
[
'contribution'
];
$memberships
=
array
();
...
...
@@ -195,6 +227,12 @@ class CRM_Core_Payment_BaseIPN {
return
TRUE
;
}
/**
* Handled pending contribution status
* @param array $objects
* @param object $transaction
* @return boolean
*/
function
pending
(
&
$objects
,
&
$transaction
)
{
$transaction
->
commit
();
CRM_Core_Error
::
debug_log_message
(
"returning since contribution status is pending"
);
...
...
@@ -589,6 +627,13 @@ LIMIT 1;";
return
$contribution
->
composeMessageArray
(
$input
,
$ids
,
$values
,
$recur
,
$returnMessageText
);
}
/**
* Update contribution status - this is only called from one place in the code &
* it is unclear whether it is a function on the way in or on the way out
*
* @param unknown_type $params
* @return void|Ambigous <value, unknown, array>
*/
function
updateContributionStatus
(
&
$params
)
{
// get minimum required values.
$statusId
=
CRM_Utils_Array
::
value
(
'contribution_status_id'
,
$params
);
...
...
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