File Coverage

blib/lib/Stancer/Payment/Status.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::Payment::Status;
2              
3 15     15   348819 use 5.020;
  15         59  
4 15     15   110 use strict;
  15         33  
  15         499  
5 15     15   78 use warnings;
  15         32  
  15         1236  
6              
7             # ABSTRACT: Payment status values
8             our $VERSION = '1.0.3'; # VERSION
9              
10 15     15   1366 use Moo;
  15         19963  
  15         105  
11 15     15   13199 use namespace::clean;
  15         36897  
  15         149  
12              
13             use constant {
14 15         2667 AUTHORIZE => 'authorize',
15             AUTHORIZED => 'authorized',
16             CANCELED => 'canceled',
17             CAPTURE => 'capture',
18             CAPTURE_SENT => 'capture_sent',
19             CAPTURED => 'captured',
20             DISPUTED => 'disputed',
21             EXPIRED => 'expired',
22             FAILED => 'failed',
23             TO_CAPTURE => 'to_capture',
24 15     15   5744 };
  15         35  
25              
26              
27             1;
28              
29             __END__
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             Stancer::Payment::Status - Payment status values
38              
39             =head1 VERSION
40              
41             version 1.0.3
42              
43             =head1 Constants
44              
45             =head2 authorize
46              
47             Ask the authorization.
48              
49             =head2 authorized
50              
51             The bank authorized the payment but the transaction will only be processed when the capture will be set to C<true>.
52              
53             =head2 canceled
54              
55             The payment will not be performed, no money will be captured.
56              
57             =head2 capture
58              
59             Ask to authorize and capture the payment.
60              
61             =head2 capture_sent
62              
63             The capture operation is being processed, the payment can not be cancelled anymore,
64             refunds must wait the end of the capture process.
65              
66             =head2 captured
67              
68             The amount of the payment have been credited to your account.
69              
70             =head2 disputed
71              
72             The customer declined the payment after it have been captured on your account.
73              
74             =head2 expired
75              
76             The authorisation was not captured and expired after 7 days.
77              
78             =head2 failed
79              
80             The payment has failed, refer to the response field for more details.
81              
82             =head2 refused
83              
84             The payment has been refused.
85              
86             =head2 to_capture
87              
88             The bank authorized the payment, money will be processed within the day.
89              
90             =head1 USAGE
91              
92             =head2 Logging
93              
94              
95              
96             We use the L<Log::Any> framework for logging events.
97             You may tell where it should log using any available L<Log::Any::Adapter> module.
98              
99             For example, to log everything to a file you just have to add a line to your script, like this:
100             #! /usr/bin/env perl
101             use Log::Any::Adapter (File => '/var/log/payment.log');
102             use Stancer::Payment::Status;
103              
104             You must import C<Log::Any::Adapter> before our libraries, to initialize the logger instance before use.
105              
106             You can choose your log level on import directly:
107             use Log::Any::Adapter (File => '/var/log/payment.log', log_level => 'info');
108              
109             Read the L<Log::Any> documentation to know what other options you have.
110              
111             =cut
112              
113             =head1 SECURITY
114              
115             =over
116              
117             =item *
118              
119             Never, never, NEVER register a card or a bank account number in your database.
120              
121             =item *
122              
123             Always uses HTTPS in card/SEPA in communication.
124              
125             =item *
126              
127             Our API will never give you a complete card/SEPA number, only the last four digits.
128             If you need to keep track, use these last four digit.
129              
130             =back
131              
132             =cut
133              
134             =head1 BUGS
135              
136             Please report any bugs or feature requests on the bugtracker website
137             L<https://gitlab.com/wearestancer/library/lib-perl/-/issues> or by email to
138             L<bug-stancer@rt.cpan.org|mailto:bug-stancer@rt.cpan.org>.
139              
140             When submitting a bug or request, please include a test-file or a
141             patch to an existing test-file that illustrates the bug or desired
142             feature.
143              
144             =head1 AUTHOR
145              
146             Joel Da Silva <jdasilva@cpan.org>
147              
148             =head1 COPYRIGHT AND LICENSE
149              
150             This software is Copyright (c) 2018-2024 by Stancer / Iliad78.
151              
152             This is free software, licensed under:
153              
154             The Artistic License 2.0 (GPL Compatible)
155              
156             =cut