line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
32
|
use strict; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
160
|
|
2
|
7
|
|
|
7
|
|
33
|
use warnings; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
170
|
|
3
|
7
|
|
|
7
|
|
30
|
use MRO::Compat 'c3'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
328
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package WebService::Shippo::Rate; |
6
|
|
|
|
|
|
|
require WebService::Shippo::Shipment; |
7
|
7
|
|
|
|
|
1357
|
use base qw( |
8
|
|
|
|
|
|
|
WebService::Shippo::Resource |
9
|
|
|
|
|
|
|
WebService::Shippo::Fetch |
10
|
7
|
|
|
7
|
|
32
|
); |
|
7
|
|
|
|
|
12
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub api_resource () { 'rates' } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub collection_class () { 'WebService::Shippo::Rates' } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub item_class () { __PACKAGE__ } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub get_shipping_rates |
19
|
|
|
|
|
|
|
{ |
20
|
0
|
|
|
0
|
0
|
|
my ( $invocant, @params ) = @_; |
21
|
0
|
|
|
|
|
|
WebService::Shippo::Shipment->get_shipping_rates( @params ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
BEGIN { |
25
|
7
|
|
|
7
|
|
36
|
no warnings 'once'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
218
|
|
26
|
7
|
|
|
7
|
|
218
|
*Shippo::Rate:: = *WebService::Shippo::Rate::; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=encoding utf8 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
WebService::Shippo::Rate - Rate class |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 VERSION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
version 0.0.19 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Each valid Shipment object will automatically trigger the calculation |
46
|
|
|
|
|
|
|
of all available rates. Depending on the state of the shipment's address |
47
|
|
|
|
|
|
|
and parcel elements, there may be none, one or multiple rates. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
By default, the calculated rates will returned in two currencies: |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=over 2 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item * The C attribute will contain the rate expressed in the |
54
|
|
|
|
|
|
|
currency that is used in the country from which the parcel originates. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item * The C attribute will contain the rate expressed |
57
|
|
|
|
|
|
|
in the currency that is used in the country to which the parcel is being |
58
|
|
|
|
|
|
|
shipped. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=back |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
You can request rates expressed in a different currency. The full list |
63
|
|
|
|
|
|
|
of supported currencies, along with their codes, can be viewed on |
64
|
|
|
|
|
|
|
L. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Re-requesting the rates with a different currency code will |
67
|
|
|
|
|
|
|
re-queue the shipment, setting the Shipment object's C |
68
|
|
|
|
|
|
|
attribute to B; the converted currency rates will only be |
69
|
|
|
|
|
|
|
available once that attribute has been set to B. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Rates are created asynchronously. The response time depends exclusively |
72
|
|
|
|
|
|
|
on the carrier's server. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 API DOCUMENTATION |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
For more information about Rates, consult the Shippo API documentation: |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over 2 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * L |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 REPOSITORY |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=over 2 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * L |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * L |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=back |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Iain Campbell |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Iain Campbell. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
You may distribute this software under the terms of either the GNU General |
103
|
|
|
|
|
|
|
Public License or the Artistic License, as specified in the Perl README |
104
|
|
|
|
|
|
|
file. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |