1 package FS::banned_pay;
5 use FS::Record qw( qsearch qsearchs );
6 use FS::UID qw( getotaker );
12 FS::banned_pay - Object methods for banned_pay records
18 $record = new FS::banned_pay \%hash;
19 $record = new FS::banned_pay { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::banned_pay object represents an banned credit card or ACH account.
32 FS::banned_pay inherits from FS::Record. The following fields are currently
37 =item bannum - primary key
39 =item payby - I<CARD> or I<CHEK>
41 =item payinfo - fingerprint of banned card (base64-encoded MD5 digest)
43 =item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
44 L<Time::Local> and L<Date::Parse> for conversion functions.
46 =item otaker - order taker (assigned automatically, see L<FS::UID>)
48 =item reason - reason (text)
58 Creates a new ban. To add the ban to the database, see L<"insert">.
60 Note that this stores the hash reference, not a distinct copy of the hash it
61 points to. You can ask the object for a copy with the I<hash> method.
65 # the new method can be inherited from FS::Record, if a table method is defined
67 sub table { 'banned_pay'; }
71 Adds this record to the database. If there is an error, returns the error,
72 otherwise returns false.
76 # the insert method can be inherited from FS::Record
80 Delete this record from the database.
84 # the delete method can be inherited from FS::Record
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 # the replace method can be inherited from FS::Record
97 Checks all fields to make sure this is a valid ban. If there is
98 an error, returns the error, otherwise returns false. Called by the insert
103 # the check method should currently be supplied - FS::Record contains some
104 # data checking routines
110 $self->ut_numbern('bannum')
111 || $self->ut_enum('payby', [ 'CARD', 'CHEK' ] )
112 || $self->ut_text('payinfo')
113 || $self->ut_numbern('_date')
114 || $self->ut_textn('reason')
116 return $error if $error;
118 $self->_date(time) unless $self->_date;
120 $self->otaker(getotaker);
131 L<FS::Record>, schema.html from the base documentation.