File Coverage

blib/lib/Net/API/Stripe/Payment/Intent/TransferData.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 5 60.0
pod 2 2 100.0
total 12 16 75.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Payment/Intent/TransferData.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             package Net::API::Stripe::Payment::Intent::TransferData;
11             BEGIN
12             {
13 1     1   839 use strict;
  1         2  
  1         28  
14 1     1   4 use parent qw( Net::API::Stripe::Generic );
  1         2  
  1         4  
15 1     1   140 our( $VERSION ) = 'v0.100.0';
16             };
17              
18 0     0 1   sub amount { shift->_set_get_number( 'amount', @_ ); }
19              
20 0     0 1   sub destination { shift->_set_get_scalar_or_object( 'destination', 'Net::API::Stripe::Connect::Account', @_ ); }
21              
22             1;
23              
24             __END__
25              
26             =encoding utf8
27              
28             =head1 NAME
29              
30             Net::API::Stripe::Payment::Intent::TransferData - A Stripe TransferData Object
31              
32             =head1 SYNOPSIS
33              
34             my $tf_data = $stripe->payment_intent->transfer_data({
35             amount => 2000,
36             destination => $connect_account_object,
37             });
38              
39             =head1 VERSION
40              
41             v0.100.0
42              
43             =head1 DESCRIPTION
44              
45             The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details.
46              
47             This is instantiated by method B<transfer_data> in module L<Net::API::Stripe::Payment::Intent>
48              
49             =head1 CONSTRUCTOR
50              
51             =over 4
52              
53             =item B<new>( %ARG )
54              
55             Creates a new L<Net::API::Stripe::Payment::Intent::TransferData> object.
56             It may also take an hash like arguments, that also are method of the same name.
57              
58             =back
59              
60             =head1 METHODS
61              
62             =over 4
63              
64             =item B<amount> integer
65              
66             A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge Â¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
67              
68             =item B<destination> string (expandable)
69              
70             The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to upon payment success.
71              
72             When expanded, this is a L<Net::API::Stripe::Connect::Account> object.
73              
74             =back
75              
76             =head1 API SAMPLE
77              
78             {
79             "id": "pi_fake123456789",
80             "object": "payment_intent",
81             "amount": 1099,
82             "amount_capturable": 0,
83             "amount_received": 0,
84             "application": null,
85             "application_fee_amount": null,
86             "canceled_at": null,
87             "cancellation_reason": null,
88             "capture_method": "automatic",
89             "charges": {
90             "object": "list",
91             "data": [],
92             "has_more": false,
93             "url": "/v1/charges?payment_intent=pi_fake123456789"
94             },
95             "client_secret": "pi_fake123456789_secret_kfhksfhlajfl",
96             "confirmation_method": "automatic",
97             "created": 1556596976,
98             "currency": "jpy",
99             "customer": null,
100             "description": null,
101             "invoice": null,
102             "last_payment_error": null,
103             "livemode": false,
104             "metadata": {},
105             "next_action": null,
106             "on_behalf_of": null,
107             "payment_method": null,
108             "payment_method_options": {},
109             "payment_method_types": [
110             "card"
111             ],
112             "receipt_email": null,
113             "review": null,
114             "setup_future_usage": null,
115             "shipping": null,
116             "statement_descriptor": null,
117             "statement_descriptor_suffix": null,
118             "status": "requires_payment_method",
119             "transfer_data": null,
120             "transfer_group": null
121             }
122              
123             =head1 HISTORY
124              
125             =head2 v0.1
126              
127             Initial version
128              
129             =head1 AUTHOR
130              
131             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
132              
133             =head1 SEE ALSO
134              
135             Stripe API documentation:
136              
137             L<https://stripe.com/docs/api/payment_intents/object>
138              
139             =head1 COPYRIGHT & LICENSE
140              
141             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
142              
143             You can use, copy, modify and redistribute this package and associated
144             files under the same terms as Perl itself.
145              
146             =cut
147