1 package FS::prepay_credit;
5 #use FS::Record qw( qsearch qsearchs );
12 FS::prepay_credit - Object methods for prepay_credit records
16 use FS::prepay_credit;
18 $record = new FS::prepay_credit \%hash;
19 $record = new FS::prepay_credit {
20 'identifier' => '4198123455512121'
24 $error = $record->insert;
26 $error = $new_record->replace($old_record);
28 $error = $record->delete;
30 $error = $record->check;
34 An FS::table_name object represents an pre--paid credit, such as a pre-paid
35 "calling card". FS::prepay_credit inherits from FS::Record. The following
36 fields are currently supported:
40 =item field - description
42 =item identifier - identifier entered by the user to receive the credit
44 =item amount - amount of the credit
54 Creates a new pre-paid credit. To add the example to the database, see
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 sub table { 'prepay_credit'; }
66 Adds this record to the database. If there is an error, returns the error,
67 otherwise returns false.
73 Delete this record from the database.
77 =item replace OLD_RECORD
79 Replaces the OLD_RECORD with this one in the database. If there is an error,
80 returns the error, otherwise returns false.
86 Checks all fields to make sure this is a valid pre-paid credit. If there is
87 an error, returns the error, otherwise returns false. Called by the insert
95 my $identifier = $self->identifier;
96 $identifier =~ s/\W//g; #anything else would just confuse things
97 $self->identifier($identifier);
99 $self->ut_numbern('prepaynum')
100 || $self->ut_alpha('identifier')
101 || $self->ut_money('amount')
110 $Id: prepay_credit.pm,v 1.2 2000-02-02 20:22:18 ivan Exp $
116 L<FS::Record>, schema.html from the base documentation.
120 $Log: prepay_credit.pm,v $
121 Revision 1.2 2000-02-02 20:22:18 ivan
122 bugfix prepayment in signup server
124 Revision 1.1 2000/01/31 05:22:23 ivan
125 prepaid "internet cards"