Freeside:3:Documentation:Developer/FS/cust pay pending

From Freeside
< Freeside:3:Documentation:Developer‎ | FS
Revision as of 20:04, 27 June 2012 by Ivan (talk | contribs) (Edit via perl MediaWiki framework (1.13))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::cust_pay_pending - Object methods for cust_pay_pending records

SYNOPSIS

 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;

DESCRIPTION

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:

paypendingnum
Primary key
custnum
Customer (see FS::cust_main)
paid
Amount of this payment
_date
Specified as a UNIX timestamp; see "time" in perlfunc. Also see Time::Local and Date::Parse for conversion functions.
payby
Payment Type (See FS::payinfo_Mixin for valid payby values)
payinfo
Payment Information (See FS::payinfo_Mixin for data format)
paymask
Masked payinfo (See FS::payinfo_Mixin for how this works)
paydate
Expiration date
payunique
Unique identifer to prevent duplicate transactions.
pkgnum
Desired pkgnum when using experimental package balances.
status
Pending transaction status, one of the following:
new
Aquires basic lock on payunique
pending
Transaction is pending with the gateway
thirdparty
Customer has been sent to an off-site payment gateway to complete processing
authorized
Only used for two-stage transactions that require a separate capture step
captured
Transaction completed with payment gateway (sucessfully), not yet recorded in the database
declined
Transaction completed with payment gateway (declined), not yet recorded in the database
done
Transaction recorded in database
statustext
Additional status information.
gatewaynum
FS::payment_gateway id.
paynum -

METHODS

new HASHREF
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.
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.
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 pending payment. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
cust_main
Returns the associated FS::cust_main record if any. Otherwise returns false.
insert_cust_pay
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.
decline [ STATUSTEXT ]
Sets the status of this pending payment to "done" (with statustext "declined (manual)" unless otherwise specified).
Currently only used when resolving pending payments manually.

BUGS

SEE ALSO

FS::Record, schema.html from the base documentation.