File Coverage

lib/Net/API/Stripe/Connect/Transfer/Reversal.pm
Criterion Covered Total %
statement 19 29 65.5
branch n/a
condition n/a
subroutine 7 17 41.1
pod 10 10 100.0
total 36 56 64.2


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 <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2020/05/15
8             ##
9             ##----------------------------------------------------------------------------
10             ## https://stripe.com/docs/api/transfer_reversals
11             BEGIN
12             {
13             use strict;
14 2     2   22808347 use warnings;
  2         15  
  2         61  
15 2     2   10 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         59  
16 2     2   11 use vars qw( $VERSION );
  2         5  
  2         12  
17 2     2   143 our( $VERSION ) = 'v0.100.0';
  2         6  
  2         117  
18 2     2   41 };
19              
20             use strict;
21 2     2   10 use warnings;
  2         5  
  2         41  
22 2     2   11  
  2         5  
  2         449  
23              
24 0     0 1    
25              
26 0     0 1    
27              
28 0     0 1    
29              
30 0     0 1    
31              
32 0     0 1    
33             1;
34 0     0 1    
35              
36 0     0 1   =encoding utf8
37              
38 0     0 1   =head1 NAME
39              
40 0     0 1   Net::API::Stripe::Connect::Transfer::Reversal - A Stripe Transfer Reversal Object
41              
42 0     0 1   =head1 SYNOPSIS
43              
44             my $rev = $stripe->transfer_reversal({
45             amount => 2000,
46             currency => 'jpy',
47             destination_payment_refund => $refund_object,
48             metadata => { transaction_id => 123 },
49             transfer => $transfer_object,
50             });
51              
52             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
53              
54             =head1 VERSION
55              
56             v0.100.0
57              
58             =head1 DESCRIPTION
59              
60             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.
61              
62             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.
63              
64             =head1 CONSTRUCTOR
65              
66             =head2 new( %ARG )
67              
68             Creates a new L<Net::API::Stripe::Connect::Transfer::Reversal> object.
69             It may also take an hash like arguments, that also are method of the same name.
70              
71             =head1 METHODS
72              
73             =head2 id string
74              
75             Unique identifier for the object.
76             object string, value is "transfer_reversal"
77              
78             String representing the object’s type. Objects of the same type share the same value.
79              
80             =head2 amount integer
81              
82             Amount, in JPY.
83              
84             =head2 balance_transaction string (expandable)
85              
86             Balance transaction that describes the impact on your account balance. This is a L<Net::API::Stripe::Balance::Transaction> object.
87              
88             =head2 created timestamp
89              
90             Time at which the object was created. Measured in seconds since the Unix epoch.
91              
92             =head2 currency currency
93              
94             Three-letter ISO currency code, in lowercase. Must be a supported currency.
95              
96             =head2 destination_payment_refund string (expandable)
97              
98             Linked payment refund for the transfer reversal.
99              
100             When expanded, this is a L<Net::API::Stripe::Refund> object.
101              
102             =head2 metadata hash
103              
104             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.
105              
106             =head2 source_refund string (expandable)
107              
108             ID of the refund responsible for the transfer reversal.
109              
110             When expanded, this is a L<Net::API::Stripe::Refund> object.
111              
112             =head2 transfer string (expandable)
113              
114             ID of the transfer that was reversed.
115              
116             When expanded, this is a L<Net::API::Stripe::Connect::Transfer>
117              
118             =head1 API SAMPLE
119              
120             {
121             "id": "trr_fake123456789",
122             "object": "transfer_reversal",
123             "amount": 1100,
124             "balance_transaction": null,
125             "created": 1571313252,
126             "currency": "jpy",
127             "destination_payment_refund": null,
128             "metadata": {},
129             "source_refund": null,
130             "transfer": "tr_fake123456789"
131             }
132              
133             =head1 HISTORY
134              
135             =head2 v0.1
136              
137             Initial version
138              
139             =head1 AUTHOR
140              
141             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
142              
143             =head1 SEE ALSO
144              
145             Stripe API documentation:
146              
147             L<https://stripe.com/docs/api/transfer_reversals>, L<https://stripe.com/docs/connect/charges-transfers#reversing-transfers>
148              
149             =head1 COPYRIGHT & LICENSE
150              
151             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
152              
153             You can use, copy, modify and redistribute this package and associated
154             files under the same terms as Perl itself.
155              
156             =cut