File Coverage

blib/lib/Stancer/Core/Request/Call.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 23 100.0


line stmt bran cond sub pod time code
1             package Stancer::Core::Request::Call;
2              
3 41     41   379877 use 5.020;
  41         217  
4 41     41   275 use strict;
  41         107  
  41         1195  
5 41     41   198 use warnings;
  41         334  
  41         3752  
6              
7             # ABSTRACT: Register API call
8             our $VERSION = '1.0.3'; # VERSION
9              
10 41     41   1496 use Stancer::Core::Types qw(InstanceOf Maybe);
  41         102  
  41         3688  
11              
12 41     41   276 use Moo;
  41         158  
  41         436  
13 41     41   20475 use namespace::clean;
  41         133  
  41         379  
14              
15              
16             has exception => (
17             is => 'ro',
18             isa => Maybe[InstanceOf['Stancer::Exceptions::Throwable']],
19             );
20              
21              
22             has request => (
23             is => 'ro',
24             isa => InstanceOf['HTTP::Request'],
25             );
26              
27              
28             has response => (
29             is => 'ro',
30             isa => InstanceOf['HTTP::Response'],
31             );
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Stancer::Core::Request::Call - Register API call
44              
45             =head1 VERSION
46              
47             version 1.0.3
48              
49             =head1 SYNOPSIS
50              
51             This class serves as a call register.
52              
53             You do not need to instanciate it directly, you should only see them in debug mode.
54              
55             =head1 ATTRIBUTES
56              
57             =head2 C<exception>
58              
59             Read-only instance of C<Stancer::Exceptions::Throwable>.
60              
61             If the request result to an exception, you can see it here.
62              
63             =head2 C<request>
64              
65             Read-only instance of C<HTTP::Request>.
66              
67             The request.
68              
69             =head2 C<response>
70              
71             Read-only instance of C<HTTP::Response>.
72              
73             The response to a request.
74              
75             =head1 USAGE
76              
77             =head2 Logging
78              
79              
80              
81             We use the L<Log::Any> framework for logging events.
82             You may tell where it should log using any available L<Log::Any::Adapter> module.
83              
84             For example, to log everything to a file you just have to add a line to your script, like this:
85             #! /usr/bin/env perl
86             use Log::Any::Adapter (File => '/var/log/payment.log');
87             use Stancer::Core::Request::Call;
88              
89             You must import C<Log::Any::Adapter> before our libraries, to initialize the logger instance before use.
90              
91             You can choose your log level on import directly:
92             use Log::Any::Adapter (File => '/var/log/payment.log', log_level => 'info');
93              
94             Read the L<Log::Any> documentation to know what other options you have.
95              
96             =cut
97              
98             =head1 SECURITY
99              
100             =over
101              
102             =item *
103              
104             Never, never, NEVER register a card or a bank account number in your database.
105              
106             =item *
107              
108             Always uses HTTPS in card/SEPA in communication.
109              
110             =item *
111              
112             Our API will never give you a complete card/SEPA number, only the last four digits.
113             If you need to keep track, use these last four digit.
114              
115             =back
116              
117             =cut
118              
119             =head1 BUGS
120              
121             Please report any bugs or feature requests on the bugtracker website
122             L<https://gitlab.com/wearestancer/library/lib-perl/-/issues> or by email to
123             L<bug-stancer@rt.cpan.org|mailto:bug-stancer@rt.cpan.org>.
124              
125             When submitting a bug or request, please include a test-file or a
126             patch to an existing test-file that illustrates the bug or desired
127             feature.
128              
129             =head1 AUTHOR
130              
131             Joel Da Silva <jdasilva@cpan.org>
132              
133             =head1 COPYRIGHT AND LICENSE
134              
135             This software is Copyright (c) 2018-2024 by Stancer / Iliad78.
136              
137             This is free software, licensed under:
138              
139             The Artistic License 2.0 (GPL Compatible)
140              
141             =cut