% 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_pending - Object methods for cust_pay_pending records
use FS::cust_pay_pending;
$record = new FS::cust_pay_pending \%hash;
$record = new FS::cust_pay_pending { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::cust_pay_pending object represents an pending payment. It reflects local state through the multiple stages of processing a real-time transaction with an external gateway. FS::cust_pay_pending inherits from FS::Record. The following fields are currently supported:
Primary key
Customer (see FS::cust_main)
Amount of this payment
Specified as a UNIX timestamp; see "time" in perlfunc. Also see Time::Local and Date::Parse for conversion functions.
Payment Type (See FS::payinfo_Mixin for valid payby values)
Payment Information (See FS::payinfo_Mixin for data format)
Masked payinfo (See FS::payinfo_Mixin for how this works)
Expiration date
Unique identifer to prevent duplicate transactions.
Desired pkgnum when using experimental package balances.
Pending transaction status, one of the following:
Aquires basic lock on payunique
Transaction is pending with the gateway
Customer has been sent to an off-site payment gateway to complete processing
Only used for two-stage transactions that require a separate capture step
Transaction completed with payment gateway (sucessfully), not yet recorded in the database
Transaction completed with payment gateway (declined), not yet recorded in the database
Transaction recorded in database
Additional status information.
Payment number (FS::cust_pay) of the completed payment.
Payment number of the payment if it's been voided.
Invoice number (FS::cust_bill) to try to apply this payment to.
Flag for whether this is a "manual" payment (i.e. initiated through self-service or the back-office web interface, rather than from an event or a payment batch). "Manual" payments will cause the customer to be sent a payment receipt rather than a statement.
Number of months the customer tried to prepay for.
Creates a new pending payment. To add the pending payment 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.
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 pending payment. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the associated FS::cust_main record if any. Otherwise returns false.
Sets the status of this pending pament to "done" (with statustext "captured (manual)"), and inserts a payment record (see FS::cust_pay).
Currently only used when resolving pending payments manually.
Sets the status of this pending payment to "done" and creates a completed payment (FS::cust_pay). This should be called when a realtime or third-party payment has been approved.
OPTIONS may include any of 'processor', 'payinfo', 'discount_term', 'auth', and 'order_number' to set those fields on the completed payment, as well as 'apply' to apply payments for this customer after inserting the new payment.
Sets the status of this pending payment to "done" (with statustext "declined (manual)" unless otherwise specified).
Currently only used when resolving pending payments manually.
Sets the status of this pending payment to "done" (with statustext "reversed (manual)" unless otherwise specified).
Currently only used when resolving pending payments manually.
FS::Record, schema.html from the base documentation.