import torrus 1.0.9
[freeside.git] / FS / FS / part_export / cust_http.pm
1 package FS::part_export::cust_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  'insert'",
21       "custnum \$cust_main->custnum",
22       "first   \$cust_main->first",
23       "last    \$cust_main->get('last')",
24       ( map "$_ \$cust_main->$_", qw( company address1 address2 city county state zip country daytime night fax  last ) ),
25       "email   \$cust_main->invoicing_list_emailonly_scalar",
26     ),
27   },
28   'delete_data' => {
29     label   => 'Delete data',
30     type    => 'textarea',
31     default => join("\n",
32       "action  'delete'",
33       "custnum \$cust_main->custnum",
34     ),
35   },
36   'replace_data' => {
37     label   => 'Replace data',
38     type    => 'textarea',
39     default => join("\n",
40       "action  'replace'",
41       "custnum \$new_cust_main->custnum",
42       "first   \$new_cust_main->first",
43       "last    \$new_cust_main->get('last')",
44       ( map "$_ \$cust_main->$_", qw( company address1 address2 city county state zip country daytime night fax  last ) ),
45       "email   \$new_cust_main->invoicing_list_emailonly_scalar",
46     ),
47   },
48   'success_regexp' => {
49     label  => 'Success Regexp',
50     default => '',
51   },
52 ;
53
54 %info = (
55   'svc'     => 'cust_main',
56   'desc'    => 'Send an HTTP or HTTPS GET or POST request, for customers.',
57   'options' => \%options,
58   'notes'   => <<'END'
59 Send an HTTP or HTTPS GET or POST to the specified URL on customer addition,
60 modification and deletion.  For HTTPS support,
61 <a href="http://search.cpan.org/dist/Crypt-SSLeay">Crypt::SSLeay</a>
62 or <a href="http://search.cpan.org/dist/IO-Socket-SSL">IO::Socket::SSL</a>
63 is required.
64 END
65 );
66
67 1;