Stripe/Connect/Transfer/Reversal.pm

filter: Statementstmt 44.4% 8 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 23.0% 3 / 13 Podpod 100% 10 / 10 totaltotal 51.2% 21 / 41 CC 1 SCAR 5.7
CC
1
Cov
44%
id
2.0
object
2.0
amount
2.0
CRAP 1.8
« Stripe/Connect/Account/Verification.pm ↑ Summary Stripe/File.pm »
1 ##----------------------------------------------------------------------------
2 ## Stripe API - ~/lib/Net/API/Stripe/Connect/Transfer/Reversal.pm
3 ## Version v0.100.0
4 ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <@sitael.tokyo.deguest.jp>
6 ## Created 2019/11/02
7 ## Modified 2020/05/15
8 ##
9 ##----------------------------------------------------------------------------
10 ## https://stripe.com/docs/api/transfer_reversals
11 package Net::API::Stripe::Connect::Transfer::Reversal;
12 BEGIN
13 {
14 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶ use parent qw( Net::API::Stripe::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶ our( $VERSION ) = 'v0.100.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
17 };
18  
19 0 ▶sub id { shift->_set_get_scalar( 'id', @_ ); }
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
20  
21 0 ▶sub object { shift->_set_get_scalar( 'object', @_ ); }
Subroutine object: not called CC=1 SCAR=6.9
Pod documented
22  
23 0 ▶sub amount { shift->_set_get_number( 'amount', @_ ); }
Subroutine amount: not called CC=1 SCAR=6.9
Pod documented
24  
25 0 ▶sub balance_transaction { shift->_set_get_scalar_or_object( 'balance_transaction', 'Net::API::Stripe::Balance::Transaction', @_ ); }
Subroutine balance_transaction: not called CC=1 SCAR=6.9
Pod documented
26  
27 0 ▶sub created { shift->_set_get_datetime( 'created', @_ ); }
Subroutine created: not called CC=1 SCAR=6.9
Pod documented
28  
29 0 ▶sub currency { shift->_set_get_scalar( 'currency', @_ ); }
Subroutine currency: not called CC=1 SCAR=6.9
Pod documented
30  
31 0 ▶sub destination_payment_refund { shift->_set_get_scalar_or_object( 'destination_payment_refund', 'Net::API::Stripe::Refund', @_ ); }
Subroutine destination_payment_refund: not called CC=1 SCAR=6.9
Pod documented
32  
33 0 ▶sub metadata { shift->_set_get_hash( 'metadata', @_ ); }
Subroutine metadata: not called CC=1 SCAR=6.9
Pod documented
34  
35 0 ▶sub source_refund { shift->_set_get_scalar_or_object( 'source_refund', 'Net::API::Stripe::Refund', @_ ); }
Subroutine source_refund: not called CC=1 SCAR=6.9
Pod documented
36  
37 0 ▶sub transfer { shift->_set_get_scalar_or_object( 'transfer', 'Net::API::Stripe::Connect::Transfer', @_ ); }
Subroutine transfer: not called CC=1 SCAR=6.9
Pod documented
38  
39 1 1;
40  
41 __END__
42  
43 =encoding utf8
44  
45 =head1 NAME
46  
47 Net::API::Stripe::Connect::Transfer::Reversal - A Stripe Transfer Reversal Object
48  
49 =head1 SYNOPSIS
50  
51 my $rev = $stripe->transfer_reversal({
52 amount => 2000,
53 currency => 'jpy',
54 destination_payment_refund => $refund_object,
55 metadata => { transaction_id => 123 },
56 transfer => $transfer_object,
57 });
58  
59 See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
60  
61 =head1 VERSION
62  
63 v0.100.0
64  
65 =head1 DESCRIPTION
66  
67 Stripe Connect (L<https://stripe.com/docs/connect>) platforms can reverse transfers made to a connected account, either entirely or partially, and can also specify whether to refund any related application fees. Transfer reversals add to the platform's balance and subtract from the destination account's balance.
68  
69 Reversing a transfer that was made for a destination charge (L<https://stripe.com/docs/connect/destination-charges>) is allowed only up to the amount of the charge. It is possible to reverse a transfer_group (L<https://stripe.com/docs/connect/charges-transfers#grouping-transactions>) transfer only if the destination account has enough balance to cover the reversal.
70  
71 =head1 CONSTRUCTOR
72  
73 =over 4
74  
75 =item B<new>( %ARG )
76  
77 Creates a new L<Net::API::Stripe::Connect::Transfer::Reversal> object.
78 It may also take an hash like arguments, that also are method of the same name.
79  
80 =back
81  
82 =head1 METHODS
83  
84 =over 4
85  
86 =item B<id> string
87  
88 Unique identifier for the object.
89 object string, value is "transfer_reversal"
90  
91 String representing the object’s type. Objects of the same type share the same value.
92  
93 =item B<amount> integer
94  
95 Amount, in JPY.
96  
97 =item B<balance_transaction> string (expandable)
98  
99 Balance transaction that describes the impact on your account balance. This is a L<Net::API::Stripe::Balance::Transaction> object.
100  
101 =item B<created> timestamp
102  
103 Time at which the object was created. Measured in seconds since the Unix epoch.
104  
105 =item B<currency> currency
106  
107 Three-letter ISO currency code, in lowercase. Must be a supported currency.
108  
109 =item B<destination_payment_refund> string (expandable)
110  
111 Linked payment refund for the transfer reversal.
112  
113 When expanded, this is a L<Net::API::Stripe::Refund> object.
114  
115 =item B<metadata> hash
116  
117 Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
118  
119 =item B<source_refund> string (expandable)
120  
121 ID of the refund responsible for the transfer reversal.
122  
123 When expanded, this is a L<Net::API::Stripe::Refund> object.
124  
125 =item B<transfer> string (expandable)
126  
127 ID of the transfer that was reversed.
128  
129 When expanded, this is a L<Net::API::Stripe::Connect::Transfer>
130  
131 =back
132  
133 =head1 API SAMPLE
134  
135 {
136 "id": "trr_fake123456789",
137 "object": "transfer_reversal",
138 "amount": 1100,
139 "balance_transaction": null,
140 "created": 1571313252,
141 "currency": "jpy",
142 "destination_payment_refund": null,
143 "metadata": {},
144 "source_refund": null,
145 "transfer": "tr_fake123456789"
146 }
147  
148 =head1 HISTORY
149  
150 =head2 v0.1
151  
152 Initial version
153  
154 =head1 AUTHOR
155  
156 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
157  
158 =head1 SEE ALSO
159  
160 Stripe API documentation:
161  
162 L<https://stripe.com/docs/api/transfer_reversals>, L<https://stripe.com/docs/connect/charges-transfers#reversing-transfers>
163  
164 =head1 COPYRIGHT & LICENSE
165  
166 Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
167  
168 You can use, copy, modify and redistribute this package and associated
169 files under the same terms as Perl itself.
170  
171 =cut
« Stripe/Connect/Account/Verification.pm ↑ Summary Stripe/File.pm »