line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright 2013 Digital River, Inc. |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
4
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
5
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
10
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
11
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
13
|
|
|
|
|
|
|
# limitations under the License. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Net::MyCommerce::API; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
31162
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
18
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
19
|
1
|
|
|
1
|
|
588
|
use Net::MyCommerce::API::Resource; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
20
|
1
|
|
|
1
|
|
521
|
use Net::MyCommerce::API::Resource::Carts; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
21
|
1
|
|
|
1
|
|
560
|
use Net::MyCommerce::API::Resource::Orders; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
22
|
1
|
|
|
1
|
|
645
|
use Net::MyCommerce::API::Resource::PAR; |
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
20
|
|
23
|
1
|
|
|
1
|
|
498
|
use Net::MyCommerce::API::Resource::Products; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
24
|
1
|
|
|
1
|
|
499
|
use Net::MyCommerce::API::Resource::Vendors; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
224
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Net::MyCommerce::API |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
REST API to Digital River's MyCommerce Platform |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DOCUMENTATION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
http://help.mycommerce.com/mycommerce-apis |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 VERSION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
version 1.0.4 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our $VERSION = '1.0.4'; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 METHODS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 new |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Entry point to various Net MyCommerce API resources |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $api = Net::MyCommerce::API->new(); |
55
|
|
|
|
|
|
|
my $cart_resource = $api->carts( credentials => { id=> $id, secret => $secret } ); |
56
|
|
|
|
|
|
|
my ($error, $result) = $cart_resource->create_cart( $options ); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub new { |
61
|
0
|
|
|
0
|
1
|
|
my $pkg = shift; |
62
|
0
|
|
|
|
|
|
return bless {}, $pkg; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 carts (%args) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Return a new carts-scope API resource |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub carts { |
72
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
73
|
0
|
|
|
|
|
|
return Net::MyCommerce::API::Resource::Carts->new(%args); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 orders (%args) |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Return a new orders-scope API resource |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub orders { |
83
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
84
|
0
|
|
|
|
|
|
return Net::MyCommerce::API::Resource::Orders->new(%args); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 par (%args) |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Return a new payments-scope API resource |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub par { |
94
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
95
|
0
|
|
|
|
|
|
return Net::MyCommerce::API::Resource::PAR->new(%args); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 products (%args) |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Return a new products-scope API resource |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub products { |
105
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
106
|
0
|
|
|
|
|
|
return Net::MyCommerce::API::Resource::Products->new(%args); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 vendors ( %args) |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Return a new vendors-scope API resource |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub vendors { |
116
|
0
|
|
|
0
|
1
|
|
my ($self, %args) = @_; |
117
|
0
|
|
|
|
|
|
return Net::MyCommerce::API::Resource::Vendors->new(%args); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
1; |