summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pay_pending.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/cust_pay_pending.pm
parent7a51c5cf922048cf1478920b3fec496e0bb26aef (diff)
capture B:OP and B:BP failure_status values from payment attempts, #21117
Diffstat (limited to 'FS/FS/cust_pay_pending.pm')
-rw-r--r--FS/FS/cust_pay_pending.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/FS/FS/cust_pay_pending.pm b/FS/FS/cust_pay_pending.pm
index 8e29f08..8c6ef69 100644
--- a/FS/FS/cust_pay_pending.pm
+++ b/FS/FS/cust_pay_pending.pm
@@ -124,6 +124,13 @@ Transaction recorded in database
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.
@@ -215,6 +222,7 @@ sub check {
|| $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' )
@@ -425,10 +433,11 @@ sub approve {
'';
}
-=item decline [ STATUSTEXT ]
+=item decline [ STATUSTEXT [ STATUS ] ]
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.
@@ -437,11 +446,15 @@ Currently only used when resolving pending payments manually.
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
+ # 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->failure_status($failure_status);
$self->replace;
}