line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
=encoding utf-8 |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Webservice::OVH::Me::Order |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Webservice::OVH; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $ovh = Webservice::OVH->new_from_json("credentials.json"); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $order = $ovh->me->order(1234); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $order->pay_with_registered_payment_mean('fiedelityAccount') |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Module provides possibility to access specified orders and payment options. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use strict; |
27
|
36
|
|
|
36
|
|
228
|
use warnings; |
|
36
|
|
|
|
|
886
|
|
|
36
|
|
|
|
|
878
|
|
28
|
36
|
|
|
36
|
|
173
|
use Carp qw{ carp croak }; |
|
36
|
|
|
|
|
76
|
|
|
36
|
|
|
|
|
1258
|
|
29
|
36
|
|
|
36
|
|
174
|
|
|
36
|
|
|
|
|
728
|
|
|
36
|
|
|
|
|
2255
|
|
30
|
|
|
|
|
|
|
our $VERSION = 0.47; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use Webservice::OVH::Me::Order::Detail; |
33
|
36
|
|
|
36
|
|
13743
|
|
|
36
|
|
|
|
|
84
|
|
|
36
|
|
|
|
|
46388
|
|
34
|
|
|
|
|
|
|
=head2 _new |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Internal Method to create the Order object. |
37
|
|
|
|
|
|
|
This method is not ment to be called directly. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item * Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $order_id - api id |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item * Return: L<Webservice::OVH::Me::Order> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item * Synopsis: Webservice::OVH::Me::Order->_new($ovh_api_wrapper, $order_id, $module); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=back |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my ( $class, %params ) = @_; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
0
|
|
|
die "Missing module" unless $params{module}; |
55
|
|
|
|
|
|
|
die "Missing wrapper" unless $params{wrapper}; |
56
|
0
|
0
|
|
|
|
|
die "Missing id" unless $params{id}; |
57
|
0
|
0
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
my $module = $params{module}; |
59
|
|
|
|
|
|
|
my $api_wrapper = $params{wrapper}; |
60
|
0
|
|
|
|
|
|
my $order_id = $params{id}; |
61
|
0
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $response = $api_wrapper->rawCall( method => 'get', path => "/me/order/$order_id", noSignature => 0 ); |
63
|
|
|
|
|
|
|
croak $response->error if $response->error; |
64
|
0
|
|
|
|
|
|
|
65
|
0
|
0
|
|
|
|
|
my $porperties = $response->content; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my $self = bless { _module => $module, _api_wrapper => $api_wrapper, _id => $order_id, _properties => $porperties, _details => {} }, $class; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
return $self; |
70
|
|
|
|
|
|
|
} |
71
|
0
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 id |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Returns the api id. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=over |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * Return: VALUE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * Synopsis: my $id = $order->id; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
my ($self) = @_; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
return $self->{_id}; |
90
|
0
|
|
|
0
|
1
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
=head2 properties |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Retrieves properties. |
95
|
|
|
|
|
|
|
This method updates the intern property variable. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=over |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item * Return: HASH |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * Synopsis: my $properties = $order->properties; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my ($self) = @_; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
111
|
|
|
|
|
|
|
my $order_id = $self->id; |
112
|
0
|
|
|
0
|
1
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id", noSignature => 0 ); |
113
|
|
|
|
|
|
|
croak $response->error if $response->error; |
114
|
0
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
$self->{_properties} = $response->content; |
116
|
0
|
|
|
|
|
|
return $self->{_properties}; |
117
|
0
|
0
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
=head2 date |
120
|
0
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Exposed property value. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=over |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item * Return: DateTime |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * Synopsis: my $date = $order->is_blocked; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=back |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=cut |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
my ($self) = @_; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
my $str_datetime = $self->{_properties}->{date}; |
137
|
|
|
|
|
|
|
my $datetime = Webservice::OVH::Helper->parse_datetime($str_datetime); |
138
|
|
|
|
|
|
|
return $datetime; |
139
|
0
|
|
|
0
|
1
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
=head2 expiration_date |
142
|
0
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
Exposed property value. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=over |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * Return: DateTime |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * Synopsis: my $expiration_date = $order->expiration_date; |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=back |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=cut |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
my ($self) = @_; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
my $str_datetime = $self->{_properties}->{expirationDate}; |
159
|
|
|
|
|
|
|
my $datetime = Webservice::OVH::Helper->parse_datetime($str_datetime); |
160
|
|
|
|
|
|
|
return $datetime; |
161
|
|
|
|
|
|
|
} |
162
|
0
|
|
|
0
|
1
|
|
|
163
|
|
|
|
|
|
|
=head2 password |
164
|
0
|
|
|
|
|
|
|
165
|
0
|
|
|
|
|
|
Exposed property value. |
166
|
0
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=over |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item * Return: VALUE |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item * Synopsis: my $password = $order->password; |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=back |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=cut |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
my ($self) = @_; |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
return $self->{_properties}->{password}; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head2 pdf_url |
184
|
|
|
|
|
|
|
|
185
|
0
|
|
|
0
|
1
|
|
Exposed property value. |
186
|
|
|
|
|
|
|
|
187
|
0
|
|
|
|
|
|
=over |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=item * Return: VALUE |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item * Synopsis: my $pdf_url = $order->pdf_url; |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=back |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=cut |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
my ($self) = @_; |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
return $self->{_properties}->{pdfUrl}; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head2 price_without_tax |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
Exposed property value. |
206
|
0
|
|
|
0
|
1
|
|
|
207
|
|
|
|
|
|
|
=over |
208
|
0
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=item * Return: VALUE |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=item * Synopsis: my $price_without_tax = $order->price_without_tax; |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=back |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=cut |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
my ($self) = @_; |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
return $self->{_properties}->{priceWithoutTax}; |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=head2 price_with_tax |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
Exposed property value. |
226
|
|
|
|
|
|
|
|
227
|
0
|
|
|
0
|
1
|
|
=over |
228
|
|
|
|
|
|
|
|
229
|
0
|
|
|
|
|
|
=item * Return: VALUE |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=item * Synopsis: my $price_with_tax = $order->price_with_tax; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=back |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
my ($self) = @_; |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
return $self->{_properties}->{priceWithTax}; |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head2 tax |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
Exposed property value. |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=over |
248
|
0
|
|
|
0
|
1
|
|
|
249
|
|
|
|
|
|
|
=item * Return: VALUE |
250
|
0
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=item * Synopsis: my $tax = $order->tax; |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=back |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=cut |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
my ($self) = @_; |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
return $self->{_properties}->{tax}; |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=head2 url |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
Exposed property value. |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=over |
268
|
|
|
|
|
|
|
|
269
|
0
|
|
|
0
|
1
|
|
=item * Return: VALUE |
270
|
|
|
|
|
|
|
|
271
|
0
|
|
|
|
|
|
=item * Synopsis: my $url = $order->url; |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=back |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=cut |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
my ($self) = @_; |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
return $self->{_properties}->{url}; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=head2 associated_object |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
Exposed property value. |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=over |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=item * Return: HASH |
290
|
0
|
|
|
0
|
1
|
|
|
291
|
|
|
|
|
|
|
=item * Synopsis: my $associated_object = $order->associated_object; |
292
|
0
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=back |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
=cut |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
my ($self) = @_; |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
301
|
|
|
|
|
|
|
my $order_id = $self->id; |
302
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/associatedObject", noSignature => 0 ); |
303
|
|
|
|
|
|
|
croak $response->error if $response->error; |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
return $response->content; |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=head2 available_registered_payment_mean |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
Returns an Array of available payment means. |
311
|
0
|
|
|
0
|
1
|
|
|
312
|
|
|
|
|
|
|
=over |
313
|
0
|
|
|
|
|
|
|
314
|
0
|
|
|
|
|
|
=item * Return: L<ARRAY> |
315
|
0
|
|
|
|
|
|
|
316
|
0
|
0
|
|
|
|
|
=item * Synopsis: my $available_registered_payment_mean = $order->available_registered_payment_mean; |
317
|
|
|
|
|
|
|
|
318
|
0
|
|
|
|
|
|
=back |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=cut |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
my ($self) = @_; |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
326
|
|
|
|
|
|
|
my $order_id = $self->id; |
327
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/availableRegisteredPaymentMean", noSignature => 0 ); |
328
|
|
|
|
|
|
|
croak $response->error if $response->error; |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
return $response->content; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
=head2 bill |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
Returns associated bill. |
336
|
|
|
|
|
|
|
|
337
|
0
|
|
|
0
|
1
|
|
=over |
338
|
|
|
|
|
|
|
|
339
|
0
|
|
|
|
|
|
=item * Return: L<Webservice::Me::Bill> |
340
|
0
|
|
|
|
|
|
|
341
|
0
|
|
|
|
|
|
=item * Synopsis: my $bill = $order->bill; |
342
|
0
|
0
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=back |
344
|
0
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=cut |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
my ($self) = @_; |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
351
|
|
|
|
|
|
|
my $order_id = $self->id; |
352
|
|
|
|
|
|
|
my $module = $self->{_module}; |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
#my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/bill", noSignature => 0 ); |
355
|
|
|
|
|
|
|
#croak $response->error if $response->error; |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
my $object = $self->associated_object; |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
if ( $object->{type} eq 'Bill' ) { |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
my $bill = $module->me->bill( $object->{id} ); |
362
|
|
|
|
|
|
|
|
363
|
0
|
|
|
0
|
1
|
|
return $bill; |
364
|
|
|
|
|
|
|
} else { |
365
|
0
|
|
|
|
|
|
|
366
|
0
|
|
|
|
|
|
return undef; |
367
|
0
|
|
|
|
|
|
} |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=head2 details |
371
|
|
|
|
|
|
|
|
372
|
0
|
|
|
|
|
|
Returns an Array of detail Objects. |
373
|
|
|
|
|
|
|
|
374
|
0
|
0
|
|
|
|
|
=over |
375
|
|
|
|
|
|
|
|
376
|
0
|
|
|
|
|
|
=item * Return: L<ARRAY> |
377
|
|
|
|
|
|
|
|
378
|
0
|
|
|
|
|
|
=item * Synopsis: my $details = $order->details; |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=back |
381
|
0
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=cut |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
my ($self) = @_; |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
388
|
|
|
|
|
|
|
my $order_id = $self->id; |
389
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/details", noSignature => 0 ); |
390
|
|
|
|
|
|
|
croak $response->error if $response->error; |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
my $detail_ids = $response->content; |
393
|
|
|
|
|
|
|
my $details = []; |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
foreach my $detail_id (@$detail_ids) { |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
my $detail = $self->{_details}{$detail_id} = $self->{_details}{$detail_id} || Webservice::OVH::Me::Order::Detail->_new( wrapper => $api, order => $self, id => $detail_id, module => $self->{_module} ); |
398
|
|
|
|
|
|
|
push @$details, $detail; |
399
|
|
|
|
|
|
|
} |
400
|
|
|
|
|
|
|
|
401
|
0
|
|
|
0
|
1
|
|
return $details; |
402
|
|
|
|
|
|
|
} |
403
|
0
|
|
|
|
|
|
|
404
|
0
|
|
|
|
|
|
=head2 details |
405
|
0
|
|
|
|
|
|
|
406
|
0
|
0
|
|
|
|
|
Gets a specified detail Object by id. |
407
|
|
|
|
|
|
|
|
408
|
0
|
|
|
|
|
|
=over |
409
|
0
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=item * Return: L<Webservice::Me::Order::Detail> |
411
|
0
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
=item * Synopsis: my $details = $order->details; |
413
|
0
|
|
0
|
|
|
|
|
414
|
0
|
|
|
|
|
|
=back |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=cut |
417
|
0
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
my ( $self, $detail_id ) = @_; |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
422
|
|
|
|
|
|
|
my $detail = $self->{_details}{$detail_id} = $self->{_details}{$detail_id} || Webservice::OVH::Me::Order::Detail->_new( wrapper => $api, order => $self, id => $detail_id, module => $self->{_module} ); |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
return $detail; |
425
|
|
|
|
|
|
|
} |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=head2 payment |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
Gets details about payment. |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
=over |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=item * Return: VALUE |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
=item * Synopsis: my $payment = $order->payment; |
436
|
0
|
|
|
0
|
0
|
|
|
437
|
|
|
|
|
|
|
=back |
438
|
0
|
|
|
|
|
|
|
439
|
0
|
|
0
|
|
|
|
=cut |
440
|
|
|
|
|
|
|
|
441
|
0
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
my ($self) = @_; |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
445
|
|
|
|
|
|
|
my $order_id = $self->id; |
446
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/payment", noSignature => 0 ); |
447
|
|
|
|
|
|
|
croak $response->error if $response->error; |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
return $response->content; |
450
|
|
|
|
|
|
|
} |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=head2 payment_means |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
Gets details about payment_means. |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=over |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
=item * Return: VALUE |
459
|
|
|
|
|
|
|
|
460
|
0
|
|
|
0
|
1
|
|
=item * Synopsis: my $payment_means = $order->payment_means; |
461
|
|
|
|
|
|
|
|
462
|
0
|
|
|
|
|
|
=back |
463
|
0
|
|
|
|
|
|
|
464
|
0
|
|
|
|
|
|
=cut |
465
|
0
|
0
|
|
|
|
|
|
466
|
|
|
|
|
|
|
|
467
|
0
|
|
|
|
|
|
my ($self) = @_; |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
470
|
|
|
|
|
|
|
my $order_id = $self->id; |
471
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/paymentMeans", noSignature => 0 ); |
472
|
|
|
|
|
|
|
croak $response->error if $response->error; |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
return $response->content; |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
=head2 pay_with_registered_payment_mean |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
Pays the order. |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
=over |
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
=item * Parameter: $payment_mean - payment mean |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
=item * Synopsis: $order->pay_with_registered_payment_mean; |
486
|
0
|
|
|
0
|
1
|
|
|
487
|
|
|
|
|
|
|
=back |
488
|
0
|
|
|
|
|
|
|
489
|
0
|
|
|
|
|
|
=cut |
490
|
0
|
|
|
|
|
|
|
491
|
0
|
0
|
|
|
|
|
|
492
|
|
|
|
|
|
|
my ( $self, $payment_mean ) = @_; |
493
|
0
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
495
|
|
|
|
|
|
|
my $order_id = $self->id; |
496
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'post', path => "/me/order/$order_id/payWithRegisteredPaymentMean", body => { paymentMean => $payment_mean }, noSignature => 0 ); |
497
|
|
|
|
|
|
|
croak $response->error if $response->error; |
498
|
|
|
|
|
|
|
} |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
=head2 status |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
Status of the order. |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
=over |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
=item * Return: VALUE |
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
=item * Synopsis: my $status = $order->status; |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
=back |
511
|
|
|
|
|
|
|
|
512
|
0
|
|
|
0
|
1
|
|
=cut |
513
|
|
|
|
|
|
|
|
514
|
0
|
|
|
|
|
|
|
515
|
0
|
|
|
|
|
|
my ($self) = @_; |
516
|
0
|
|
|
|
|
|
|
517
|
0
|
0
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
518
|
|
|
|
|
|
|
my $order_id = $self->id; |
519
|
|
|
|
|
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/status", noSignature => 0 ); |
520
|
|
|
|
|
|
|
croak $response->error if $response->error; |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
return $response->content; |
523
|
|
|
|
|
|
|
} |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
1; |