% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::cust_pay_batch - Object methods for batch cards
use FS::cust_pay_batch;
$record = new FS::cust_pay_batch \%hash;
$record = new FS::cust_pay_batch { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
#deprecated# $error = $record->retriable;
An FS::cust_pay_batch object represents a credit card transaction ready to be batched (sent to a processor). FS::cust_pay_batch inherits from FS::Record. Typically called by the collect method of an FS::cust_main object. The following fields are currently supported:
Creates a new record. To add the record to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database. If there is an error, returns the error, otherwise returns false.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid transaction. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the customer (see FS::cust_main) for this batched credit card payment.
Returns the credit card expiration date in MMYY format. If this is a CHEK payment, returns an empty string.
Returns the payment batch this payment belongs to (FS::pay_batch).
Approve this payment. This will replace the existing record with the same paybatchnum, set its status to 'Approved', and generate a payment record (FS::cust_pay). This should only be called from the batch import process.
OPTIONS may contain "gatewaynum", "processor", "auth", and "order_number".
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'.
Returns a Business::BatchPayment::Item object for this batch payment entry. This can be submitted to a processor.
OPTIONS can be a list of key/values to append to the attributes. The most useful case of this is "process_date" to set a processing date based on the date the batch is being submitted.
"unbatch_and_delete" run as a queued job, accepts $job and $param.
May only be called on a record with an empty status and an associated FS::pay_batch with a status of 'O' (not yet in transit.) Deletes all associated records from FS::cust_bill_pay_batch and then deletes this record. If there is an error, returns the error, otherwise returns false.
There should probably be a configuration file with a list of allowed credit card types.