X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_pay_pending.pm;h=e54690e4bbb51bd835c49ec8e737e89c8c46c7ab;hp=bbabd247ea16d0b3cb8330a3f9d3505272428a03;hb=d6741df87df9e3352d7ae47a02d0e3f46154fef9;hpb=7621140d9f8945c54523c05bcac8e79693a16a52 diff --git a/FS/FS/cust_pay_pending.pm b/FS/FS/cust_pay_pending.pm index bbabd247e..e54690e4b 100644 --- a/FS/FS/cust_pay_pending.pm +++ b/FS/FS/cust_pay_pending.pm @@ -6,6 +6,7 @@ use FS::Record qw( qsearch qsearchs dbh ); #dbh for _upgrade_data use FS::payinfo_transaction_Mixin; use FS::cust_main_Mixin; use FS::cust_main; +use FS::cust_pkg; use FS::cust_pay; @ISA = qw( FS::payinfo_transaction_Mixin FS::cust_main_Mixin FS::Record ); @@ -77,6 +78,10 @@ Expiration date Unique identifer to prevent duplicate transactions. +=item pkgnum + +Desired pkgnum when using experimental package balances. + =item status Pending transaction status, one of the following: @@ -115,9 +120,9 @@ Transaction recorded in database Additional status information. -=cut +=item gatewaynum -#=item cust_balance - +L id. =item paynum - @@ -191,7 +196,9 @@ sub check { #|| $self->ut_textn('statustext') || $self->ut_anything('statustext') #|| $self->ut_money('cust_balance') + || $self->ut_hexn('session_id') || $self->ut_foreign_keyn('paynum', 'cust_pay', 'paynum' ) + || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum') || $self->payinfo_check() #payby/payinfo/paymask/paydate ; return $error if $error; @@ -215,6 +222,18 @@ sub check { $self->SUPER::check; } +=item cust_main + +Returns the associated L record if any. Otherwise returns false. + +=cut + +sub cust_main { + my $self = shift; + qsearchs('cust_main', { custnum => $self->custnum } ); +} + + #these two are kind-of false laziness w/cust_main::realtime_bop #(currently only used when resolving pending payments manually) @@ -273,10 +292,10 @@ sub insert_cust_pay { } -=item decline +=item decline [ STATUSTEXT ] -Sets the status of this pending pament to "done" (with statustext -"declined (manual)"). +Sets the status of this pending payment to "done" (with statustext +"declined (manual)" unless otherwise specified). Currently only used when resolving pending payments manually. @@ -284,11 +303,12 @@ Currently only used when resolving pending payments manually. sub decline { my $self = shift; + my $statustext = shift || "declined (manual)"; #could send decline email too? doesn't seem useful in manual resolution $self->status('done'); - $self->statustext("declined (manual)"); + $self->statustext($statustext); $self->replace; }