| 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::Resource::Orders; | ||
| 16 | |||
| 17 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 2 | ▶ | use base qw( Net::MyCommerce::API::Resource ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | =head1 NAME | ||
| 23 | |||
| 24 | Net::MyCommerce::API::Resource::Orders | ||
| 25 | |||
| 26 | =head1 VERSION | ||
| 27 | |||
| 28 | version 1.0.1 | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | 2 | our $VERSION = '1.0.1'; | |
| 33 | |||
| 34 | =head1 SCHEMA | ||
| 35 | |||
| 36 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/16-schemas-order | ||
| 37 | |||
| 38 | =head1 METHOD | ||
| 39 | |||
| 40 | =head2 new | ||
| 41 | |||
| 42 | Subclass Net::MyCommerce::API::Resource | ||
| 43 | |||
| 44 | =cut | ||
| 45 | |||
| 46 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 47 | 0 | my ($pkg, %args) = @_; | |
| 48 | 0 | return $pkg->SUPER::new( %args, scope=>'orders' ); | |
| 49 | } | ||
| 50 | |||
| 51 | =head2 get_order | ||
| 52 | |||
| 53 | Get an order | ||
| 54 | |||
| 55 | Examples: | ||
| 56 | |||
| 57 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/22-example-get-order | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | 0 | ▶ | sub get_order { |
|
Subroutine
get_order: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 62 | 0 | my ($self, %opts) = @_; | |
| 63 | 0 | $opts{path} = [ '/orders', $opts{order_id} ]; | |
| 64 | 0 | return $self->request(%opts); | |
| 65 | } | ||
| 66 | |||
| 67 | =head2 get_orders | ||
| 68 | |||
| 69 | Get orders | ||
| 70 | |||
| 71 | Filter options: | ||
| 72 | |||
| 73 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/12-parameters-order | ||
| 74 | |||
| 75 | Examples: | ||
| 76 | |||
| 77 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/27-example-get-orders-base | ||
| 78 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/24-example-get-orders-expand-and-fields | ||
| 79 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/25-example-get-orders-limit-and-offset | ||
| 80 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/23-example-get-orders-date-range | ||
| 81 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/26-example-get-orders-status | ||
| 82 | |||
| 83 | =cut | ||
| 84 | |||
| 85 | 0 | ▶ | sub get_orders { |
|
Subroutine
get_orders: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 86 | 0 | my ($self, %opts) = @_; | |
| 87 | 0 | $opts{path} = '/orders'; | |
| 88 | 0 | return $self->request(%opts); | |
| 89 | } | ||
| 90 | |||
| 91 | =head2 get_line_item | ||
| 92 | |||
| 93 | Get an order line item | ||
| 94 | |||
| 95 | Examples: | ||
| 96 | |||
| 97 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/22-example-get-order | ||
| 98 | |||
| 99 | =cut | ||
| 100 | |||
| 101 | 0 | ▶ | sub get_line_item { |
|
Subroutine
get_line_item: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 102 | 0 | my ($self, %opts) = @_; | |
| 103 | 0 | $opts{path} = [ '/orders', $opts{order_id}, 'lineitems', $opts{lineitem_id} ]; | |
| 104 | 0 | return $self->request(%opts); | |
| 105 | } | ||
| 106 | |||
| 107 | =head2 get_line_items | ||
| 108 | |||
| 109 | Get all line items in an order | ||
| 110 | |||
| 111 | Examples: | ||
| 112 | |||
| 113 | http://help.mycommerce.com/index.php/mycommerce-apis/order-resource/22-example-get-order | ||
| 114 | |||
| 115 | =cut | ||
| 116 | |||
| 117 | 0 | ▶ | sub get_line_items { |
|
Subroutine
get_line_items: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 118 | 0 | my ($self, %opts) = @_; | |
| 119 | 0 | $opts{path} = [ '/orders', $opts{order_id}, 'lineitems' ]; | |
| 120 | 0 | return $self->request(%opts); | |
| 121 | } | ||
| 122 | |||
| 123 | 2 | 1; | |