1 package FS::agent_payment_gateway;
2 use base qw(FS::Record);
3 use FS::Record qw( qsearch );
9 FS::agent_payment_gateway - Object methods for agent_payment_gateway records
13 use FS::agent_payment_gateway;
15 $record = new FS::agent_payment_gateway \%hash;
16 $record = new FS::agent_payment_gateway { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::agent_payment_gateway object represents a payment gateway override for
29 a specific agent. FS::agent_payment_gateway inherits from FS::Record. The
30 following fields are currently supported:
34 =item agentgatewaynum - primary key
52 Creates a new override. To add the override to the database, see L<"insert">.
54 Note that this stores the hash reference, not a distinct copy of the hash it
55 points to. You can ask the object for a copy with the I<hash> method.
59 # the new method can be inherited from FS::Record, if a table method is defined
61 sub table { 'agent_payment_gateway'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
70 # the insert method can be inherited from FS::Record
74 Delete this record from the database.
78 # the delete method can be inherited from FS::Record
80 =item replace OLD_RECORD
82 Replaces the OLD_RECORD with this one in the database. If there is an error,
83 returns the error, otherwise returns false.
87 # the replace method can be inherited from FS::Record
91 Checks all fields to make sure this is a valid override. If there is
92 an error, returns the error, otherwise returns false. Called by the insert
97 # the check method should currently be supplied - FS::Record contains some
98 # data checking routines
104 $self->ut_numbern('agentgatewaynum')
105 || $self->ut_foreign_key('agentnum', 'agent', 'agentnum')
106 || $self->ut_foreign_key('gatewaynum', 'payment_gateway', 'gatewaynum' )
107 || $self->ut_textn('cardtype')
108 || $self->ut_textn('taxclass')
110 return $error if $error;
116 # to simplify tokenization upgrades
117 die "Agent taxclass override no longer supported"
119 'table' => 'agent_payment_gateway',
120 'extra_sql' => ' WHERE taxclass IS NOT NULL AND taxclass != \'\'',
122 die "Agent cardtype override no longer supported"
124 'table' => 'agent_payment_gateway',
125 'extra_sql' => ' WHERE cardtype IS NOT NULL AND cardtype != \'\'',
130 =item payment_gateway
138 L<FS::payment_gateway>, L<FS::agent>, L<FS::Record>, schema.html from the