File Coverage

blib/lib/Business/CyberSource/RequestPart/Item.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Business::CyberSource::RequestPart::Item;
2 2     2   1635 use strict;
  2         4  
  2         69  
3 2     2   8 use warnings;
  2         3  
  2         70  
4 2     2   871 use namespace::autoclean;
  2         14243  
  2         8  
5              
6             our $VERSION = '0.010008'; # VERSION
7              
8 2     2   795 use Moose;
  2         229659  
  2         14  
9             extends 'Business::CyberSource::MessagePart';
10             with 'MooseX::RemoteHelper::CompositeSerialization';
11              
12 2     2   11603 use MooseX::Types::Common::Numeric qw( PositiveOrZeroNum PositiveOrZeroInt );
  2         143916  
  2         13  
13 2     2   4597 use MooseX::Types::Common::String qw( NonEmptySimpleStr );
  2         132876  
  2         12  
14              
15             has quantity => (
16             isa => PositiveOrZeroInt,
17             remote_name => 'quantity',
18             is => 'ro',
19             lazy => 1,
20             default => sub { 1 },
21             );
22              
23             has unit_price => (
24             isa => PositiveOrZeroNum,
25             remote_name => 'unitPrice',
26             is => 'ro',
27             required => 1,
28             );
29              
30             has product_code => (
31             isa => NonEmptySimpleStr,
32             remote_name => 'productCode',
33             traits => ['SetOnce'],
34             is => 'rw',
35             );
36              
37             has product_name => (
38             isa => NonEmptySimpleStr,
39             remote_name => 'productName',
40             traits => ['SetOnce'],
41             is => 'rw',
42             );
43              
44             has product_sku => (
45             isa => NonEmptySimpleStr,
46             remote_name => 'productSKU',
47             traits => ['SetOnce'],
48             is => 'rw',
49             );
50              
51             has product_risk => (
52             isa => NonEmptySimpleStr,
53             remote_name => 'productRisk',
54             traits => ['SetOnce'],
55             is => 'rw',
56             );
57              
58             has tax_amount => (
59             isa => PositiveOrZeroNum,
60             remote_name => 'taxAmount',
61             traits => ['SetOnce'],
62             is => 'rw',
63             );
64              
65             has tax_rate => (
66             isa => PositiveOrZeroNum,
67             remote_name => 'taxRate',
68             traits => ['SetOnce'],
69             is => 'rw',
70             );
71              
72             has national_tax => (
73             isa => PositiveOrZeroNum,
74             remote_name => 'nationalTax',
75             traits => ['SetOnce'],
76             is => 'rw',
77             );
78              
79             has invoice_number => (
80             isa => NonEmptySimpleStr,
81             remote_name => 'invoiceNumber',
82             is => 'ro',
83             required => 0,
84             );
85              
86             __PACKAGE__->meta->make_immutable;
87             1;
88              
89             # ABSTRACT: Item Helper Class
90              
91             __END__
92              
93             =pod
94              
95             =encoding UTF-8
96              
97             =head1 NAME
98              
99             Business::CyberSource::RequestPart::Item - Item Helper Class
100              
101             =head1 VERSION
102              
103             version 0.010008
104              
105             =head1 EXTENDS
106              
107             L<Business::CyberSource::MessagePart>
108              
109             =head1 ATTRIBUTES
110              
111             =head2 unit_price
112              
113             Per-item price of the product. You must include either this field or
114             L<total|Business::CyberSource::RequestPart::PurchaseTotals/"total">
115             in your request.
116              
117             =head2 quantity
118              
119             The default is 1. For C<ccAuthService> and C<ccCaptureService>, this field is
120             required if L<product_code|/"product_code> is not default or one of the values related to
121             shipping and/or handling.
122              
123             =head2 product_code
124              
125             Type of product. This value is used to determine the category that the product
126             is in.
127              
128             =head2 product_name
129              
130             For C<ccAuthService> and C<ccCaptureService>, this field is required if
131             L<product_code|/product_code> is not default or one of the values related to shipping
132             and/or handling.
133              
134             =head2 product_sku
135              
136             Identification code for the product. For C<ccAuthService> and
137             C<ccCaptureService>, this field is required if L<product_code|/product_code>
138             is not default or one of the values related to shipping and/or handling.
139              
140             =head2 product_risk
141              
142             =head2 tax_amount
143              
144             Total tax to apply to the product. This value cannot be negative. The tax
145             amount and the offer amount must be in the same currency.
146             The tax amount field is additive. For example (in CyberSource notation):
147              
148             You include the following offer lines in your request:
149              
150             item_0_unitPrice=10.00
151             item_0_quantity=1
152             item_0_taxAmount=0.80
153             item_1_unitPrice=20.00
154             item_1_quantity=1
155             item_1_taxAmount=1.60
156              
157             The total amount authorized will be 32.40, not 30.00 with 2.40 of tax included.
158              
159             =head2 tax_rate
160              
161             =head2 national_tax
162              
163             =head2 invoice_number
164              
165             =head1 BUGS
166              
167             Please report any bugs or feature requests on the bugtracker website
168             https://github.com/hostgator/business-cybersource/issues
169              
170             When submitting a bug or request, please include a test-file or a
171             patch to an existing test-file that illustrates the bug or desired
172             feature.
173              
174             =head1 AUTHOR
175              
176             Caleb Cushing <xenoterracide@gmail.com>
177              
178             =head1 COPYRIGHT AND LICENSE
179              
180             This software is Copyright (c) 2017 by Caleb Cushing <xenoterracide@gmail.com>.
181              
182             This is free software, licensed under:
183              
184             The Artistic License 2.0 (GPL Compatible)
185              
186             =cut