Permalink
Browse files

Authorize.net plugin, some fixes.

  • Loading branch information...
ethem
ethem committed May 13, 2005
1 parent 5d319ac commit 425b7741772e9a9505db44837a4ef0f6bb9b8865
Showing with 376 additions and 415 deletions.
  1. +1 −1 enrol/authorize/ccval.php
  2. +118 −107 enrol/authorize/config.html
  3. +51 −44 enrol/authorize/enrol.html
  4. +206 −263 enrol/authorize/enrol.php
@@ -1,4 +1,4 @@
-<?php
+<?php // $Id$
/************************************************************************
*
* CCVal - Credit Card Validation function.
View
@@ -1,107 +1,118 @@
-<table cellspacing="0" cellpadding="5" border="0" align="center">
-
-<tr valign="top">
- <td align="right">enrol_cost:</td>
- <td>
- <input type="text" size="5" name="enrol_cost" value="<?php p($frm->enrol_cost) ?>" />
- </td>
- <td>
- <?php print_string("costdefault") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">enrol_currency:</td>
- <td>
- <?php choose_from_menu ($paypalcurrencies, "enrol_currency", $frm->enrol_currency, "","", "") ?>
- </td>
- <td>
- <?php print_string("currency") ?>
- </td>
-</tr>
-
-
-
-
-<tr valign="top">
- <td align="right">an_login:</td>
- <td>
- <input type="text" name="an_login" value="<?php echo $frm->an_login ?>" />
- </td>
- <td>
- <?php print_string("anlogin", "enrol_authorize") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">an_tran_key:</td>
- <td>
- <input type="text" name="an_tran_key" value="<?php echo $frm->an_tran_key ?>" />
- </td>
- <td>
- <?php print_string("antrankey", "enrol_authorize") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">an_password:</td>
- <td>
- <input type="text" name="an_password" value="<?php echo $frm->an_password ?>" />
- </td>
- <td>
- <?php print_string("anpassword", "enrol_authorize") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">an_test:</td>
- <td>
- <input type="checkbox" value=1 name="an_test" <?php if ($frm->an_test) echo "checked=\"true\"" ?> />
- </td>
- <td>
- <?php print_string("antestmode", "enrol_authorize") ?>
- </td>
-</tr>
-
-
-<tr valign="top">
- <td align="right">enrol_mailstudents:</td>
- <td>
- <input type="checkbox" value=1 name="enrol_mailstudents" <?php if ($frm->enrol_mailstudents) echo "checked=\"true\"" ?> />
- </td>
- <td>
- <?php print_string("mailstudents") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">enrol_mailteachers:</td>
- <td>
- <input type="checkbox" value=1 name="enrol_mailteachers" <?php if ($frm->enrol_mailteachers) echo "checked=\"true\"" ?> />
- </td>
- <td>
- <?php print_string("mailteachers") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">enrol_mailadmins:</td>
- <td>
- <input type="checkbox" value=1 name="enrol_mailadmins" <?php if ($frm->enrol_mailadmins) echo "checked=\"true\"" ?> />
- </td>
- <td>
- <?php print_string("mailadmins") ?>
- </td>
-</tr>
-
-<tr valign="top">
- <td align="right">enrol_allowinternal:</td>
- <td>
- <input type="checkbox" value="1" name="enrol_allowinternal" <?php if ($frm->enrol_allowinternal) echo "checked=\"true\"" ?> />
- </td>
- <td>
- <?php print_string('allowinternal') ?>
- </td>
-</tr>
-
-</table>
+<table cellspacing="0" cellpadding="5" border="0" align="center">
+
+<tr valign="top">
+ <td align="right">enrol_cost:</td>
+ <td>
+ <input type="text" size="5" name="enrol_cost" value="<?php p($frm->enrol_cost) ?>" />
+ </td>
+ <td>
+ <?php print_string("costdefault") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">enrol_currency:</td>
+ <td>
+ <?php choose_from_menu ($ancurrencies, "enrol_currency", $frm->enrol_currency, "","", "") ?>
+ </td>
+ <td>
+ <?php print_string("currency") ?>
+ </td>
+</tr>
+
+
+
+
+<tr valign="top">
+ <td align="right">an_login:</td>
+ <td>
+ <input type="text" name="an_login" value="<?php echo $frm->an_login ?>" />
+ </td>
+ <td>
+ <?php print_string("anlogin", "enrol_authorize") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">an_tran_key:</td>
+ <td>
+ <input type="text" name="an_tran_key" value="<?php echo $frm->an_tran_key ?>" />
+ </td>
+ <td>
+ <?php print_string("antrankey", "enrol_authorize") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">an_password:</td>
+ <td>
+ <input type="text" name="an_password" value="<?php echo $frm->an_password ?>" />
+ </td>
+ <td>
+ <?php print_string("anpassword", "enrol_authorize") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">an_referer:</td>
+ <td>
+ <input type="text" name="an_referer" value="<?php echo $frm->an_referer ?>" />
+ </td>
+ <td>
+ <?php print_string("anreferer", "enrol_authorize") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">an_test:</td>
+ <td>
+ <input type="checkbox" value=1 name="an_test" <?php if ($frm->an_test) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("antestmode", "enrol_authorize") ?>
+ </td>
+</tr>
+
+<tr valign="top"><td colspan="3"><hr noshade size="1"></td></tr>
+
+<tr valign="top">
+ <td align="right">enrol_mailstudents:</td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailstudents" <?php if ($frm->enrol_mailstudents) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailstudents") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">enrol_mailteachers:</td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailteachers" <?php if ($frm->enrol_mailteachers) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailteachers") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">enrol_mailadmins:</td>
+ <td>
+ <input type="checkbox" value=1 name="enrol_mailadmins" <?php if ($frm->enrol_mailadmins) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string("mailadmins") ?>
+ </td>
+</tr>
+
+<tr valign="top">
+ <td align="right">enrol_allowinternal:</td>
+ <td>
+ <input type="checkbox" value="1" name="enrol_allowinternal" <?php if ($frm->enrol_allowinternal) echo "checked=\"true\"" ?> />
+ </td>
+ <td>
+ <?php print_string('allowinternal') ?>
+ </td>
+</tr>
+
+</table>
View
@@ -1,44 +1,51 @@
-<p align="center"><?php if (! empty($this->errormsg)) {formerr($this->errormsg);} ?></p>
-
-<div align="center">
-
-<p><?php print_string("paymentrequired") ?></p>
-<p><b><?php echo get_string("cost").": $CFG->enrol_currency $cost"; ?></b></p>
-<p><?php print_string("paymentinstant") ?></p>
-
-<form name="form" method="post" action="enrol.php" autocomplete="off">
-<input type="hidden" name="id" value="<?php p($course->id) ?>" />
-<table align="center" width="100%" border=0>
-<tr>
- <td align="right"><?php print_string("nameoncard", "enrol_authorize") ?>: </td>
- <td align="left"><input type="text" name="ccfirstname" size="16" value="<?php p($userfirstname) ?>" />
- <input type="text" name="cclastname" size="16" value="<?php p($userlastname) ?>" /></td>
-</tr>
-<tr>
- <td align="right"><?php print_string("ccno", "enrol_authorize") ?>: </td>
- <td align="left"><input type="text" name="cc" size="16" value="<?php p($form->cc) ?>" /></td>
-</tr>
-<tr>
- <td align="right"><?php print_string("ccexpire", "enrol_authorize") ?>: </td>
- <td align="left"><?php
- for ($i=1; $i<=12; $i++) {
- $months[$i] = userdate(gmmktime(12,0,0,$i,1,2000), "%B");
- }
- choose_from_menu($months, 'ccexpiremm', $form->ccexpiremm, '');
- ?> <input type="text" name="ccexpireyyyy" size="4" maxlength="4" value="<?php p($form->ccexpireyyyy) ?>" /></td>
-</tr>
-<tr>
- <td align="right"><?php print_string("ccvv", "enrol_authorize") ?>: </td>
- <td align="left"><input type="text" name="cvv" size="4" maxlength="4" value="<?php p($form->cvv) ?>" />
- <font size=1><?php print_string("ccvvhelp", "enrol_authorize") ?></font></td>
-</tr>
-<tr>
- <td align="right"><?php print_string("zipcode", "enrol_authorize") ?>: </td>
- <td align="left"><input type="text" name="cczip" size="5" value="<?php p($form->cczip) ?>" /></td>
-</tr>
-
-</table>
-<input type="submit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
-</form>
-
-</div>
+<p align="center"><?php if (! empty($this->errormsg)) {formerr($this->errormsg);} ?></p>
+
+<div align="center">
+
+<p><?php print_string("paymentrequired") ?></p>
+<p><b><?php echo get_string("cost").": $CFG->enrol_currency $cost"; ?></b></p>
+<p><?php print_string("paymentinstant") ?></p>
+
+<form name="form" method="post" action="enrol.php" autocomplete="off">
+<input type="hidden" name="id" value="<?php p($course->id) ?>" />
+<table align="center" width="100%" border=0>
+<tr>
+ <td align="right"><?php print_string("nameoncard", "enrol_authorize") ?>: </td>
+ <td align="left"><input type="text" name="ccfirstname" size="16" value="<?php p($userfirstname) ?>" />
+ <input type="text" name="cclastname" size="16" value="<?php p($userlastname) ?>" /></td>
+</tr>
+<tr>
+ <td align="right"><?php print_string("ccno", "enrol_authorize") ?>: </td>
+ <td align="left"><input type="text" name="cc" size="16" value="<?php p($form->cc) ?>" /></td>
+</tr>
+<tr>
+ <td align="right"><?php print_string("ccexpire", "enrol_authorize") ?>: </td>
+ <td align="left"><?php
+ for ($i=1; $i<=12; $i++) {
+ $months[$i] = userdate(gmmktime(12,0,0,$i,1,2000), "%B");
+ }
+ choose_from_menu($months, 'ccexpiremm', $form->ccexpiremm, '');
+ ?> <input type="text" name="ccexpireyyyy" size="4" maxlength="4" value="<?php p($form->ccexpireyyyy) ?>" /></td>
+</tr>
+<tr>
+ <td align="right"><?php print_string("cctype", "enrol_authorize") ?>: </td>
+ <td align="left"><?php
+ choose_from_menu($CCTYPES, 'cctype', $form->cctype);
+ ?>
+</td>
+</tr>
+<tr>
+ <td align="right"><?php print_string("ccvv", "enrol_authorize") ?>: </td>
+ <td align="left"><input type="text" name="cvv" size="4" maxlength="4" value="<?php p($form->cvv) ?>" />
+ <font size=1><?php print_string("ccvvhelp", "enrol_authorize") ?></font></td>
+</tr>
+<tr>
+ <td align="right"><?php print_string("zipcode", "enrol_authorize") ?>: </td>
+ <td align="left"><input type="text" name="cczip" size="5" value="<?php p($form->cczip) ?>" /></td>
+</tr>
+
+</table>
+<input type="submit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
+</form>
+
+</div>
Oops, something went wrong.

0 comments on commit 425b774

Please sign in to comment.