add svc_forward, depriciate svc_acct_sm
[freeside.git] / htdocs / 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         <LI><A HREF="#history">HISTORY</A></LI>
22 </UL>
23 <!-- INDEX END -->
24
25 <HR>
26 <P>
27 <H1><A NAME="name">NAME</A></H1>
28 <P>FS::prepay_credit - Object methods for prepay_credit records</P>
29 <P>
30 <HR>
31 <H1><A NAME="synopsis">SYNOPSIS</A></H1>
32 <PRE>
33   use FS::prepay_credit;</PRE>
34 <PRE>
35   $record = new FS::prepay_credit \%hash;
36   $record = new FS::prepay_credit {
37     'identifier' =&gt; '4198123455512121'
38     'amount'     =&gt; '19.95',
39   };</PRE>
40 <PRE>
41   $error = $record-&gt;insert;</PRE>
42 <PRE>
43   $error = $new_record-&gt;replace($old_record);</PRE>
44 <PRE>
45   $error = $record-&gt;delete;</PRE>
46 <PRE>
47   $error = $record-&gt;check;</PRE>
48 <P>
49 <HR>
50 <H1><A NAME="description">DESCRIPTION</A></H1>
51 <P>An FS::table_name object represents an pre--paid credit, such as a pre-paid
52 ``calling card''.  FS::prepay_credit inherits from FS::Record.  The following
53 fields are currently supported:</P>
54 <DL>
55 <DT><STRONG><A NAME="item_field_%2D_description">field - description</A></STRONG><BR>
56 <DD>
57 <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>
58 <DD>
59 <DT><STRONG><A NAME="item_amount_%2D_amount_of_the_credit">amount - amount of the credit</A></STRONG><BR>
60 <DD>
61 </DL>
62 <P>
63 <HR>
64 <H1><A NAME="methods">METHODS</A></H1>
65 <DL>
66 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
67 <DD>
68 Creates a new pre-paid credit.  To add the example to the database, see
69 <A HREF="#insert">insert</A>.
70 <P>Note that this stores the hash reference, not a distinct copy of the hash it
71 points to.  You can ask the object for a copy with the <EM>hash</EM> method.</P>
72 <P></P>
73 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
74 <DD>
75 Adds this record to the database.  If there is an error, returns the error,
76 otherwise returns false.
77 <P></P>
78 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
79 <DD>
80 Delete this record from the database.
81 <P></P>
82 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
83 <DD>
84 Replaces the OLD_RECORD with this one in the database.  If there is an error,
85 returns the error, otherwise returns false.
86 <P></P>
87 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
88 <DD>
89 Checks all fields to make sure this is a valid pre-paid credit.  If there is
90 an error, returns the error, otherwise returns false.  Called by the insert
91 and replace methods.
92 <P></P></DL>
93 <P>
94 <HR>
95 <H1><A NAME="version">VERSION</A></H1>
96 <P>$Id: prepay_credit.html,v 1.1 2001-04-23 12:41:57 ivan Exp $</P>
97 <P>
98 <HR>
99 <H1><A NAME="bugs">BUGS</A></H1>
100 <P>
101 <HR>
102 <H1><A NAME="see also">SEE ALSO</A></H1>
103 <P><A HREF=".././FS/Record.html">the FS::Record manpage</A>, schema.html from the base documentation.</P>
104 <P>
105 <HR>
106 <H1><A NAME="history">HISTORY</A></H1>
107 <P>$Log: prepay_credit.html,v $
108 <P>Revision 1.1  2001-04-23 12:41:57  ivan
109 <P>new API documentation
110 <P>
111 Revision 1.2  2000/02/02 20:22:18  ivan
112 bugfix prepayment in signup server</P>
113 <P>Revision 1.1  2000/01/31 05:22:23  ivan
114 prepaid ``internet cards''</P>
115
116 </BODY>
117
118 </HTML>