Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
civicrm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
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
plugins
civicrm
Commits
e5f744c8
Verified
Commit
e5f744c8
authored
6 years ago
by
Monish Deb
Committed by
Kevin Cristiano
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dev/financial#39: Drop checkMD5 support from Authorize.net
Signed-off-by:
Kevin Cristiano
<
kcristiano@kcristiano.com
>
parent
e95babfb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
civicrm/CRM/Core/Payment/AuthorizeNet.php
+0
-39
0 additions, 39 deletions
civicrm/CRM/Core/Payment/AuthorizeNet.php
civicrm/CRM/Core/Payment/AuthorizeNetIPN.php
+0
-23
0 additions, 23 deletions
civicrm/CRM/Core/Payment/AuthorizeNetIPN.php
with
0 additions
and
62 deletions
civicrm/CRM/Core/Payment/AuthorizeNet.php
+
0
−
39
View file @
e5f744c8
...
...
@@ -171,12 +171,6 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
// fetch available contribution statuses
$contributionStatus
=
CRM_Contribute_PseudoConstant
::
contributionStatus
(
NULL
,
'name'
);
// check gateway MD5 response
if
(
!
$this
->
checkMD5
(
$response_fields
[
37
],
$response_fields
[
6
],
$response_fields
[
9
]))
{
$params
[
'payment_status_id'
]
=
array_search
(
'Failed'
,
$contributionStatus
);
return
self
::
error
(
9003
,
'MD5 Verification failed'
);
}
// check for application errors
// TODO:
// AVS, CVV2, CAVV, and other verification results
...
...
@@ -437,39 +431,6 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
}
}
/**
* Check the gateway MD5 response to make sure that this is a proper
* gateway response
*
* @param string $responseMD5
* MD5 hash generated by the gateway.
* @param string $transaction_id
* Transaction id generated by the gateway.
* @param string $amount
* Purchase amount.
*
* @param bool $ipn
*
* @return bool
*/
public
function
checkMD5
(
$responseMD5
,
$transaction_id
,
$amount
,
$ipn
=
FALSE
)
{
// cannot check if no MD5 hash
$md5Hash
=
$this
->
_getParam
(
'md5Hash'
);
if
(
empty
(
$md5Hash
))
{
return
TRUE
;
}
$loginid
=
$this
->
_getParam
(
'apiLogin'
);
$hashString
=
$ipn
?
(
$md5Hash
.
$transaction_id
.
$amount
)
:
(
$md5Hash
.
$loginid
.
$transaction_id
.
$amount
);
$result
=
strtoupper
(
md5
(
$hashString
));
if
(
$result
==
$responseMD5
)
{
return
TRUE
;
}
else
{
return
FALSE
;
}
}
/**
* Calculate and return the transaction fingerprint.
*
...
...
This diff is collapsed.
Click to expand it.
civicrm/CRM/Core/Payment/AuthorizeNetIPN.php
+
0
−
23
View file @
e5f744c8
...
...
@@ -164,8 +164,6 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN {
$objects
[
'contribution'
]
->
total_amount
=
$input
[
'amount'
];
$objects
[
'contribution'
]
->
trxn_id
=
$input
[
'trxn_id'
];
$this
->
checkMD5
(
$paymentProcessorObject
,
$input
);
$isFirstOrLastRecurringPayment
=
FALSE
;
if
(
$input
[
'response_code'
]
==
1
)
{
// Approved
...
...
@@ -359,25 +357,4 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
return
$value
;
}
/**
* Check and validate gateway MD5 response if present.
*
* @param CRM_Core_Payment_AuthorizeNet $paymentObject
* @param array $input
*
* @throws CRM_Core_Exception
*/
public
function
checkMD5
(
$paymentObject
,
$input
)
{
if
(
empty
(
$input
[
'trxn_id'
]))
{
// For decline we have nothing to check against.
return
;
}
if
(
!
$paymentObject
->
checkMD5
(
$input
[
'MD5_Hash'
],
$input
[
'trxn_id'
],
$input
[
'amount'
],
TRUE
))
{
$message
=
"Failure: Security verification failed"
;
$log
=
new
CRM_Utils_SystemLogger
();
$log
->
error
(
'payment_notification'
,
array
(
'message'
=>
$message
,
'input'
=>
$input
));
throw
new
CRM_Core_Exception
(
$message
);
}
}
}
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