diff options
author | ivan <ivan> | 2003-05-19 13:38:41 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-05-19 13:38:41 +0000 |
commit | a1295d0682aa81a408abe06fcaa7c14440f6a2e2 (patch) | |
tree | 0ede9fe45caf553f5258ba36bd4535acad8db5f4 /fs_selfservice | |
parent | fd9138f66cf7f3ab9557e0beebb4e2657a59e34c (diff) |
first crack at payment processing with self-service (step two of the process)
Diffstat (limited to 'fs_selfservice')
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/make_payment.html | 4 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/process_payment.html | 18 | ||||
-rw-r--r-- | fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 4 |
3 files changed, 23 insertions, 3 deletions
diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html index 6adc0bde0..fdb411b11 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html @@ -31,7 +31,7 @@ <SELECT NAME="card_type"><OPTION></OPTION> <%= foreach ( keys %card_types ) { $selected = $card_type eq $card_types{$_} ? ' SELECTED' : ''; - $OUT .= qq(<OPTION$selected VALUE="). $card_types->{$_}. qq(">$_\n); + $OUT .= qq(<OPTION$selected VALUE="). $card_types{$_}. qq(">$_\n); } %> </SELECT> </TD> @@ -104,7 +104,7 @@ </TD> </TR><TR> <TD COLSPAN=2> - <INPUT TYPE="checkbox"<%= $payby eq 'CARD' ? ' CHECKED' : '' %> NAME="auto" VALUE="1"> + <INPUT TYPE="checkbox"<%= $payby eq 'CARD' ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> Charge future payments to this card automatically </TD> </TR> diff --git a/fs_selfservice/FS-SelfService/cgi/process_payment.html b/fs_selfservice/FS-SelfService/cgi/process_payment.html new file mode 100644 index 000000000..e4946dc8f --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/process_payment.html @@ -0,0 +1,18 @@ +<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD> +<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR> +<%= $url = "$selfurl?session=$session_id;action="; ''; %> +<TABLE BORDER=0 CELLPADDING=4><TR><TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd"> +<A HREF="<%= $url %>myaccount">MyAccount</A><BR> +<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> --> +</TD><TD VALIGN="top"> +<FONT SIZE=4>Payment results</FONT><BR><BR> +<%= if ( $error ) { + $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your payment: $error</FONT!; +} else { + $OUT .= 'Your payment was processed sucessfully. Thank you.'; +} %> +</TD></TR></TABLE> +<HR> +<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT> +</BODY></HTML> + diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index 2ce2c8b6c..d43df4041 100644 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -96,6 +96,8 @@ sub make_payment { sub process_payment { + use Business::CreditCard; + $cgi->param('amount') =~ /^\s*(\d+(\.\d{2})?)\s*$/ or die "illegal amount"; #!!! my $amount = $1; @@ -143,7 +145,7 @@ sub process_payment { $auto = 1 if $cgi->param('auto'); $cgi->param('paybatch') =~ /^([\w\-\.]+)$/ or die "illegal paybatch"; - my $patbatch = $1; + my $paybatch = $1; process_payment( 'session_id' => $session_id, |