File Coverage

blib/lib/Business/OnlinePayment/Iridium/Action/CardDetailsTransaction.pm
Criterion Covered Total %
statement 3 5 60.0
branch n/a
condition n/a
subroutine 1 3 33.3
pod 1 1 100.0
total 5 9 55.5


line stmt bran cond sub pod time code
1             package Business::OnlinePayment::Iridium::Action::CardDetailsTransaction;
2              
3 1     1   520 use Moose;
  1         2  
  1         10  
4              
5             with 'Business::OnlinePayment::Iridium::Action';
6              
7             # PODNAME: Business::OnlinePayment::Iridium::Action::CardDetailsTransaction
8             # ABSTRACT: Handle PayVector card details
9              
10             has 'OrderID' => (
11             isa => 'Str',
12             is => 'rw',
13             required => '1'
14             );
15              
16             has 'OrderDescription' => (
17             isa => 'Str',
18             is => 'rw',
19             required => '0'
20             );
21              
22             has 'TransactionType' => (
23             isa => 'Str',
24             is => 'rw',
25             required => '1'
26             );
27              
28             has 'CardName' => (
29             isa => 'Str',
30             is => 'rw',
31             required => '1'
32             );
33              
34             has 'CardNumber' => (
35             isa => 'Int',
36             is => 'rw',
37             required => '1'
38             );
39              
40             has 'ExpireMonth' => (
41             isa => 'Int',
42             is => 'rw',
43             required => '1'
44             );
45              
46             has 'ExpireYear' => (
47             isa => 'Int',
48             is => 'rw',
49             required => '1'
50             );
51              
52             has 'CV2' => (
53             isa => 'Int',
54             is => 'rw',
55             );
56              
57             has 'IssueNumber' => (
58             isa => 'Int',
59             is => 'rw',
60             );
61              
62             has 'Amount' => (
63             isa => 'Int',
64             is => 'rw',
65             required => '1'
66             );
67              
68             has 'EchoCardType' => (
69             isa => 'Bool',
70             is => 'rw',
71             required => '0'
72             );
73              
74             has 'EchoAVSCheckResult' => (
75             isa => 'Bool',
76             is => 'rw',
77             required => '0'
78             );
79              
80             has 'EchoCV2CheckResult' => (
81             isa => 'Bool',
82             is => 'rw',
83             required => '0'
84             );
85              
86             has 'EchoAmountReceived' => (
87             isa => 'Bool',
88             is => 'rw',
89             required => '0'
90             );
91              
92             has 'DuplicateDelay' => (
93             isa => 'Int',
94             is => 'rw',
95             required => '0'
96             );
97              
98             has 'AVSOverridePolicy' => (
99             isa => 'Str',
100             is => 'rw',
101             required => '0'
102             );
103              
104             has 'CV2OverridePolicy' => (
105             isa => 'Str',
106             is => 'rw',
107             required => '0'
108             );
109              
110             has 'ThreeDSecureOverridePolicy' => (
111             isa => 'Bool',
112             is => 'rw',
113             required => '0'
114             );
115              
116             has 'Address1' => (
117             isa => 'Str',
118             is => 'rw',
119             required => '0'
120             );
121              
122             has 'Address2' => (
123             isa => 'Str',
124             is => 'rw',
125             required => '0'
126             );
127              
128             has 'Address3' => (
129             isa => 'Str',
130             is => 'rw',
131             required => '0'
132             );
133              
134             has 'Address4' => (
135             isa => 'Str',
136             is => 'rw',
137             required => '0'
138             );
139              
140             has 'City' => (
141             isa => 'Str',
142             is => 'rw',
143             required => '0'
144             );
145              
146             has 'State' => (
147             isa => 'Str',
148             is => 'rw',
149             required => '0'
150             );
151              
152             has 'PostCode' => (
153             isa => 'Str',
154             is => 'rw',
155             required => '0'
156             );
157              
158             has 'CountryCode' => (
159             isa => 'Int',
160             is => 'rw',
161             required => '0'
162             );
163              
164             has 'EmailAddress' => (
165             isa => 'Str',
166             is => 'rw',
167             required => '0'
168             );
169              
170             has 'PhoneNumber' => (
171             isa => 'Str',
172             is => 'rw',
173             required => '0'
174             );
175              
176             has 'PassOutData' => (
177             isa => 'Str',
178             is => 'rw',
179             required => '0'
180             );
181              
182 0     0     sub _build__type { return 'CardDetailsTransaction' }
183              
184              
185             sub template {
186 0     0 1   return <<DATA;
187             <?xml version="1.0" encoding="utf-8"?>
188             <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
189             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
190             xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
191             <soap:Body>
192             <CardDetailsTransaction xmlns="https://www.thepaymentgateway.net/">
193             <PaymentMessage>
194             <MerchantAuthentication MerchantID="[% MerchantID %]" Password="[% Password %]" />
195             <TransactionDetails Amount="[% Amount %]" CurrencyCode="[% CurrencyCode %]">
196             <MessageDetails TransactionType="[% TransactionType %]" />
197             <OrderID>[% OrderID %]</OrderID>
198             <OrderDescription>[% OrderDescription %]</OrderDescription>
199             <TransactionControl>
200             [% IF EchoCardType.defined %]<EchoCardType>TRUE</EchoCardType>[% END %]
201             [% IF EchoAVSCheckResult.defined %]<EchoAVSCheckResult>TRUE</EchoAVSCheckResult>[% END %]
202             [% IF EchoCV2CheckResult.defined %]<EchoCV2CheckResult>TRUE</EchoCV2CheckResult>[% END %]
203             [% IF EchoAmountReceived.defined %]<EchoAmountReceived>TRUE</EchoAmountReceived>[% END %]
204             [% IF DuplicateDelay.defined %]<DuplicateDelay>[% DuplicateDelay %]</DuplicateDelay>[% END %]
205             [% IF AVSOverridePolicy.defined %]<AVSOverridePolicy>[% AVSOverridePolicy %]</AVSOverridePolicy>[% END %]
206             [% IF CV2OverridePolicy.defined %]<CV2OverridePolicy>[% CV2OverridePolicy %]</CV2OverridePolicy>[% END %]
207             [% IF ThreeDSecureOverridePolicy.defined %]<ThreeDSecureOverridePolicy>FALSE</ThreeDSecureOverridePolicy>[% END %]
208             </TransactionControl>
209             </TransactionDetails>
210             <CardDetails>
211             <CardName>[% CardName %]</CardName>
212             <CardNumber>[% CardNumber %]</CardNumber>
213             <ExpiryDate Month="[% ExpireMonth %]" Year="[% ExpireYear %]" />
214             <StartDate Month="[% StartMonth %]" Year="[% StartYear %]" />
215             [% IF CV2.defined %]<CV2>[% CV2 %]</CV2>[% END %]
216             [% IF IssueNumber.defined %]<IssueNumber>[% IssueNumber %]</IssueNumber>[% END %]
217             </CardDetails>
218             <CustomerDetails>
219             <BillingAddress>
220             <Address1>[% Address1 %]</Address1>
221             <Address2>[% Address2 %]</Address2>
222             <Address3>[% Address3 %]</Address3>
223             <Address4>[% Address4 %]</Address4>
224             <City>[% City %]</City>
225             <State>[% State %]</State>
226             <PostCode>[% PostCode %]</PostCode>
227             <CountryCode>[% CountryCode %]</CountryCode>
228             </BillingAddress>
229             <EmailAddress>[% EmailAddress %]</EmailAddress>
230             <PhoneNumber>[% PhoneNumber %]</PhoneNumber>
231             </CustomerDetails>
232             <PassOutData>[% PassOutData %]</PassOutData>
233             </PaymentMessage>
234             </CardDetailsTransaction>
235             </soap:Body>
236             </soap:Envelope>
237             DATA
238             }
239              
240             1;
241              
242             __END__
243              
244             =pod
245              
246             =encoding UTF-8
247              
248             =head1 NAME
249              
250             Business::OnlinePayment::Iridium::Action::CardDetailsTransaction - Handle PayVector card details
251              
252             =head1 VERSION
253              
254             version 1.03
255              
256             =head2 template
257              
258             SOAP template to use to send to PayVector / Iridium
259              
260             =head1 AUTHOR
261              
262             [ 'Gavin Henry <ghenry@surevoip.co.uk>', 'Wallace Reis <reis.wallace@gmail.com>' ]
263              
264             =head1 COPYRIGHT AND LICENSE
265              
266             This software is copyright (c) 2017 by [ 'Gavin Henry', 'Wallace Reis' ].
267              
268             This is free software; you can redistribute it and/or modify it under
269             the same terms as the Perl 5 programming language system itself.
270              
271             =cut