From 181c06ea6bfb652c60bb63f421ca2b8a1252a409 Mon Sep 17 00:00:00 2001 From: ethem Date: Tue, 31 Jan 2006 16:41:46 +0000 Subject: [PATCH] Show only one message for actions (Capture/Void/Credit) in test mode. --- enrol/authorize/index.php | 25 +++++++++++++++---------- lang/en/enrol_authorize.php | 6 ++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/enrol/authorize/index.php b/enrol/authorize/index.php index a0787f1c400..cbb46dc6170 100644 --- a/enrol/authorize/index.php +++ b/enrol/authorize/index.php @@ -5,9 +5,9 @@ require_once $CFG->dirroot.'/enrol/authorize/const.php'; require_once $CFG->dirroot.'/enrol/authorize/action.php'; define('ORDER_CAPTURE', 'capture'); -define('ORDER_DELETE', 'delete'); -define('ORDER_REFUND', 'refund'); -define('ORDER_VOID', 'void'); +define('ORDER_DELETE', 'delete'); +define('ORDER_REFUND', 'refund'); +define('ORDER_VOID', 'void'); if (!($site = get_site())) { error("Could not find a site!"); @@ -45,7 +45,7 @@ function authorize_orders() { global $CFG; global $strs, $authstrs; - require_once($CFG->libdir.'/tablelib.php'); + require_once $CFG->libdir.'/tablelib.php'; $perpage = 10; $userid = optional_param('user', 0, PARAM_INT); @@ -88,11 +88,16 @@ function authorize_orders() $where = "WHERE (E.status = '" . AN_STATUS_AUTHCAPTURE . "') "; } else { - $where = "WHERE (status = '$status') "; + $where = "WHERE (E.status = '$status') "; } } else { - $where = "WHERE (status != '" . AN_STATUS_NONE . "') "; + if (empty($CFG->an_test)) { + $where = "WHERE (E.status != '" . AN_STATUS_NONE . "') "; + } + else { + $where = "WHERE (1=1) "; + } } if ($userid > 0) { @@ -224,7 +229,7 @@ function authorize_order_details($orderno) { } else { $table->data[] = array(get_string('testmode', 'enrol_authorize'), - get_string('capturetestwarn', 'enrol_authorize')); + get_string('testwarning', 'enrol_authorize')); } } } @@ -274,7 +279,7 @@ function authorize_order_details($orderno) { } else { $table->data[] = array(get_string('testmode', 'enrol_authorize'), - get_string('credittestwarn', 'enrol_authorize')); + get_string('testwarning', 'enrol_authorize')); } } else { @@ -306,7 +311,7 @@ function authorize_order_details($orderno) { } else { $table->data[] = array(get_string('testmode', 'enrol_authorize'), - get_string('voidtestwarn', 'enrol_authorize')); + get_string('testwarning', 'enrol_authorize')); } } else { @@ -349,7 +354,7 @@ function authorize_order_details($orderno) { } else { $table->data[] = array(get_string('testmode', 'enrol_authorize'), - get_string('voidtestwarn', 'enrol_authorize')); + get_string('testwarning', 'enrol_authorize')); } } else { diff --git a/lang/en/enrol_authorize.php b/lang/en/enrol_authorize.php index dea01df5bad..1dab310ef04 100755 --- a/lang/en/enrol_authorize.php +++ b/lang/en/enrol_authorize.php @@ -68,7 +68,6 @@ $string['cancelled'] = 'Cancelled'; $string['capture'] = 'Capture'; $string['capturedpendingsettle'] = 'Captured / Pending Settlement'; $string['capturedsettled'] = 'Captured / Settled'; -$string['capturetestwarn'] = 'Capture seems working, but no record was updated in test mode'; $string['captureyes'] = 'The credit card will be captured and student will be enrolled to course. Are you sure?'; $string['ccexpire'] = 'Expiry Date'; $string['ccexpired'] = 'The credit card has expired'; @@ -79,14 +78,13 @@ $string['ccvv'] = 'Card Verification'; $string['ccvvhelp'] = 'Look at the back of card (last 3 digits)'; $string['choosemethod'] = 'If you know enrolment key of the course, enter it; otherwise you need to pay for this course.'; $string['chooseone'] = 'Fill one or both of the following two fields'; -$string['credittestwarn'] = 'Credit seems working, but no record was inserted to database in test mode'; $string['cutofftime'] = 'Transaction Cut-Off Time. When the last transaction is picked up for settlement?'; $string['delete'] = 'Destroy'; $string['description'] = 'The Authorize.net module allows you to set up paid courses by merchants. If the cost for any course is zero, then students are not asked to pay for entry. There is a site-wide cost that you set here as a default for the whole site and then a course setting that you can set for each course individually. The course cost overrides the site cost.

Note: If you enter an enrolment key in the course settings, then students will also have the option to enrol using a key. This is useful if you have a mixture of paying and non-paying students.'; $string['enrolname'] = 'Authorize.net Credit Card Gateway'; $string['expired'] = 'Expired'; $string['howmuch'] = 'How much?'; -$string['httpsrequired'] = 'We are sorry to inform you that your request cannot be processed currently. This site\'s configuration couldn\'t be set up correcly. +$string['httpsrequired'] = 'We are sorry to inform you that your request cannot be processed currently. This site\'s configuration couldn\'t be set up correctly.

Please don\'t enter your credit card number unless you see a yellow lock at the bottom of the browser. It means, it simply encrypts all data sent between client and server. So the information during the transaction between 2 computers is protected and your credit card number cannot captured over the internet.'; $string['logindesc'] = 'This option must be ON.

@@ -143,10 +141,10 @@ $string['settlementdate'] = 'Settlement Date'; $string['subvoidyes'] = 'Refunded transaction $a->transid will be cancelled and it will credit $a->amount to your account. Are you sure?'; $string['tested'] = 'Tested'; $string['testmode'] = '[TEST MODE]'; +$string['testwarning'] = 'Capture/Void/Credit seems working in test mode, but no record was updated or inserted in database.'; $string['transid'] = 'Transaction ID'; $string['unenrolstudent'] = 'Unenrol student?'; $string['void'] = 'Void'; -$string['voidtestwarn'] = 'Void seems working, but no record was updated in test mode'; $string['voidyes'] = 'Transaction will be cancelled. Are you sure?'; $string['zipcode'] = 'Zip Code';