<% 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::payinfo_Mixin

NAME

FS::payinfo_Mixin - Mixin class for records in tables that contain payinfo.

SYNOPSIS

package FS::some_table; use vars qw(@ISA); @ISA = qw( FS::payinfo_Mixin FS::Record );

DESCRIPTION

This is a mixin class for records that contain payinfo.

FIELDS

payby

The following payment types (payby) are supported:

For Customers (cust_main): 'CARD' (credit card - automatic), 'DCRD' (credit card - on-demand), 'CHEK' (electronic check - automatic), 'DCHK' (electronic check - on-demand), 'LECB' (Phone bill billing), 'BILL' (billing), 'COMP' (free), or 'PREPAY' (special billing type: applies a credit and sets billing type to BILL - see FS::prepay_credit)

For Refunds (cust_refund): 'CARD' (credit cards), 'CHEK' (electronic check/ACH), 'LECB' (Phone bill billing), 'BILL' (billing), 'CASH' (cash), 'WEST' (Western Union), 'MCRD' (Manual credit card), 'MCHK' (Manual electronic check), 'CBAK' Chargeback, or 'COMP' (free)

For Payments (cust_pay): 'CARD' (credit cards), 'CHEK' (electronic check/ACH), 'LECB' (phone bill billing), 'BILL' (billing), 'PREP' (prepaid card), 'CASH' (cash), 'WEST' (Western Union), 'MCRD' (Manual credit card), 'MCHK' (Manual electronic check), 'PPAL' (PayPal) 'COMP' (free) is depricated as a payment type in cust_pay

payinfo

Payment information (payinfo) can be one of the following types:

Card Number, P.O., comp issuer (4-8 lowercase alphanumerics; think username) prepayment identifier (see FS::prepay_credit), PayPal transaction ID

paycvv

Card Verification Value, "CVV2" (also known as CVC2 or CID), the 3 or 4 digit number on the back (or front, for American Express) of the credit card

paymask

METHODS

mask_payinfo [ PAYBY, PAYINFO ]

This method converts the payment info (credit card, bank account, etc.) into a masked string.

Optionally, an arbitrary payby and payinfo can be passed.

payinfo_check

Checks payby and payinfo.

payby_payinfo_pretty [ LOCALE ]

Returns payment method and information (suitably masked, if applicable) as a human-readable string, such as:

  Card #54xxxxxxxxxxxx32

or

  Check #119006
payinfo_used [ PAYINFO ]

Returns 1 if there's an existing payment using this payinfo. This can be used to set the 'recurring payment' flag required by some processors.

display_status

For transactions that have both 'status' and 'failure_status', shows the status in a single, display-friendly string.

paydate_monthyear

Returns a two-element list consisting of the month and year of this customer's paydate (credit card expiration date for CARD customers)

paydate_epoch

Returns the exact time in seconds corresponding to the payment method expiration date. For CARD/DCRD customers this is the end of the month; for others (COMP is the only other payby that uses paydate) it's the start. Returns 0 if the paydate is empty or set to the far future.

paydate_epoch_sql

Class method. Returns an SQL expression to obtain the payment expiration date as a number of seconds.

upgrade_set_cardtype

Find all records with a credit card payment type and no paycardtype, and replace them in order to set their paycardtype.

This method actually just starts a queue job.

tokenized [ PAYINFO ]

Returns true if object payinfo is tokenized

Optionally, an arbitrary payby and payinfo can be passed.

BUGS

SEE ALSO

FS::payby, FS::Record

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