summaryrefslogtreecommitdiff
path: root/FS/FS/payinfo_Mixin.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-08-15 16:59:05 -0700
committerMark Wells <mark@freeside.biz>2013-08-15 16:59:05 -0700
commit8f47076c27dd065fa130fd6b1af7dd90c2125d5f (patch)
treecafdc08b3e4208c00a30c6bb79680df5989ab682 /FS/FS/payinfo_Mixin.pm
parent7a51c5cf922048cf1478920b3fec496e0bb26aef (diff)
capture B:OP and B:BP failure_status values from payment attempts, #21117
Diffstat (limited to 'FS/FS/payinfo_Mixin.pm')
-rw-r--r--FS/FS/payinfo_Mixin.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index 5c4acf7..66c1e59 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -290,6 +290,33 @@ sub payinfo_used {
return 0;
}
+=item display_status
+
+For transactions that have both 'status' and 'failure_status', shows the
+status in a single, display-friendly string.
+
+=cut
+
+sub display_status {
+ my $self = shift;
+ my %status = (
+ 'done' => 'Approved',
+ 'expired' => 'Card Expired',
+ 'stolen' => 'Lost/Stolen',
+ 'pickup' => 'Pick Up Card',
+ 'nsf' => 'Insufficient Funds',
+ 'inactive' => 'Inactive Account',
+ 'blacklisted' => 'Blacklisted',
+ 'declined' => 'Declined',
+ 'approved' => 'Approved',
+ );
+ if ( $self->failure_status ) {
+ return $status{$self->failure_status};
+ } else {
+ return $status{$self->status};
+ }
+}
+
=back
=head1 BUGS