Skip to content
Browse files

x_auth_code is required for capture only transactions!

NOTE: Capture only transactions have not implemented yet!
  • Loading branch information...
1 parent 57ea9c8 commit 769b3187c2b9ae30de03d3211d22e84e9dad6776 ethem committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 enrol/authorize/authorizenetlib.php
View
7 enrol/authorize/authorizenetlib.php
@@ -137,10 +137,15 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE)
$message = "Order status must be AN_STATUS_NONE(0)!";
return false;
}
- if (empty($extra)) {
+ elseif (empty($extra)) {
$message = "Need extra fields!";
return false;
}
+ elseif (($action == AN_ACTION_CAPTURE_ONLY) and empty($extra->x_auth_code)) {
+ $message = "x_auth_code is required for capture only transactions!";
+ return false;
+ }
+
$ext = (array)$extra;
$poststring .= '&x_type=' . (($action==AN_ACTION_AUTH_ONLY)
? 'AUTH_ONLY' :( ($action==AN_ACTION_CAPTURE_ONLY)

0 comments on commit 769b318

Please sign in to comment.
Something went wrong with that request. Please try again.