projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
package fees and usage-based fees, #27687, #25899
[freeside.git]
/
FS
/
FS
/
cust_pay_pending.pm
diff --git
a/FS/FS/cust_pay_pending.pm
b/FS/FS/cust_pay_pending.pm
index
8e29f08
..
f5de73d
100644
(file)
--- a/
FS/FS/cust_pay_pending.pm
+++ b/
FS/FS/cust_pay_pending.pm
@@
-1,17
+1,13
@@
package FS::cust_pay_pending;
package FS::cust_pay_pending;
+use base qw( FS::payinfo_transaction_Mixin FS::cust_main_Mixin FS::Record );
use strict;
use strict;
-use vars qw( @ISA @encrypted_fields );
-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 vars qw( @encrypted_fields );
+use FS::Record qw( qsearchs dbh ); #dbh for _upgrade_data
use FS::cust_pay;
use FS::cust_pay;
-@ISA = qw( FS::payinfo_transaction_Mixin FS::cust_main_Mixin FS::Record );
-
@encrypted_fields = ('payinfo');
@encrypted_fields = ('payinfo');
+sub nohistory_fields { ('payinfo'); }
=head1 NAME
=head1 NAME
@@
-124,6
+120,13
@@
Transaction recorded in database
Additional status information.
Additional status information.
+=item failure_status
+
+One of the standard failure status strings defined in
+L<Business::OnlinePayment>: "expired", "nsf", "stolen", "pickup",
+"blacklisted", "declined". If the transaction status is not "declined",
+this will be empty.
+
=item gatewaynum
L<FS::payment_gateway> id.
=item gatewaynum
L<FS::payment_gateway> id.
@@
-215,6
+218,7
@@
sub check {
|| $self->ut_text('status')
#|| $self->ut_textn('statustext')
|| $self->ut_anything('statustext')
|| $self->ut_text('status')
#|| $self->ut_textn('statustext')
|| $self->ut_anything('statustext')
+ || $self->ut_textn('failure_status')
#|| $self->ut_money('cust_balance')
|| $self->ut_hexn('session_id')
|| $self->ut_foreign_keyn('paynum', 'cust_pay', 'paynum' )
#|| $self->ut_money('cust_balance')
|| $self->ut_hexn('session_id')
|| $self->ut_foreign_keyn('paynum', 'cust_pay', 'paynum' )
@@
-251,12
+255,6
@@
Returns the associated L<FS::cust_main> record if any. Otherwise returns false.
=cut
=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)
#these two are kind-of false laziness w/cust_main::realtime_bop
#(currently only used when resolving pending payments manually)
@@
-425,10
+423,11
@@
sub approve {
'';
}
'';
}
-=item decline [ STATUSTEXT ]
+=item decline [ STATUSTEXT
[ STATUS ]
]
Sets the status of this pending payment to "done" (with statustext
Sets the status of this pending payment to "done" (with statustext
-"declined (manual)" unless otherwise specified).
+"declined (manual)" unless otherwise specified). The optional STATUS can be
+used to set the failure_status field.
Currently only used when resolving pending payments manually.
Currently only used when resolving pending payments manually.
@@
-437,11
+436,15
@@
Currently only used when resolving pending payments manually.
sub decline {
my $self = shift;
my $statustext = shift || "declined (manual)";
sub decline {
my $self = shift;
my $statustext = shift || "declined (manual)";
+ my $failure_status = shift || '';
#could send decline email too? doesn't seem useful in manual resolution
#could send decline email too? doesn't seem useful in manual resolution
+ # this is also used for thirdparty payment execution failures, but a decline
+ # email isn't useful there either, and will just confuse people.
$self->status('done');
$self->statustext($statustext);
$self->status('done');
$self->statustext($statustext);
+ $self->failure_status($failure_status);
$self->replace;
}
$self->replace;
}