Freeside:1.7:Documentation:Developer/FS/cust pay batch
From Freeside
Contents
NAME
FS::cust_pay_batch - Object methods for batch cards
SYNOPSIS
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; $error = $record->retriable;
DESCRIPTION
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:
- paybatchnum - primary key (automatically assigned); batchnum - indentifies group in batch; payby - CARD/CHEK/LECB/BILL/COMP; payinfo; exp - card expiration; amount; invnum - invoice; custnum - customer; payname - name on card; first - name; last - name; address1; address2; city; state; zip; country; status
METHODS
- new HASHREF
- 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.
- insert
- Adds this record to the database. If there is an error, returns the error, otherwise returns false.
- delete
- Delete this record from the database. If there is an error, returns the error, otherwise returns false.
- replace OLD_RECORD
- Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
- check
- 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.
- cust_main
- Returns the customer (see FS::cust_main) for this batched credit card payment.
- retriable
- Marks the corresponding event (see FS::cust_bill_event) for this batched credit card payment as retriable. Useful if the corresponding financial institution account was declined for temporary reasons and/or a manual retry is desired.
- Implementation details: For the named customer's invoice, changes the statustext of the 'done' (without statustext) event to 'retriable.'
BUGS
There should probably be a configuration file with a list of allowed credit card types.