temporarily disabling torrus source build
[freeside.git] / FS / FS / part_export / broadband_http.pm
1 package FS::part_export::broadband_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   'ssl_no_verify' => { label => 'Skip SSL certificate validation',
17                        type  => 'checkbox',
18                      },
19   'insert_data' => {
20     label   => 'Insert data',
21     type    => 'textarea',
22     default => join("\n",
23       "action 'add'",
24       "address \$svc_x->ip_addr",
25       "name \$cust_main->first.' '.\$cust_main->last",
26     ),
27   },
28   'delete_data' => {
29     label   => 'Delete data',
30     type    => 'textarea',
31     default => join("\n",
32       "action  'remove'",
33       "address \$svc_x->ip_addr",
34     ),
35   },
36   'replace_data' => {
37     label   => 'Replace data',
38     type    => 'textarea',
39     default => '',
40   },
41   'suspend_data' => {
42     label   => 'Suspend data',
43     type    => 'textarea',
44     default => join("\n",
45     ),
46   },
47   'unsuspend_data' => {
48     label   => 'Unsuspend data',
49     type    => 'textarea',
50     default => join("\n",
51     ),
52   },
53   'success_regexp' => {
54     label   => 'Success Regexp',
55     default => '',
56   },
57 ;
58
59 %info = (
60   'svc'     => 'svc_broadband',
61   'desc'    => 'Send an HTTP or HTTPS GET or POST request, for accounts.',
62   'options' => \%options,
63   'no_machine' => 1,
64   'notes'   => <<'END'
65 <p>Send an HTTP or HTTPS GET or POST to the specified URL on account addition,
66 modification and deletion.  For HTTPS support,
67 <a href="http://search.cpan.org/dist/Crypt-SSLeay">Crypt::SSLeay</a>
68 or <a href="http://search.cpan.org/dist/IO-Socket-SSL">IO::Socket::SSL</a>
69 is required.</p>
70 <p>Each "Data" option takes a list of <i>name value</i> pairs on successive 
71 lines.
72 <ul><li><i>name</i> is an unquoted, literal string without whitespace.</li>
73 <li><i>value</i> is a Perl expression that will be evaluated.  If it's a 
74 literal string, it must be quoted.  This expression has access to the
75 svc_broadband object as '$svc_x' (or '$new' and '$old' in "Replace Data") 
76 and the customer record as '$cust_main'.</li></ul>
77 If "Success Regexp" is specified, the response from the server will be
78 tested against it to determine if the export succeeded.</p>
79 END
80 );
81
82 1;