GoCardless/RedirectFlow.pm

filter: Statementstmt 100% 24 / 24 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 91.8% 34 / 37 CC 3 SCAR 5.1
CC
3
Cov
96%
mandate
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« GoCardless/PayoutItem.pm ↑ Summary GoCardless/BankAccountHolderVerification.pm »
1 package Business::GoCardless::RedirectFlow;
2  
3 =head1 NAME
4  
5 Business::GoCardless::RedirectFlow
6  
7 =head1 DESCRIPTION
8  
9 A class for a gocardless redirect flow, extends L<Business::GoCardless::PreAuthorization>
10  
11 =cut
12  
13 55 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 55 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 55 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 55 extends 'Business::GoCardless::PreAuthorization';
18  
19 55 ▶use Business::GoCardless::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 55 ▶use Business::GoCardless::Mandate;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 =head1 ATTRIBUTES
23  
24 confirmation_url
25 mandate_reference
26 redirect_url
27 scheme
28 session_token
29 success_redirect_url
30 links
31 metadata
32  
33 =cut
34  
35 55 has [ qw/
36 confirmation_url
37 mandate_reference
38 redirect_url
39 scheme
40 session_token
41 success_redirect_url
42 links
43 metadata
44 / ] => (
45 is => 'rw',
46 );
47  
48  
49 =head1 AUTHOR
50  
51 Lee Johnson - C<lee@payprop.com>
52  
53 This library is free software; you can redistribute it and/or modify it under
54 the same terms as Perl itself. If you would like to contribute documentation,
55 features, bug fixes, or anything else then please raise an issue / pull request:
56  
57 https://github.com/payprop/business-gocardless
58  
59 =cut
60  
61 1 ▶sub cancel {
Subroutine cancel: called CC=1 SCAR=0.0
Pod undocumented
62 1 Business::GoCardless::Exception->throw({
63 message => "->cancel on a RedirectFlow is not meaningful in the Pro API",
64 });
65 }
66  
67 2 ▶sub mandate {
Subroutine mandate: called CC=3 SCAR=11.0
Pod undocumented
68 2 my ( $self ) = @_;
69  
70 2 ▶ if ( ! $self->links ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->links) 1 1 2
71 1 $self->find_with_client( 'redirect_flows' );
72 }
73  
74 my $Mandate = Business::GoCardless::Mandate->new(
75 client => $self->client,
76 id => $self->links ? $self->links->{mandate} : undef,
77 2 ▶ );
Branch: 1 branch
BranchTrueFalseTotal
$self->links ? : 2 0 2
78  
79 2 return $Mandate->find_with_client( 'mandates' );
80 }
81  
82 55 1;
83  
84 # vim: ts=4:sw=4:et
« GoCardless/PayoutItem.pm ↑ Summary GoCardless/BankAccountHolderVerification.pm »