From 7d1a133f207a54f9a996e860edd74b16e936c27c Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 29 Nov 2007 02:55:11 +0000 Subject: even more reliable multiple-payment/double-click/concurrent-payment-form protection --- httemplate/misc/payment.cgi | 5 +++-- httemplate/misc/process/payment.cgi | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'httemplate') diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index 2c889d73b..ce9a48beb 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -1,9 +1,10 @@ <% include( '/elements/header.html', "Process $type{$payby} payment" ) %> <% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %>
- - + + + diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 71a4891cf..889670d12 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -56,6 +56,10 @@ $cgi->param('payunique') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ or errorpage(gettext('illegal_text'). " payunique: ". $cgi->param('payunique')); my $payunique = $1; +$cgi->param('balance') =~ /^\s*(\-?\s*\d*(\.\d\d)?)\s*$/ + or errorpage("illegal balance"); +my $balance = $1; + my $payinfo; my $paycvv = ''; if ( $payby eq 'CHEK' ) { @@ -125,6 +129,7 @@ if ( $cgi->param('batch') ) { $error = $cust_main->realtime_bop( $FS::payby::payby2bop{$payby}, $amount, 'quiet' => 1, 'manual' => 1, + 'balance' => $balance, 'payinfo' => $payinfo, 'paydate' => "$year-$month-01", 'payname' => $payname, -- cgit v1.2.1