]> git.mjollnir.org Git - moodle.git/commitdiff
Business checks can be refunded. Point a flag for it. The cclastfour field will be...
authorethem <ethem>
Fri, 17 Nov 2006 08:21:11 +0000 (08:21 +0000)
committerethem <ethem>
Fri, 17 Nov 2006 08:21:11 +0000 (08:21 +0000)
enrol/authorize/enrol.php

index c94b6b153d143418a714e71b8b443c00fde45073..03c71e132cd4d9e7d60b90575f468e1df49f93ef 100755 (executable)
@@ -312,12 +312,13 @@ class enrolment_plugin_authorize
 
         $useripno = getremoteaddr();
         $curcost = get_course_cost($course);
+        $isbusinesschecking = ($form->acctype == 'BUSINESSCHECKING');
 
         // NEW ECHECK ORDER
         $timenow = time();
         $order = new stdClass();
         $order->paymentmethod = AN_METHOD_ECHECK;
-        $order->cclastfour = 0;
+        $order->cclastfour = $isbusinesschecking ? 1 : 0;
         $order->ccname = $form->firstname . ' ' . $form->lastname;
         $order->courseid = $course->id;
         $order->userid = $USER->id;
@@ -338,7 +339,7 @@ class enrolment_plugin_authorize
         $extra->x_bank_aba_code = $form->abacode;
         $extra->x_bank_acct_num = $form->accnum;
         $extra->x_bank_acct_type = $form->acctype;
-        $extra->x_echeck_type = ($form->acctype == 'BUSINESSCHECKING') ? 'CCD' : 'WEB';
+        $extra->x_echeck_type = $isbusinesschecking ? 'CCD' : 'WEB';
         $extra->x_bank_name = $form->bankname;
         $extra->x_currency_code = $curcost['currency'];
         $extra->x_amount = $curcost['cost'];