File Coverage

lib/Net/API/Stripe/Payment/Source/Receiver.pm
Criterion Covered Total %
statement 19 25 76.0
branch n/a
condition n/a
subroutine 7 13 53.8
pod 6 6 100.0
total 32 44 72.7


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Payment/Source/Receiver.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             package Net::API::Stripe::Payment::Source::Receiver;
11             BEGIN
12             {
13 2     2   21421020 use strict;
  2         15  
  2         76  
14 2     2   11 use warnings;
  2         6  
  2         67  
15 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         5  
  2         13  
16 2     2   148 use vars qw( $VERSION );
  2         3  
  2         116  
17 2     2   40 our( $VERSION ) = 'v0.100.0';
18             };
19              
20 2     2   11 use strict;
  2         6  
  2         54  
21 2     2   11 use warnings;
  2         5  
  2         352  
22              
23 0     0 1   sub address { return( shift->_set_get_scalar( 'address', @_ ) ); }
24              
25 0     0 1   sub amount_charged { return( shift->_set_get_number( 'amount_charged', @_ ) ); }
26              
27 0     0 1   sub amount_received { return( shift->_set_get_number( 'amount_received', @_ ) ); }
28              
29 0     0 1   sub amount_returned { return( shift->_set_get_number( 'amount_returned', @_ ) ); }
30              
31 0     0 1   sub refund_attributes_method { return( shift->_set_get_scalar( 'refund_attributes_method', @_ ) ); }
32              
33 0     0 1   sub refund_attributes_status { return( shift->_set_get_scalar( 'refund_attributes_status', @_ ) ); }
34              
35             1;
36              
37             __END__
38              
39             =encoding utf8
40              
41             =head1 NAME
42              
43             Net::API::Stripe::Payment::Source::Receiver - A Stripe Payment Receiver Object
44              
45             =head1 SYNOPSIS
46              
47             my $rcv = $stripe->source->receiver({
48             address => '1-2-3 Kudan-Minami, Chiyoda-ku, Tokyo 123-4567 Japan',
49             amount_charged => 2000,
50             });
51              
52             =head1 VERSION
53              
54             v0.100.0
55              
56             =head1 DESCRIPTION
57              
58             Information related to the receiver flow. Present if the source is a receiver (flow is receiver).
59              
60             This is part of the L<Net::API::Stripe::Payment::Source> object
61              
62             =head1 CONSTRUCTOR
63              
64             =head2 new( %ARG )
65              
66             Creates a new L<Net::API::Stripe::Payment::Source::Receiver> object.
67             It may also take an hash like arguments, that also are method of the same name.
68              
69             =head1 METHODS
70              
71             =head2 address string
72              
73             The address of the receiver source. This is the value that should be communicated to the customer to send their funds to.
74              
75             =head2 amount_charged integer
76              
77             The total amount that was charged by you. The amount charged is expressed in the source’s currency.
78              
79             =head2 amount_received integer
80              
81             The total amount received by the receiver source. amount_received = amount_returned + amount_charged is true at all time. The amount received is expressed in the source’s currency.
82              
83             =head2 amount_returned integer
84              
85             The total amount that was returned to the customer. The amount returned is expressed in the source’s currency.
86              
87             =head2 refund_attributes_method string
88              
89             Type of refund attribute method, one of email, manual, or none.
90              
91             =head2 refund_attributes_status string
92              
93             Type of refund attribute status, one of missing, requested, or available.
94              
95             =head1 API SAMPLE
96              
97             {
98             "id": "src_fake123456789",
99             "object": "source",
100             "ach_credit_transfer": {
101             "account_number": "test_52796e3294dc",
102             "routing_number": "110000000",
103             "fingerprint": "avmabmnabvmnvb",
104             "bank_name": "TEST BANK",
105             "swift_code": "TSTEZ122"
106             },
107             "amount": null,
108             "client_secret": "src_client_secret_fake123456789",
109             "created": 1571314413,
110             "currency": "jpy",
111             "flow": "receiver",
112             "livemode": false,
113             "metadata": {},
114             "owner": {
115             "address": null,
116             "email": "jenny.rosen@example.com",
117             "name": null,
118             "phone": null,
119             "verified_address": null,
120             "verified_email": null,
121             "verified_name": null,
122             "verified_phone": null
123             },
124             "receiver": {
125             "address": "121042882-38381234567890123",
126             "amount_charged": 0,
127             "amount_received": 0,
128             "amount_returned": 0,
129             "refund_attributes_method": "email",
130             "refund_attributes_status": "missing"
131             },
132             "statement_descriptor": null,
133             "status": "pending",
134             "type": "ach_credit_transfer",
135             "usage": "reusable"
136             }
137              
138             =head1 HISTORY
139              
140             =head2 v0.1
141              
142             Initial version
143              
144             =head1 AUTHOR
145              
146             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
147              
148             =head1 SEE ALSO
149              
150             Stripe API documentation:
151              
152             L<https://stripe.com/docs/api/sources/object>
153              
154             =head1 COPYRIGHT & LICENSE
155              
156             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
157              
158             You can use, copy, modify and redistribute this package and associated
159             files under the same terms as Perl itself.
160              
161             =cut