<% 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_payby

NAME

FS::cust_payby - Object methods for cust_payby records

SYNOPSIS

  use FS::cust_payby;

  $record = new FS::cust_payby \%hash;
  $record = new FS::cust_payby { 'column' => 'value' };

  $error = $record->insert;

  $error = $new_record->replace($old_record);

  $error = $record->delete;

  $error = $record->check;

DESCRIPTION

An FS::cust_payby object represents customer stored payment information. FS::cust_payby inherits from FS::Record. The following fields are currently supported:

custpaybynum

primary key

custnum

custnum

weight

weight

payby

payby

payinfo

payinfo

paycvv

paycvv

paymask

paymask

paydate

paydate

paystart_month

paystart_month

paystart_year

paystart_year

payissue

payissue

payname

payname

paystate

paystate

paytype

paytype

payip

payip

paycardtype

The credit card type (deduced from the card number).

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.

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 record. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.

paydate_mon_year

Returns a two element list consisting of the paydate month and year.

label

Returns a one line text label for this payment type.

realtime_bop

Runs a "realtime_bop" in FS::cust_main::Billing_Realtime transaction on this card

tokenize

Runs a "realtime_tokenize" in FS::cust_main::Billing_Realtime transaction on this card

verify

Runs a realtime_verify_bop transaction on this card

paytypes

Returns a list of valid values for the paytype field (bank account type for electronic check payment).

cgi_cust_payby_fields

Returns the field names used in the web interface (including some pseudo-fields).

cgi_hash_callback HASHREF OLD

Subroutine (not a class or object method). Processes a hash reference of web interface contet (transfers the data from pseudo-fields to real fields).

If OLD object is passed, also preserves locationnum, paystart_month, paystart_year, payissue and payip. If the new field is blank but the old is not, the old field will be preserved.

search_sql

Class method.

Returns a qsearch hash expression to search for parameters specified in HASHREF. Valid paramters are:

payby

listref

paydate_year
paydate_month
has_autobill_cards

Returns the number of unexpired cards configured for autobill

has_autobill_checks

Returns the number of check accounts configured for autobill

future_autobill_report_title

Determine if the future_autobill report should be available. If so, return a dynamic title for it

_upgrade_data_paydate_edgebug

Correct bad data injected into payment expire date column by Edge browser bug

The month and year values may have an extra character injected into form POST data by Edge browser. It was possible for some bad month values to slip past data validation.

If the stored value was out of range, it was causing payments screen to crash. We can detect and fix this by dropping the second digit.

If the stored value is is 11 or 12, it's possible the user inputted a 1. In this case, the payment method will fail to authorize, but the record will not cause crashdumps for being out of range.

In short, check for any expiration month > 12, and drop the extra digit

BUGS

SEE ALSO

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

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 919:

'=item' outside of any '=over'

Around line 1084:

You forgot a '=back' before '=head1'

<% include ('/elements/footer.html' ) %>