File Coverage

blib/lib/Business/cXML/Response/PunchOutSetup.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 2 2 100.0
total 33 33 100.0


line stmt bran cond sub pod time code
1             =encoding utf-8
2              
3             =head1 NAME
4              
5             Business::cXML::Response::PunchOutSetup - cXML punch-out setup response payload
6              
7             =head1 SYNOPSIS
8              
9             # This is normally done for you in Business::cXML::process()
10             use Business::cXML::Response::PunchOutSetup;
11             my $posr = new Business::cXML::Response::PunchOutSetup {
12             url => '...',
13             };
14              
15             =head1 DESCRIPTION
16              
17             Object representation of a cXML punch-out setup response.
18              
19             =head1 METHODS
20              
21             See L<Business::cXML::Object/COMMON METHODS>.
22              
23             =head1 PROPERTY METHODS
24              
25             See L<Business::cXML::Object/PROPERTY METHODS> for how the following operate.
26              
27             =over
28              
29             =cut
30              
31 3     3   793 use 5.014;
  3         9  
32 3     3   12 use strict;
  3         7  
  3         92  
33              
34             use base qw(Business::cXML::Object);
35 3     3   17  
  3         6  
  3         176  
36             use constant NODENAME => 'PunchOutSetupResponse';
37 3     3   20 use constant PROPERTIES => (
  3         6  
  3         137  
38 3         142 url => '',
39             );
40 3     3   14  
  3         7  
41             use XML::LibXML::Ferry;
42 3     3   15  
  3         6  
  3         360  
43             my ($self, $el) = @_;
44              
45 12     12 1 30 # Recursing into StartPage will catch URL to url for us
46             $el->ferry($self, { StartPage => {} });
47             }
48 12         45  
49             my ($self, $doc) = @_;
50             my $node = $doc->create($self->{_nodeName});
51              
52 2     2 1 6 $node->add('StartPage')->add('URL', $self->{url});
53 2         6  
54             return $node;
55 2         33 }
56              
57 2         109 =item C<B<url>>
58              
59             Mandatory, URL of start page to which the buyer's browser will be directed.
60              
61             =back
62              
63             =head1 AUTHOR
64              
65             Stéphane Lavergne L<https://github.com/vphantom>
66              
67             =head1 ACKNOWLEDGEMENTS
68              
69             Graph X Design Inc. L<https://www.gxd.ca/> sponsored this project.
70              
71             =head1 COPYRIGHT & LICENSE
72              
73             Copyright (c) 2017-2018 Stéphane Lavergne L<https://github.com/vphantom>
74              
75             Permission is hereby granted, free of charge, to any person obtaining a copy
76             of this software and associated documentation files (the "Software"), to deal
77             in the Software without restriction, including without limitation the rights
78             to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
79             copies of the Software, and to permit persons to whom the Software is
80             furnished to do so, subject to the following conditions:
81              
82             The above copyright notice and this permission notice shall be included in all
83             copies or substantial portions of the Software.
84              
85             THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
86             IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87             FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
88             AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
89             LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
90             OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
91             SOFTWARE.
92              
93             =cut
94              
95             1;