Business/CyberSource/RequestPart/Item.pm

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