line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WholesaleSystem; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
BEGIN { |
4
|
1
|
|
|
1
|
|
38782
|
$Net::WholesaleSystem::VERSION = '0.01'; |
5
|
|
|
|
|
|
|
} |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: VentraIP Wholesale SSL API |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
10
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
11
|
1
|
|
|
1
|
|
6
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
75
|
|
12
|
1
|
|
|
1
|
|
486
|
use SOAP::Lite; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use vars qw/$errstr/; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my %product_id = ( |
16
|
|
|
|
|
|
|
'Trustwave Domain Validated SSL - 1 Year' => 55, |
17
|
|
|
|
|
|
|
'Trustwave Domain Validated SSL - 2 Year' => 56, |
18
|
|
|
|
|
|
|
'Trustwave Domain Validated SSL - 3 Year' => 57, |
19
|
|
|
|
|
|
|
'Trustwave Premium SSL - 1 year' => 58, |
20
|
|
|
|
|
|
|
'Trustwave Premium SSL - 2 year' => 59, |
21
|
|
|
|
|
|
|
'Trustwave Premium SSL - 3 year' => 60, |
22
|
|
|
|
|
|
|
'Trustwave Enterprise SSL - 1 Year' => 61, |
23
|
|
|
|
|
|
|
'Trustwave Enterprise SSL - 2 Year' => 62, |
24
|
|
|
|
|
|
|
'Trustwave Enterprise SSL - 3 Year' => 63, |
25
|
|
|
|
|
|
|
'Trustwave Premium Wildcard SSL - 1 Year' => 64, |
26
|
|
|
|
|
|
|
'Trustwave Premium Wildcard SSL - 2 Year' => 65, |
27
|
|
|
|
|
|
|
'Trustwave Premium Wildcard SSL - 3 Year' => 66, |
28
|
|
|
|
|
|
|
'Trustwave Premium EV SSL - 1 Year' => 67, |
29
|
|
|
|
|
|
|
'Trustwave Premium EV SSL - 2 Year' => 68 |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub new { |
33
|
|
|
|
|
|
|
my $class = shift; |
34
|
|
|
|
|
|
|
my $args = scalar @_ % 2 ? shift : {@_}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# validate |
37
|
|
|
|
|
|
|
$args->{resellerID} or croak 'resellerID is required'; |
38
|
|
|
|
|
|
|
$args->{apiKey} or croak 'apiKey is required'; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
if ( $args->{is_ote} ) { |
41
|
|
|
|
|
|
|
$args->{url} ||= 'https://api-ote.wholesalesystem.com.au/?wsdl'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
else { |
44
|
|
|
|
|
|
|
$args->{url} ||= 'https://api.wholesalesystem.com.au/?wsdl'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
SOAP::Trace->import('all') if $args->{debug}; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Init SOAP |
50
|
|
|
|
|
|
|
$SOAP::Constants::PREFIX_ENV = 'SOAP-ENV'; |
51
|
|
|
|
|
|
|
my $soap = SOAP::Lite |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
#->readable(1) |
54
|
|
|
|
|
|
|
->ns( '', 'ns1' )->ns( 'http://xml.apache.org/xml-soap', 'ns2' ) |
55
|
|
|
|
|
|
|
->proxy( $args->{url} ); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# $soap->outputxml('true'); # XML |
58
|
|
|
|
|
|
|
$soap->on_action( sub { qq("#$_[0]") } ); |
59
|
|
|
|
|
|
|
$args->{soap} = $soap; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
bless $args, $class; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub errstr { $errstr } |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _check_soap { |
67
|
|
|
|
|
|
|
my ($som) = @_; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
if ( $som->fault ) { |
70
|
|
|
|
|
|
|
$errstr = $som->faultstring; |
71
|
|
|
|
|
|
|
return; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
if ( $som->result and exists $som->result->{errorMessage} ) { |
75
|
|
|
|
|
|
|
$errstr = $som->result->{errorMessage}; |
76
|
|
|
|
|
|
|
return; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
return 1; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub balanceQuery { |
83
|
|
|
|
|
|
|
my ($self) = @_; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
86
|
|
|
|
|
|
|
my $method = SOAP::Data->name('balanceQuery')->prefix('ns1'); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# the XML elements order matters |
89
|
|
|
|
|
|
|
my $ele_resellerID = |
90
|
|
|
|
|
|
|
SOAP::Data->name('item') |
91
|
|
|
|
|
|
|
->type( |
92
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
93
|
|
|
|
|
|
|
my $ele_apiKey = |
94
|
|
|
|
|
|
|
SOAP::Data->name('item') |
95
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
my $som = $soap->call( |
98
|
|
|
|
|
|
|
$method, |
99
|
|
|
|
|
|
|
SOAP::Data->name( |
100
|
|
|
|
|
|
|
param0 => \SOAP::Data->value( $ele_resellerID, $ele_apiKey ) |
101
|
|
|
|
|
|
|
)->type('ns2:Map') |
102
|
|
|
|
|
|
|
); |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
_check_soap($som) or return; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
return $som->result->{balance}; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub purchaseSSLCertificate { |
110
|
|
|
|
|
|
|
my $self = shift; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
my $args = scalar @_ % 2 ? shift : {@_}; |
113
|
|
|
|
|
|
|
if ( exists $product_id{ lc $args->{product_id} } ) { |
114
|
|
|
|
|
|
|
$args->{product_id} = $product_id{ lc $args->{product_id} }; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
my $ele_resellerID = |
118
|
|
|
|
|
|
|
SOAP::Data->name('item') |
119
|
|
|
|
|
|
|
->type( |
120
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
121
|
|
|
|
|
|
|
my $ele_apiKey = |
122
|
|
|
|
|
|
|
SOAP::Data->name('item') |
123
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey ); |
126
|
|
|
|
|
|
|
foreach my $k ( |
127
|
|
|
|
|
|
|
qw/csr productID firstName lastName emailAddress address city state postCode country phone fax/ |
128
|
|
|
|
|
|
|
) |
129
|
|
|
|
|
|
|
{ |
130
|
|
|
|
|
|
|
push @args, |
131
|
|
|
|
|
|
|
SOAP::Data->name('item') |
132
|
|
|
|
|
|
|
->type( ordered_hash => [ key => $k, value => $args->{$k} ] ); |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
136
|
|
|
|
|
|
|
my $method = SOAP::Data->name('SSL_purchaseSSLCertificate')->prefix('ns1'); |
137
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
138
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
139
|
|
|
|
|
|
|
); |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
_check_soap($som) or return; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
return $som->result; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub renewSSLCertificate { |
147
|
|
|
|
|
|
|
my $self = shift; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
my $args = scalar @_ % 2 ? shift : {@_}; |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
my $ele_resellerID = |
152
|
|
|
|
|
|
|
SOAP::Data->name('item') |
153
|
|
|
|
|
|
|
->type( |
154
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
155
|
|
|
|
|
|
|
my $ele_apiKey = |
156
|
|
|
|
|
|
|
SOAP::Data->name('item') |
157
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey ); |
160
|
|
|
|
|
|
|
foreach my $k ( |
161
|
|
|
|
|
|
|
qw/certID firstName lastName emailAddress address city state postCode country phone fax/ |
162
|
|
|
|
|
|
|
) |
163
|
|
|
|
|
|
|
{ |
164
|
|
|
|
|
|
|
push @args, |
165
|
|
|
|
|
|
|
SOAP::Data->name('item') |
166
|
|
|
|
|
|
|
->type( ordered_hash => [ key => $k, value => $args->{$k} ] ); |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
170
|
|
|
|
|
|
|
my $method = SOAP::Data->name('SSL_renewSSLCertificate')->prefix('ns1'); |
171
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
172
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
173
|
|
|
|
|
|
|
); |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
_check_soap($som) or return; |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
return $som->result; |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub reissueCertificate { |
181
|
|
|
|
|
|
|
my ( $self, $certID, $newCSR ) = @_; |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
my $ele_resellerID = |
184
|
|
|
|
|
|
|
SOAP::Data->name('item') |
185
|
|
|
|
|
|
|
->type( |
186
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
187
|
|
|
|
|
|
|
my $ele_apiKey = |
188
|
|
|
|
|
|
|
SOAP::Data->name('item') |
189
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
190
|
|
|
|
|
|
|
my $ele_certID = |
191
|
|
|
|
|
|
|
SOAP::Data->name('item') |
192
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'certID', value => $certID ] ); |
193
|
|
|
|
|
|
|
my $ele_newCSR = |
194
|
|
|
|
|
|
|
SOAP::Data->name('item') |
195
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'newCSR', value => $newCSR ] ); |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey, $ele_certID, $ele_newCSR ); |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
200
|
|
|
|
|
|
|
my $method = SOAP::Data->name('SSL_reissueCertificate')->prefix('ns1'); |
201
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
202
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
203
|
|
|
|
|
|
|
); |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
_check_soap($som) or return; |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
return $som->result; |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub generateCSR { |
211
|
|
|
|
|
|
|
my $self = shift; |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
my $args = scalar @_ % 2 ? shift : {@_}; |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
my $ele_resellerID = |
216
|
|
|
|
|
|
|
SOAP::Data->name('item') |
217
|
|
|
|
|
|
|
->type( |
218
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
219
|
|
|
|
|
|
|
my $ele_apiKey = |
220
|
|
|
|
|
|
|
SOAP::Data->name('item') |
221
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey ); |
224
|
|
|
|
|
|
|
foreach my $k ( |
225
|
|
|
|
|
|
|
qw/numOfYears country state city organisation organisationUnit commonName emailAddress/ |
226
|
|
|
|
|
|
|
) |
227
|
|
|
|
|
|
|
{ |
228
|
|
|
|
|
|
|
push @args, |
229
|
|
|
|
|
|
|
SOAP::Data->name('item') |
230
|
|
|
|
|
|
|
->type( ordered_hash => [ key => $k, value => $args->{$k} ] ); |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
234
|
|
|
|
|
|
|
my $method = SOAP::Data->name('SSL_generateCSR')->prefix('ns1'); |
235
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
236
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
237
|
|
|
|
|
|
|
); |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
_check_soap($som) or return; |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
return $som->result; |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
sub decodeCSR { |
245
|
|
|
|
|
|
|
my ( $self, $csr ) = @_; |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
my $ele_resellerID = |
248
|
|
|
|
|
|
|
SOAP::Data->name('item') |
249
|
|
|
|
|
|
|
->type( |
250
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
251
|
|
|
|
|
|
|
my $ele_apiKey = |
252
|
|
|
|
|
|
|
SOAP::Data->name('item') |
253
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
254
|
|
|
|
|
|
|
my $ele_csr = |
255
|
|
|
|
|
|
|
SOAP::Data->name('item') |
256
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'csr', value => $csr ] ); |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey, $ele_csr ); |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
261
|
|
|
|
|
|
|
my $method = SOAP::Data->name('SSL_decodeCSR')->prefix('ns1'); |
262
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
263
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
264
|
|
|
|
|
|
|
); |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
_check_soap($som) or return; |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
return $som->result; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
sub getSSLCertificate { |
272
|
|
|
|
|
|
|
my ( $self, $certID ) = @_; |
273
|
|
|
|
|
|
|
$self->_actSSLCertificate( 'SSL_getSSLCertificate', $certID ); |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
sub getCertSimpleStatus { |
277
|
|
|
|
|
|
|
my ( $self, $certID ) = @_; |
278
|
|
|
|
|
|
|
$self->_actSSLCertificate( 'SSL_getCertSimpleStatus', $certID ); |
279
|
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
sub cancelSSLCertificate { |
282
|
|
|
|
|
|
|
my ( $self, $certID ) = @_; |
283
|
|
|
|
|
|
|
$self->_actSSLCertificate( 'SSL_cancelSSLCertificate', $certID ); |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub resendDVEmail { |
287
|
|
|
|
|
|
|
my ( $self, $certID ) = @_; |
288
|
|
|
|
|
|
|
$self->_actSSLCertificate( 'SSL_resendDVEmail', $certID ); |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
sub resendIssuedCertificateEmail { |
292
|
|
|
|
|
|
|
my ( $self, $certID ) = @_; |
293
|
|
|
|
|
|
|
$self->_actSSLCertificate( 'SSL_resendIssuedCertificateEmail', $certID ); |
294
|
|
|
|
|
|
|
} |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
sub _actSSLCertificate { |
297
|
|
|
|
|
|
|
my ( $self, $act, $certID ) = @_; |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
my $ele_resellerID = |
300
|
|
|
|
|
|
|
SOAP::Data->name('item') |
301
|
|
|
|
|
|
|
->type( |
302
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
303
|
|
|
|
|
|
|
my $ele_apiKey = |
304
|
|
|
|
|
|
|
SOAP::Data->name('item') |
305
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
306
|
|
|
|
|
|
|
my $ele_certID = |
307
|
|
|
|
|
|
|
SOAP::Data->name('item') |
308
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'certID', value => $certID ] ); |
309
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey, $ele_certID ); |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
312
|
|
|
|
|
|
|
my $method = SOAP::Data->name($act)->prefix('ns1'); |
313
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
314
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
315
|
|
|
|
|
|
|
); |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
_check_soap($som) or return; |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
return $som->result; |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
sub listAllCerts { |
323
|
|
|
|
|
|
|
my ($self) = @_; |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
326
|
|
|
|
|
|
|
my $method = SOAP::Data->name('SSL_listAllCerts')->prefix('ns1'); |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
# the XML elements order matters |
329
|
|
|
|
|
|
|
my $ele_resellerID = |
330
|
|
|
|
|
|
|
SOAP::Data->name('item') |
331
|
|
|
|
|
|
|
->type( |
332
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
333
|
|
|
|
|
|
|
my $ele_apiKey = |
334
|
|
|
|
|
|
|
SOAP::Data->name('item') |
335
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
my $som = $soap->call( |
338
|
|
|
|
|
|
|
$method, |
339
|
|
|
|
|
|
|
SOAP::Data->name( |
340
|
|
|
|
|
|
|
param0 => \SOAP::Data->value( $ele_resellerID, $ele_apiKey ) |
341
|
|
|
|
|
|
|
)->type('ns2:Map') |
342
|
|
|
|
|
|
|
); |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
_check_soap($som) or return; |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
return $som->result; |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
sub getDomainBeacon { |
350
|
|
|
|
|
|
|
my ( $self, $certID, $domainName ) = @_; |
351
|
|
|
|
|
|
|
$self->_actDomainBeacon( 'SSL_getDomainBeacon', $certID, $domainName ); |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
sub checkDomainBeacon { |
355
|
|
|
|
|
|
|
my ( $self, $certID, $domainName ) = @_; |
356
|
|
|
|
|
|
|
$self->_actDomainBeacon( 'SSL_checkDomainBeacon', $certID, $domainName ); |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
sub _actDomainBeacon { |
360
|
|
|
|
|
|
|
my ( $self, $act, $certID, $domainName ) = @_; |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
my $ele_resellerID = |
363
|
|
|
|
|
|
|
SOAP::Data->name('item') |
364
|
|
|
|
|
|
|
->type( |
365
|
|
|
|
|
|
|
ordered_hash => [ key => 'resellerID', value => $self->{resellerID} ] ); |
366
|
|
|
|
|
|
|
my $ele_apiKey = |
367
|
|
|
|
|
|
|
SOAP::Data->name('item') |
368
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'apiKey', value => $self->{apiKey} ] ); |
369
|
|
|
|
|
|
|
my $ele_certID = |
370
|
|
|
|
|
|
|
SOAP::Data->name('item') |
371
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'certID', value => $certID ] ); |
372
|
|
|
|
|
|
|
my $ele_domainName = |
373
|
|
|
|
|
|
|
SOAP::Data->name('item') |
374
|
|
|
|
|
|
|
->type( ordered_hash => [ key => 'domainName', value => $domainName ] ); |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
my @args = ( $ele_resellerID, $ele_apiKey, $ele_certID, $ele_domainName ); |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
my $soap = $self->{soap}; |
379
|
|
|
|
|
|
|
my $method = SOAP::Data->name($act)->prefix('ns1'); |
380
|
|
|
|
|
|
|
my $som = $soap->call( $method, |
381
|
|
|
|
|
|
|
SOAP::Data->name( param0 => \SOAP::Data->value(@args) )->type('ns2:Map') |
382
|
|
|
|
|
|
|
); |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
_check_soap($som) or return; |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
return $som->result; |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
1; |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=pod |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
=head1 NAME |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
Net::WholesaleSystem - VentraIP Wholesale SSL API |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=head1 VERSION |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
version 0.01 |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=head1 SYNOPSIS |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
use Net::WholesaleSystem; |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
my $WholesaleSystem = Net::WholesaleSystem->new( |
406
|
|
|
|
|
|
|
resellerID => $resellerID, |
407
|
|
|
|
|
|
|
apiKey => $apiKey |
408
|
|
|
|
|
|
|
); |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
# get balance |
411
|
|
|
|
|
|
|
my $balance = $WholesaleSystem->balanceQuery or die $WholesaleSystem->errstr; |
412
|
|
|
|
|
|
|
print $balance; |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=head2 DESCRIPTION |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
VentraIP Wholesale SSL API |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
=head3 new |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
my $WholesaleSystem = Net::WholesaleSystem->new( |
421
|
|
|
|
|
|
|
resellerID => $resellerID, |
422
|
|
|
|
|
|
|
apiKey => $apiKey |
423
|
|
|
|
|
|
|
); |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
=over 4 |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=item * C (required) |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=item * C (required) |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
resellerID & apiKey, provided by VentraIP Wholesale |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=item * C |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
if C is set to 1, we use https://api-ote.wholesalesystem.com.au/?wsdl instead of https://api.wholesalesystem.com.au/?wsdl |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=item * C |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
enable SOAP::Trace->import('all') |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
=back |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=head3 balanceQuery |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
my $balance = $WholesaleSystem->balanceQuery or die $WholesaleSystem->errstr; |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
Account Balance Query allows you to obtain the account balance. |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
=head3 getSSLCertificate |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
my $cert = $WholesaleSystem->getSSLCertificate($certID); |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
to obtain information for a SSL certificate you?ve recently purchased |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
=head3 getCertSimpleStatus |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
my $cert = $WholesaleSystem->getCertSimpleStatus($certID); |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=head3 decodeCSR |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
my $data = $WholesaleSystem->decodeCSR($csr); |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
decode the certificate signing request (CSR) you have provided to ensure all the details are correct before purchasing the SSL. |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=head3 generateCSR |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
my $data = $WholesaleSystem->generateCSR( |
468
|
|
|
|
|
|
|
'numOfYears' => '3', |
469
|
|
|
|
|
|
|
'country' => 'AU', |
470
|
|
|
|
|
|
|
'state' => 'VIC', |
471
|
|
|
|
|
|
|
'city' => 'Melbourne', |
472
|
|
|
|
|
|
|
'organisation' => 'VentraIP', |
473
|
|
|
|
|
|
|
'organisationUnit' => 'Systems Admin', |
474
|
|
|
|
|
|
|
'commonName' => 'forums.ventraip.com.au', |
475
|
|
|
|
|
|
|
'emailAddress' => 'webmaster@ventraip.com.au' |
476
|
|
|
|
|
|
|
); |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
generate the user a Private Key of 2048 bits in size, a Self Signed Certificate and a CSR request. |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
=head3 purchaseSSLCertificate |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
my $cert = $WholesaleSystem->purchaseSSLCertificate( |
483
|
|
|
|
|
|
|
csr => $csr, |
484
|
|
|
|
|
|
|
productID => 55, |
485
|
|
|
|
|
|
|
firstName => 'John', |
486
|
|
|
|
|
|
|
lastName => 'Doe', |
487
|
|
|
|
|
|
|
emailAddress => 'john@doe.com', |
488
|
|
|
|
|
|
|
address => 'PO Box 119', |
489
|
|
|
|
|
|
|
city => 'Beaconsfield', |
490
|
|
|
|
|
|
|
state => 'VIC', |
491
|
|
|
|
|
|
|
postCode => '3807', |
492
|
|
|
|
|
|
|
country => 'AU', |
493
|
|
|
|
|
|
|
phone => '+61.390245343', |
494
|
|
|
|
|
|
|
fax => '+61.380806481', |
495
|
|
|
|
|
|
|
) or die $WholesaleSystem->errstr; |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
purchase an SSL certificate |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=head3 reissueCertificate |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
my $output = $WholesaleSystem->reissueCertificate($certID, $newCSR); |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
re-issue the SSL certificate using a new certificate signing request (CSR) |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
=head3 cancelSSLCertificate |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
my $output = $WholesaleSystem->cancelSSLCertificate($certID); |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
cancel an SSL certificate that has not been processed (eg. still pending approval). |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
=head3 renewSSLCertificate |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
my $output = $WholesaleSystem->renewSSLCertificate( |
514
|
|
|
|
|
|
|
certID => $certID, |
515
|
|
|
|
|
|
|
firstName => 'John', |
516
|
|
|
|
|
|
|
lastName => 'Doe', |
517
|
|
|
|
|
|
|
emailAddress => 'john@doe.com', |
518
|
|
|
|
|
|
|
address => 'PO Box 119', |
519
|
|
|
|
|
|
|
city => 'Beaconsfield', |
520
|
|
|
|
|
|
|
state => 'VIC', |
521
|
|
|
|
|
|
|
postCode => '3807', |
522
|
|
|
|
|
|
|
country => 'AU', |
523
|
|
|
|
|
|
|
phone => '+61.390245343', |
524
|
|
|
|
|
|
|
fax => '+61.380806481', |
525
|
|
|
|
|
|
|
) or die $WholesaleSystem->errstr; |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
renew an SSL certificate |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
=head3 resendDVEmail |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
my $output = $WholesaleSystem->resendDVEmail($certID); |
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
resend the approval email for an SSL certificate |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
=head3 resendIssuedCertificateEmail |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
my $output = $WholesaleSystem->resendIssuedCertificateEmail($certID); |
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
resend the original completed certificate email to the customer. This is helpful should |
540
|
|
|
|
|
|
|
your customer loose the details of their SSL and you need to provide the information again. |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
=head3 listAllCerts |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
my @certs = $WholesaleSystem->listAllCerts; |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
obtain a list of all SSL certificates related to your account |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
=head3 getDomainBeacon |
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
my $output = $WholesaleSystem->getDomainBeacon($certID, $domain); |
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
obtain a list of all SSL certificates related to your account |
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
The domain beacon is used for verification of premium SSL certificates to prove ownership of the domain and ensure the |
555
|
|
|
|
|
|
|
requester has access to the domain in question. The domain beacon file must be saved as the filename returned from the |
556
|
|
|
|
|
|
|
API request and the 'beacon' saved in the file. |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
=head3 checkDomainBeacon |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
my $output = $WholesaleSystem->checkDomainBeacon($certID, $domain); |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
Upon requesting the domain beacon from 'SSL_getDomainBeacon' this function will then process the SSL for validation against |
563
|
|
|
|
|
|
|
the certificate ID supplied. |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
=head3 Certificate Product IDs |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
55 Trustwave Domain Validated SSL - 1 Year |
568
|
|
|
|
|
|
|
56 Trustwave Domain Validated SSL - 2 Year |
569
|
|
|
|
|
|
|
57 Trustwave Domain Validated SSL - 3 Year |
570
|
|
|
|
|
|
|
58 Trustwave Premium SSL - 1 year |
571
|
|
|
|
|
|
|
59 Trustwave Premium SSL - 2 year |
572
|
|
|
|
|
|
|
60 Trustwave Premium SSL - 3 year |
573
|
|
|
|
|
|
|
61 Trustwave Enterprise SSL - 1 Year |
574
|
|
|
|
|
|
|
62 Trustwave Enterprise SSL - 2 Year |
575
|
|
|
|
|
|
|
63 Trustwave Enterprise SSL - 3 Year |
576
|
|
|
|
|
|
|
64 Trustwave Premium Wildcard SSL - 1 Year |
577
|
|
|
|
|
|
|
65 Trustwave Premium Wildcard SSL - 2 Year |
578
|
|
|
|
|
|
|
66 Trustwave Premium Wildcard SSL - 3 Year |
579
|
|
|
|
|
|
|
67 Trustwave Premium EV SSL - 1 Year |
580
|
|
|
|
|
|
|
68 Trustwave Premium EV SSL - 2 Year |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
=head1 AUTHOR |
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
VentraIP Wholesale |
585
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
This software is copyright (c) 2011 by VentraIP Wholesale. |
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
591
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
=cut |
594
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
__END__ |