Business checks can be refunded. Point a flag for it. The cclastfour field will be renamed to refundinfo later.
This commit is contained in:
@@ -33,7 +33,7 @@ function print_cc_form($classreference)
|
||||
|
||||
$formvars = array(
|
||||
'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip',
|
||||
'ccfirstname', 'cclastname', 'cc', 'ccexpiremm', 'ccexpireyyyy', 'cctype', 'cvv'
|
||||
'firstname', 'lastname', 'cc', 'ccexpiremm', 'ccexpireyyyy', 'cctype', 'cvv'
|
||||
);
|
||||
foreach ($formvars as $var) {
|
||||
if (!isset($form->$var)) {
|
||||
@@ -42,8 +42,8 @@ function print_cc_form($classreference)
|
||||
}
|
||||
|
||||
$curcost = get_course_cost($course);
|
||||
$userfirstname = empty($form->ccfirstname) ? $USER->firstname : $form->ccfirstname;
|
||||
$userlastname = empty($form->cclastname) ? $USER->lastname : $form->cclastname;
|
||||
$userfirstname = empty($form->firstname) ? $USER->firstname : $form->firstname;
|
||||
$userlastname = empty($form->lastname) ? $USER->lastname : $form->lastname;
|
||||
$useraddress = empty($form->ccaddress) ? $USER->address : $form->ccaddress;
|
||||
$usercity = empty($form->cccity) ? $USER->city : $form->cccity;
|
||||
$usercountry = empty($form->cccountry) ? $USER->country : $form->cccountry;
|
||||
@@ -68,8 +68,8 @@ function print_cc_form($classreference)
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><?php print_string("nameoncard", "enrol_authorize") ?>: </td>
|
||||
<td align="left"><input type="text" name="ccfirstname" size="8" value="<?php p($userfirstname) ?>" />
|
||||
<input type="text" name="cclastname" size="8" value="<?php p($userlastname) ?>" />
|
||||
<td align="left"><input type="text" name="firstname" size="8" value="<?php p($userfirstname) ?>" />
|
||||
<input type="text" name="lastname" size="8" value="<?php p($userlastname) ?>" />
|
||||
<?php if (!empty($classreference->authorizeerrors['ccfirstlast'])) { formerr($classreference->authorizeerrors['ccfirstlast']); } ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -144,7 +144,7 @@ class enrolment_plugin_authorize
|
||||
$order = new stdClass();
|
||||
$order->paymentmethod = AN_METHOD_CC;
|
||||
$order->cclastfour = substr($form->cc, -4);
|
||||
$order->ccname = $form->ccfirstname . " " . $form->cclastname;
|
||||
$order->ccname = $form->firstname . " " . $form->lastname;
|
||||
$order->courseid = $course->id;
|
||||
$order->userid = $USER->id;
|
||||
$order->status = AN_STATUS_NONE; // it will be changed...
|
||||
@@ -166,8 +166,8 @@ class enrolment_plugin_authorize
|
||||
$extra->x_exp_date = $exp_date;
|
||||
$extra->x_currency_code = $curcost['currency'];
|
||||
$extra->x_amount = $curcost['cost'];
|
||||
$extra->x_first_name = $form->ccfirstname;
|
||||
$extra->x_last_name = $form->cclastname;
|
||||
$extra->x_first_name = $form->firstname;
|
||||
$extra->x_last_name = $form->lastname;
|
||||
$extra->x_country = $form->cccountry;
|
||||
$extra->x_address = $form->ccaddress;
|
||||
$extra->x_state = $form->ccstate;
|
||||
@@ -290,12 +290,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;
|
||||
@@ -316,7 +317,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'];
|
||||
|
||||
@@ -232,7 +232,7 @@ function validate_cc_form($form, &$err)
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($form->ccfirstname) || empty($form->cclastname)) {
|
||||
if (empty($form->firstname) || empty($form->lastname)) {
|
||||
$err['ccfirstlast'] = get_string('missingfullname');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user