- web interface for hourly account charges!
[freeside.git] / httemplate / docs / man / FS / prepay_credit.html
1 <HTML>
2 <HEAD>
3 <TITLE>FS::prepay_credit - Object methods for prepay_credit records</TITLE>
4 <LINK REV="made" HREF="mailto:perl@packages.debian.org">
5 </HEAD>
6
7 <BODY>
8
9 <A NAME="__index__"></A>
10 <!-- INDEX BEGIN -->
11
12 <UL>
13
14         <LI><A HREF="#name">NAME</A></LI>
15         <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
16         <LI><A HREF="#description">DESCRIPTION</A></LI>
17         <LI><A HREF="#methods">METHODS</A></LI>
18         <LI><A HREF="#version">VERSION</A></LI>
19         <LI><A HREF="#bugs">BUGS</A></LI>
20         <LI><A HREF="#see also">SEE ALSO</A></LI>
21 </UL>
22 <!-- INDEX END -->
23
24 <HR>
25 <P>
26 <H1><A NAME="name">NAME</A></H1>
27 <P>FS::prepay_credit - Object methods for prepay_credit records</P>
28 <P>
29 <HR>
30 <H1><A NAME="synopsis">SYNOPSIS</A></H1>
31 <PRE>
32   use FS::prepay_credit;</PRE>
33 <PRE>
34   $record = new FS::prepay_credit \%hash;
35   $record = new FS::prepay_credit {
36     'identifier' =&gt; '4198123455512121'
37     'amount'     =&gt; '19.95',
38   };</PRE>
39 <PRE>
40   $error = $record-&gt;insert;</PRE>
41 <PRE>
42   $error = $new_record-&gt;replace($old_record);</PRE>
43 <PRE>
44   $error = $record-&gt;delete;</PRE>
45 <PRE>
46   $error = $record-&gt;check;</PRE>
47 <P>
48 <HR>
49 <H1><A NAME="description">DESCRIPTION</A></H1>
50 <P>An FS::table_name object represents an pre--paid credit, such as a pre-paid
51 ``calling card''.  FS::prepay_credit inherits from FS::Record.  The following
52 fields are currently supported:</P>
53 <DL>
54 <DT><STRONG><A NAME="item_field_%2D_description">field - description</A></STRONG><BR>
55 <DD>
56 <DT><STRONG><A NAME="item_identifier_%2D_identifier_entered_by_the_user_to_r">identifier - identifier entered by the user to receive the credit</A></STRONG><BR>
57 <DD>
58 <DT><STRONG><A NAME="item_amount_%2D_amount_of_the_credit">amount - amount of the credit</A></STRONG><BR>
59 <DD>
60 </DL>
61 <P>
62 <HR>
63 <H1><A NAME="methods">METHODS</A></H1>
64 <DL>
65 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
66 <DD>
67 Creates a new pre-paid credit.  To add the example to the database, see
68 <A HREF="#insert">insert</A>.
69 <P>Note that this stores the hash reference, not a distinct copy of the hash it
70 points to.  You can ask the object for a copy with the <EM>hash</EM> method.</P>
71 <P></P>
72 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
73 <DD>
74 Adds this record to the database.  If there is an error, returns the error,
75 otherwise returns false.
76 <P></P>
77 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
78 <DD>
79 Delete this record from the database.
80 <P></P>
81 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
82 <DD>
83 Replaces the OLD_RECORD with this one in the database.  If there is an error,
84 returns the error, otherwise returns false.
85 <P></P>
86 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
87 <DD>
88 Checks all fields to make sure this is a valid pre-paid credit.  If there is
89 an error, returns the error, otherwise returns false.  Called by the insert
90 and replace methods.
91 <P></P></DL>
92 <P>
93 <HR>
94 <H1><A NAME="version">VERSION</A></H1>
95 <P>$Id: prepay_credit.html,v 1.3 2002-01-29 17:42:46 ivan Exp $</P>
96 <P>
97 <HR>
98 <H1><A NAME="bugs">BUGS</A></H1>
99 <P>
100 <HR>
101 <H1><A NAME="see also">SEE ALSO</A></H1>
102 <P><A HREF=".././FS/Record.html">the FS::Record manpage</A>, schema.html from the base documentation.</P>
103
104 </BODY>
105
106 </HTML>