From 26119738eaf2b519d91c855c23986f873303887f Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 16 Mar 2009 07:14:29 +0000 Subject: allow country selection on credit card entry, RT#4997 --- httemplate/misc/process/payment.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc/process/payment.cgi') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 2baca1e39..ea0c7946d 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -44,7 +44,7 @@ $cgi->param('payby') =~ /^(CARD|CHEK)$/ or errorpage("illegal payby ". $cgi->param('payby')); my $payby = $1; my %payby2fields = ( - 'CARD' => [ qw( address1 address2 city state zip ) ], + 'CARD' => [ qw( address1 address2 city county state zip country ) ], 'CHEK' => [ qw( ss paytype paystate stateid stateid_state ) ], ); my %type = ( 'CARD' => 'credit card', -- cgit v1.2.1 From 8800e519dc0e4b8eee4ab2cddc74d52c205bc536 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 25 Sep 2009 12:29:16 +0000 Subject: processing fee on credit card recharges, RT#5889 --- httemplate/misc/process/payment.cgi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'httemplate/misc/process/payment.cgi') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index ea0c7946d..d41bc0f14 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -32,6 +32,11 @@ $cgi->param('amount') =~ /^\s*(\d*(\.\d\d)?)\s*$/ my $amount = $1; errorpage("amount <= 0") unless $amount > 0; +if ( $cgi->param('fee') =~ /^\s*(\d*(\.\d\d)?)\s*$/ ) { + my $fee = $1; + $amount = sprintf('%.2f', $amount + $fee); +} + $cgi->param('year') =~ /^(\d+)$/ or errorpage("illegal year ". $cgi->param('year')); my $year = $1; @@ -143,6 +148,15 @@ if ( $cgi->param('batch') ) { ); errorpage($error) if $error; + #no error, so order the fee package if applicable... + if ( $cgi->param('fee_pkgpart') =~ /^(\d+)$/ ) { + my $error = $cust_main->order_pkg( + 'cust_pkg' => new FS::cust_pkg { 'pkgpart' => $1 } + ); + errorpage("payment processed successfully, but error ordering fee: $error") + if $error; + } + $cust_main->apply_payments; } -- cgit v1.2.1 From 0c2679eee18b3b073bc91657fcf85c5dd2e5efc0 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 5 Oct 2009 02:16:46 +0000 Subject: add manual_process-display config to subtract fee from amount instead of adding, RT#5889 --- httemplate/misc/process/payment.cgi | 13 ++++++++++--- 1 file changed, 10 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 d41bc0f14..1e9501df8 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -150,11 +150,18 @@ if ( $cgi->param('batch') ) { #no error, so order the fee package if applicable... if ( $cgi->param('fee_pkgpart') =~ /^(\d+)$/ ) { - my $error = $cust_main->order_pkg( - 'cust_pkg' => new FS::cust_pkg { 'pkgpart' => $1 } - ); + + my $cust_pkg = new FS::cust_pkg { 'pkgpart' => $1 }; + + my $error = $cust_main->order_pkg( 'cust_pkg' => $cust_pkg ); errorpage("payment processed successfully, but error ordering fee: $error") if $error; + + #and generate an invoice for it now too + $error = $cust_main->bill( 'pkg_list' => [ $cust_pkg ] ); + errorpage("payment processed and fee ordered sucessfully, but error billing fee: $error") + if $error; + } $cust_main->apply_payments; -- cgit v1.2.1