From 360f89789c45e1fd7cb84b1442d2f0c8353066d9 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Tue, 12 Jun 2018 09:51:58 -0400 Subject: RT# 74435 - fixed errors in posting a echeck refund when no account is listed. --- httemplate/misc/process/payment.cgi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'httemplate/misc/process/payment.cgi') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 717d57c85..5620b5b4b 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -90,6 +90,7 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { $paycvv = $cust_payby->paycvv; # pass it if we got it, running a transaction will clear it ( $month, $year ) = $cust_payby->paydate_mon_year; $payname = $cust_payby->payname; + $cgi->param(-name=>"paytype", -value=>$cust_payby->paytype) unless $cgi->param("paytype"); } else { @@ -208,6 +209,10 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { my $error = ''; my $paynum = ''; +my $paydate; +if ($cust_payby->paydate) { $paydate = "$year-$month-01"; } +else { $paydate = "2037-12-01"; } + if ( $cgi->param('batch') ) { $error = 'Prepayment discounts not supported with batched payments' @@ -217,7 +222,7 @@ if ( $cgi->param('batch') ) { 'payby' => $payby, 'amount' => $amount, 'payinfo' => $payinfo, - 'paydate' => "$year-$month-01", + 'paydate' => $paydate, 'payname' => $payname, map { $_ => scalar($cgi->param($_)) } @{$payby2fields{$payby}} -- cgit v1.2.1 From a3c654c1ae9ea07726aba9899a9b2e1d4dbd12c6 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Wed, 8 Aug 2018 19:35:34 -0400 Subject: RT# 34134 - updated select invoice to actually pay the invoice being selected not the oldest one. --- httemplate/misc/process/payment.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'httemplate/misc/process/payment.cgi') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 5620b5b4b..939fc38c2 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -39,6 +39,8 @@ my $cust_main = qsearchs({ 'extra_sql' => ' AND '. $curuser->agentnums_sql, }) or die "unknown custnum $custnum"; +my $invoice = ($cgi->param('invoice') =~ /^(\d+)$/) ? $cgi->param('invoice') : ''; + $cgi->param('amount') =~ /^\s*(\d*(\.\d\d)?)\s*$/ or errorpage("illegal amount ". $cgi->param('amount')); my $amount = $1; @@ -224,6 +226,7 @@ if ( $cgi->param('batch') ) { 'payinfo' => $payinfo, 'paydate' => $paydate, 'payname' => $payname, + 'invnum' => $invoice, map { $_ => scalar($cgi->param($_)) } @{$payby2fields{$payby}} ); @@ -246,6 +249,7 @@ if ( $cgi->param('batch') ) { 'discount_term' => $discount_term, 'no_auto_apply' => ($cgi->param('apply') eq 'never') ? 'Y' : '', 'no_invnum' => 1, + 'invnum' => $invoice, map { $_ => scalar($cgi->param($_)) } @{$payby2fields{$payby}} ); errorpage($error) if $error; -- cgit v1.2.1 From cee66872f5c67825cae5a0f86da3fb0657c4ebae Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Fri, 24 Aug 2018 22:31:14 -0400 Subject: RT# 81183 Fix crash processing payment with new payment method --- httemplate/misc/process/payment.cgi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'httemplate/misc/process/payment.cgi') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 939fc38c2..d0e589661 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -211,15 +211,21 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { my $error = ''; my $paynum = ''; -my $paydate; -if ($cust_payby->paydate) { $paydate = "$year-$month-01"; } -else { $paydate = "2037-12-01"; } if ( $cgi->param('batch') ) { $error = 'Prepayment discounts not supported with batched payments' if $discount_term; + # Invalid payment expire dates are replaced with 2037-12-01 (why?) + my $paydate = "${year}-${month}-01"; + { + use DateTime; + local $@; + eval { DateTime->new({ year => $year, month => $month, day => 1 }) }; + $paydate = '2037-12-01' if $@; + } + $error ||= $cust_main->batch_card( 'payby' => $payby, 'amount' => $amount, -- cgit v1.2.1 From 7a177f82917a57bc1a0a8ef4a4608aca24773624 Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Sun, 26 Aug 2018 17:07:46 -0400 Subject: RT# 80869 Harden process payment screen against Edge browser bug --- httemplate/misc/process/payment.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/misc/process/payment.cgi') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index d0e589661..7747bcbea 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -100,11 +100,11 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) { # use new info ## - $cgi->param('year') =~ /^(\d+)$/ + $cgi->param('year') =~ /^(\d{4})/ or errorpage("illegal year ". $cgi->param('year')); $year = $1; - $cgi->param('month') =~ /^(\d+)$/ + $cgi->param('month') =~ /^(\d{2})/ or errorpage("illegal month ". $cgi->param('month')); $month = $1; -- cgit v1.2.1