GoCardless/Refund.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 13 / 13 Podpod 10.0% 1 / 10 totaltotal 74.5% 38 / 51 CC 3 SCAR 2.7
CC
3
Cov
92%
payment_id
2.1
mandate_id
2.1
BEGIN
1.0
CRAP 1.3
« GoCardless/CreditorBankAccount.pm ↑ Summary GoCardless/CustomerBankAccount.pm »
1 package Business::GoCardless::Refund;
2  
3 =head1 NAME
4  
5 Business::GoCardless::Refund
6  
7 =head1 DESCRIPTION
8  
9 A class for a gocardless refund, extends L<Business::GoCardless::Resource>
10  
11 =cut
12  
13 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 8 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 8 extends 'Business::GoCardless::Resource';
18  
19 =head1 ATTRIBUTES
20  
21 amount
22 created_at
23 currency
24 fx
25 id
26 links
27 metadata
28 reference
29 status
30  
31 =cut
32  
33 8 has [ qw/
34 amount
35 created_at
36 currency
37 fx
38 id
39 links
40 metadata
41 reference
42 status
43 / ] => (
44 is => 'rw',
45 );
46  
47 =head1 Operations on a refund
48  
49 =head2 update
50  
51 Update the refund's metadata, returns the updated Refund object:
52  
53 $Refund->update( metadata => { ... } );
54  
55 =cut
56  
57 1 ▶sub update { shift->_update( @_ ); }
Subroutine update: called CC=1 SCAR=0.0
Pod documented
58  
59 =head1 Status checks on a refund
60  
61 created
62 pending_submission
63 submitted
64 paid
65 cancelled
66 bounced
67 funds_returned
68  
69 if ( $Refund->paid ) {
70 ...
71 }
72  
73 =cut
74  
75 2 ▶sub created { return shift->status eq 'created' }
Subroutine created: called CC=1 SCAR=0.0
Pod undocumented
76 1 ▶sub pending_submission { return shift->status eq 'pending_submission' }
Subroutine pending_submission: called CC=1 SCAR=0.0
Pod undocumented
77 1 ▶sub submitted { return shift->status eq 'submitted' }
Subroutine submitted: called CC=1 SCAR=0.0
Pod undocumented
78 2 ▶sub paid { return shift->status eq 'paid' }
Subroutine paid: called CC=1 SCAR=0.0
Pod undocumented
79 1 ▶sub cancelled { return shift->status eq 'cancelled' }
Subroutine cancelled: called CC=1 SCAR=0.0
Pod undocumented
80 1 ▶sub bounced { return shift->status eq 'bounced' }
Subroutine bounced: called CC=1 SCAR=0.0
Pod undocumented
81 1 ▶sub funds_returned { return shift->status eq 'funds_returned' }
Subroutine funds_returned: called CC=1 SCAR=0.0
Pod undocumented
82  
83 =head1 Links
84  
85 payment_id
86 mandate_id
87  
88 Shortcut methods to get the IDs of the linked resources
89  
90 =cut
91  
92 2 ▶sub payment_id { return ( shift->links // {} )->{payment} }
Subroutine payment_id: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
(shift())->links // {}
l!l
20
MC/DC0%0/1
(shift())->links // {}
(shift())->links
Truth table50%1/2
A
A= (shift())->links
Aresult
11
00
93 2 ▶sub mandate_id { return ( shift->links // {} )->{mandate} }
Subroutine mandate_id: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
(shift())->links // {}
l!l
20
MC/DC0%0/1
(shift())->links // {}
(shift())->links
Truth table50%1/2
A
A= (shift())->links
Aresult
11
00
94  
95 =head1 AUTHOR
96  
97 Lee Johnson - C<lee@payprop.com>
98  
99 This library is free software; you can redistribute it and/or modify it under
100 the same terms as Perl itself. If you would like to contribute documentation,
101 features, bug fixes, or anything else then please raise an issue / pull request:
102  
103 https://github.com/payprop/business-gocardless
104  
105 =cut
106  
107 8 1;
108  
109 # vim: ts=4:sw=4:et
« GoCardless/CreditorBankAccount.pm ↑ Summary GoCardless/CustomerBankAccount.pm »