From 4902ed7c2f3bfd01108bbc3c7656e1b83b655bdb Mon Sep 17 00:00:00 2001 From: ethem Date: Fri, 17 Nov 2006 16:06:46 +0000 Subject: [PATCH] Changed db column(cclastfour) as refundinfo. Because this field will be used to refund both cc and echeck. Business checkings can be refunded, too; so mark as 1 this field for business checkings. That is; refundinfo: is last four digit for credit cards, business checking for echecks. Merged from MOODLE_17_STABLE. --- enrol/authorize/authorizenetlib.php | 2 +- enrol/authorize/db/install.xml | 11 +++++---- enrol/authorize/db/upgrade.php | 35 +++++++---------------------- enrol/authorize/enrol.php | 4 ++-- enrol/authorize/version.php | 2 +- 5 files changed, 19 insertions(+), 35 deletions(-) diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php index 69ce91d8307..5b4f268b3cc 100644 --- a/enrol/authorize/authorizenetlib.php +++ b/enrol/authorize/authorizenetlib.php @@ -222,7 +222,7 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ $poststring .= '&x_invoice_num=' . urlencode($extra->orderid); $poststring .= '&x_amount=' . urlencode($extra->amount); if ($method == AN_METHOD_CC) { - $poststring .= '&x_card_num=' . sprintf("%04d", intval($order->cclastfour)); + $poststring .= '&x_card_num=' . sprintf("%04d", intval($order->refundinfo)); } break; } diff --git a/enrol/authorize/db/install.xml b/enrol/authorize/db/install.xml index 72705335adc..646e6479cd7 100644 --- a/enrol/authorize/db/install.xml +++ b/enrol/authorize/db/install.xml @@ -1,12 +1,15 @@ - + - - - + + + diff --git a/enrol/authorize/db/upgrade.php b/enrol/authorize/db/upgrade.php index 0a17545736c..021f2fee140 100644 --- a/enrol/authorize/db/upgrade.php +++ b/enrol/authorize/db/upgrade.php @@ -1,38 +1,19 @@ setAttributes(XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'paymentmethod'); + $status = $status && rename_field($table, $field, 'refundinfo'); + } -/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php -/// $result = result of "/lib/ddllib.php" function calls -/// } - - return $result; + return $status; } ?> diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 6bf277ce8f5..44474e97109 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -148,7 +148,7 @@ class enrolment_plugin_authorize $timenow = time(); $order = new stdClass(); $order->paymentmethod = AN_METHOD_CC; - $order->cclastfour = substr($form->cc, -4); + $order->refundinfo = substr($form->cc, -4); $order->ccname = $form->firstname . " " . $form->lastname; $order->courseid = $course->id; $order->userid = $USER->id; @@ -309,7 +309,7 @@ class enrolment_plugin_authorize $timenow = time(); $order = new stdClass(); $order->paymentmethod = AN_METHOD_ECHECK; - $order->cclastfour = $isbusinesschecking ? 1 : 0; + $order->refundinfo = $isbusinesschecking ? 1 : 0; $order->ccname = $form->firstname . ' ' . $form->lastname; $order->courseid = $course->id; $order->userid = $USER->id; diff --git a/enrol/authorize/version.php b/enrol/authorize/version.php index d5f970544b2..256deede8c1 100755 --- a/enrol/authorize/version.php +++ b/enrol/authorize/version.php @@ -1,6 +1,6 @@ version = 2006101700; +$plugin->version = 2006101701; $plugin->requires = 2006100401; ?>