default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / FS / FS / part_export / hardware_http.pm
1 package FS::part_export::hardware_http;
2 use base qw( FS::part_export::http );
3
4 use Tie::IxHash;
5
6 tie our %options, 'Tie::IxHash',
7   'method' => { label   =>'Method',
8                 type    =>'select',
9                 #options =>[qw(POST GET)],
10                 options =>[qw(POST)],
11                 default =>'POST' },
12   'url'    => { label   => 'URL', default => 'http://', },
13   'ssl_no_verify' => { label => 'Skip SSL certificate validation',
14                        type  => 'checkbox',
15                      },
16   'insert_data' => {
17     label   => 'Insert data',
18     type    => 'textarea',
19     default => join("\n",
20     ),
21   },
22   'delete_data' => {
23     label   => 'Delete data',
24     type    => 'textarea',
25     default => join("\n",
26     ),
27   },
28   'replace_data' => {
29     label   => 'Replace data',
30     type    => 'textarea',
31     default => join("\n",
32     ),
33   },
34   'suspend_data' => {
35     label   => 'Suspend data',
36     type    => 'textarea',
37     default => join("\n",
38     ),
39   },
40   'unsuspend_data' => {
41     label   => 'Unsuspend data',
42     type    => 'textarea',
43     default => join("\n",
44     ),
45   },
46   'success_regexp' => {
47     label  => 'Success Regexp',
48     default => '',
49   },
50 ;
51
52 %info = (
53   'svc'     => 'svc_hardware',
54   'desc'    => 'Send an HTTP or HTTPS GET or POST request, for hardware services.',
55   'options' => \%options,
56   'no_machine' => 1,
57   'notes'   => <<'END'
58 Send an HTTP or HTTPS GET or POST to the specified URL on account addition,
59 modification and deletion.
60 <p>Each "Data" option takes a list of <i>name value</i> pairs on successive 
61 lines.
62 <ul><li><i>name</i> is an unquoted, literal string without whitespace.</li>
63 <li><i>value</i> is a Perl expression that will be evaluated.  If it's a 
64 literal string, it must be quoted.  This expression has access to the
65 svc_hardware object as '$svc_x' (or '$new' and '$old' in "Replace Data") 
66 and the customer record as '$cust_main'.</li></ul>
67 If "Success Regexp" is specified, the response from the server will be
68 tested against it to determine if the export succeeded.</p>
69 END
70 );
71
72 1;
73