New HTTP export for svc_acct and additional option for existing HTTP exports, RT10216
[freeside.git] / FS / FS / part_export / acct_http.pm
1 package FS::part_export::acct_http;
2
3 use vars qw( @ISA %info );
4 use FS::part_export::http;
5 use Tie::IxHash;
6
7 @ISA = qw( FS::part_export::http );
8
9 tie my %options, 'Tie::IxHash', %FS::part_export::http::options;
10
11 $options{'insert_data'}->{'default'} = join("\n",
12   "action 'add'",
13   "username \$svc_x->username",
14   "password \$svc_x->_password",
15   "prismid \$cust_main->agent_custid ? \$cust_main->agent_custid : \$cust_main->custnum ",
16   "name \$cust_main->first.' '.\$cust_main->last",
17 );
18 $options{'delete_data'}->{'default'} = join("\n",
19   "action  'remove'",
20   "username \$svc_x->username",
21 );
22 $options{'replace_data'}->{'default'} = join("\n",
23   "action  'update'",
24   "username \$old->username",
25   "password \$new->_password",
26 );
27
28 %info = (
29   'svc'     => 'svc_acct',
30   'desc'    => 'Send an HTTP or HTTPS GET or POST request, for accounts.',
31   'options' => \%options,
32   'notes'   => <<'END'
33 Send an HTTP or HTTPS GET or POST to the specified URL on account addition,
34 modification and deletion.  For HTTPS support,
35 <a href="http://search.cpan.org/dist/Crypt-SSLeay">Crypt::SSLeay</a>
36 or <a href="http://search.cpan.org/dist/IO-Socket-SSL">IO::Socket::SSL</a>
37 is required.
38 END
39 );
40
41 1;