Merge branch 'patch-1' of https://github.com/gjones2/Freeside
[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   'suspend_data' => {
45     label   => 'Suspend data',
46     type    => 'textarea',
47     default => join("\n",
48     ),
49   },
50   'unsuspend_data' => {
51     label   => 'Unsuspend data',
52     type    => 'textarea',
53     default => join("\n",
54     ),
55   },
56   'success_regexp' => {
57     label  => 'Success Regexp',
58     default => '',
59   },
60 ;
61
62 %info = (
63   'svc'     => 'svc_acct',
64   'desc'    => 'Send an HTTP or HTTPS GET or POST request, for accounts.',
65   'options' => \%options,
66   'no_machine' => 1,
67   'notes'   => <<'END'
68 Send an HTTP or HTTPS GET or POST to the specified URL on account addition,
69 modification and deletion.  For HTTPS support,
70 <a href="http://search.cpan.org/dist/Crypt-SSLeay">Crypt::SSLeay</a>
71 or <a href="http://search.cpan.org/dist/IO-Socket-SSL">IO::Socket::SSL</a>
72 is required.
73 END
74 );
75
76 1;