X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay_batch.pm;h=db53b19c98a524c57cfaafdcb00fc7a2935ecec8;hb=517ad7e0c5bd5a6329dfd3ef9c35f69afea9fc49;hp=e1e32d3d422968adee3ad04b64ba3030a61b63cb;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/FS/FS/cust_pay_batch.pm b/FS/FS/cust_pay_batch.pm index e1e32d3d4..db53b19c9 100644 --- a/FS/FS/cust_pay_batch.pm +++ b/FS/FS/cust_pay_batch.pm @@ -16,6 +16,9 @@ use FS::cust_bill; # 3 is even more information including possibly sensitive data $DEBUG = 0; +#@encrypted_fields = ('payinfo'); +sub nohistory_fields { ('payinfo'); } + =head1 NAME FS::cust_pay_batch - Object methods for batch cards @@ -84,6 +87,9 @@ following fields are currently supported: =item error_message - the error returned by the gateway if any +=item failure_status - the normalized L failure +status, if any + =back =head1 METHODS @@ -340,20 +346,24 @@ sub approve { return; } -=item decline [ REASON ] +=item decline [ REASON [ STATUS ] ] Decline this payment. This will replace the existing record with the same paybatchnum, set its status to 'Declined', and run collection events as appropriate. This should only be called from the batch import process. REASON is a string description of the decline reason, defaulting to -'Returned payment'. +'Returned payment', and will go into the "error_message" field. + +STATUS is a normalized failure status defined by L, +and will go into the "failure_status" field. =cut sub decline { my $new = shift; my $reason = shift || 'Returned payment'; + my $failure_status = shift || ''; #my $conf = new FS::Conf; my $paybatchnum = $new->paybatchnum; @@ -390,6 +400,7 @@ sub decline { } # !$old->status $new->status('Declined'); $new->error_message($reason); + $new->failure_status($failure_status); my $error = $new->replace($old); if ( $error ) { return "error updating status of paybatchnum $paybatchnum: $error\n";