File Coverage

blib/lib/Net/API/Stripe/Connect/Transfer/Reversal.pm
Criterion Covered Total %
statement 7 17 41.1
branch n/a
condition n/a
subroutine 3 13 23.0
pod 10 10 100.0
total 20 40 50.0


line stmt bran cond sub pod time code
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     1   832 use strict;
  1         3  
  1         28  
15 1     1   5 use parent qw( Net::API::Stripe::Generic );
  1         2  
  1         5  
16 1     1   205 our( $VERSION ) = 'v0.100.0';
17             };
18              
19 0     0 1   sub id { shift->_set_get_scalar( 'id', @_ ); }
20              
21 0     0 1   sub object { shift->_set_get_scalar( 'object', @_ ); }
22              
23 0     0 1   sub amount { shift->_set_get_number( 'amount', @_ ); }
24              
25 0     0 1   sub balance_transaction { shift->_set_get_scalar_or_object( 'balance_transaction', 'Net::API::Stripe::Balance::Transaction', @_ ); }
26              
27 0     0 1   sub created { shift->_set_get_datetime( 'created', @_ ); }
28              
29 0     0 1   sub currency { shift->_set_get_scalar( 'currency', @_ ); }
30              
31 0     0 1   sub destination_payment_refund { shift->_set_get_scalar_or_object( 'destination_payment_refund', 'Net::API::Stripe::Refund', @_ ); }
32              
33 0     0 1   sub metadata { shift->_set_get_hash( 'metadata', @_ ); }
34              
35 0     0 1   sub source_refund { shift->_set_get_scalar_or_object( 'source_refund', 'Net::API::Stripe::Refund', @_ ); }
36              
37 0     0 1   sub transfer { shift->_set_get_scalar_or_object( 'transfer', 'Net::API::Stripe::Connect::Transfer', @_ ); }
38              
39             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