}
- if ( $self->paydate eq '' ) {
+ if ( $self->paydate eq '' || $self->paydate eq '-' ) {
return "Expriation date required"
unless $self->payby eq 'BILL' || $self->payby eq 'PREPAY';
$self->paydate('');
=head1 VERSION
-$Id: cust_main.pm,v 1.3 2000-01-31 05:22:23 ivan Exp $
+$Id: cust_main.pm,v 1.4 2000-02-02 20:22:18 ivan Exp $
=head1 BUGS
$identifier =~ s/\W//g; #anything else would just confuse things
$self->identifier($identifier);
- $self->ut_number('prepaynum')
+ $self->ut_numbern('prepaynum')
|| $self->ut_alpha('identifier')
|| $self->ut_money('amount')
;
=head1 VERSION
-$Id: prepay_credit.pm,v 1.1 2000-01-31 05:22:23 ivan Exp $
+$Id: prepay_credit.pm,v 1.2 2000-02-02 20:22:18 ivan Exp $
=head1 BUGS
=head1 HISTORY
$Log: prepay_credit.pm,v $
-Revision 1.1 2000-01-31 05:22:23 ivan
+Revision 1.2 2000-02-02 20:22:18 ivan
+bugfix prepayment in signup server
+
+Revision 1.1 2000/01/31 05:22:23 ivan
prepaid "internet cards"
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::prepay_credit;
+
+require 5.004; #srand(time|$$);
+
+my $user = shift or die &usage;
+&adminsuidsetup( $user );
+
+my $amount = shift or die &usage;
+
+my $num_digits = shift or die &usage;
+
+my $num_entries = shift or die &usage;
+
+for ( 1 .. $num_entries ) {
+ my $identifier = join( '', map int(rand(10)), ( 1 .. $num_digits ) );
+ my $prepay_credit = new FS::prepay_credit {
+ 'identifier' => $identifier,
+ 'amount' => $amount,
+ };
+ my $error = $prepay_credit->insert;
+ die $error if $error;
+ print "$identifier\n";
+}
+
+sub usage {
+ die "Usage:\n\n generate-prepay user amount num_digits num_entries";
+}
+
$Debug = 0;
-my @payby = qw(CARD);
+my @payby = qw(CARD PREPAY);
my $user = shift or die &usage;
&adminsuidsetup( $user );
<li>$email_name - first and last name
</ul>
(an example file is included as <b>fs_signup/ieak.template</b>)
- <li>If there are any entries in the <i>prepay_credit</i> table, a user can enter a string matching the <b>identifier</i> column to receive the credit specified in the <b>amount</b> column, after which that <b>identifier</b> is no longer valid. This can be used to implement pre-paid "calling card" type signups.
+ <li>If there are any entries in the <i>prepay_credit</i> table, a user can enter a string matching the <b>identifier</i> column to receive the credit specified in the <b>amount</b> column, after which that <b>identifier</b> is no longer valid. This can be used to implement pre-paid "calling card" type signups. The <i>bin/generate-prepay</i> script can be used to populate the <i>prepay_credit</i> table.
</ul>
</body>