import torrus 1.0.9
[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 %options, 'Tie::IxHash',
10   'method' => { label   =>'Method',
11                 type    =>'select',
12                 #options =>[qw(POST GET)],
13                 options =>[qw(POST)],
14                 default =>'POST' },
15   'url'    => { label   => 'URL', default => 'http://', },
16   'insert_data' => {
17     label   => 'Insert data',
18     type    => 'textarea',
19     default => join("\n",
20       "action 'add'",
21       "username \$svc_x->username",
22       "password \$svc_x->_password",
23       "prismid \$cust_main->agent_custid ? \$cust_main->agent_custid : \$cust_main->custnum ",
24       "name \$cust_main->first.' '.\$cust_main->last",
25     ),
26   },
27   'delete_data' => {
28     label   => 'Delete data',
29     type    => 'textarea',
30     default => join("\n",
31       "action  'remove'",
32       "username \$svc_x->username",
33     ),
34   },
35   'replace_data' => {
36     label   => 'Replace data',
37     type    => 'textarea',
38     default => join("\n",
39       "action  'update'",
40       "username \$old->username",
41       "password \$new->_password",
42     ),
43   },
44   'success_regexp' => {
45     label  => 'Success Regexp',
46     default => '',
47   },
48 ;
49
50 %info = (
51   'svc'     => 'svc_acct',
52   'desc'    => 'Send an HTTP or HTTPS GET or POST request, for accounts.',
53   'options' => \%options,
54   'notes'   => <<'END'
55 Send an HTTP or HTTPS GET or POST to the specified URL on account addition,
56 modification and deletion.  For HTTPS support,
57 <a href="http://search.cpan.org/dist/Crypt-SSLeay">Crypt::SSLeay</a>
58 or <a href="http://search.cpan.org/dist/IO-Socket-SSL">IO::Socket::SSL</a>
59 is required.
60 END
61 );
62
63 1;