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