File Coverage

blib/lib/Net/API/Stripe/Fraud/Review.pm
Criterion Covered Total %
statement 7 21 33.3
branch n/a
condition n/a
subroutine 3 17 17.6
pod 14 14 100.0
total 24 52 46.1


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Fraud/Review.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::Fraud::Review;
11             BEGIN
12             {
13 1     1   812 use strict;
  1         2  
  1         28  
14 1     1   5 use parent qw( Net::API::Stripe::Generic );
  1         1  
  1         4  
15 1     1   272 our( $VERSION ) = 'v0.100.0';
16             };
17              
18 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
19              
20 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
21              
22 0     0 1   sub billing_zip { return( shift->_set_get_scalar( 'billing_zip', @_ ) ); }
23              
24 0     0 1   sub charge { return( shift->_set_get_scalar_or_object( 'charge', 'Net::API::Stripe::Charge', @_ ) ); }
25              
26 0     0 1   sub closed_reason { return( shift->_set_get_scalar( 'closed_reason', @_ ) ); }
27              
28 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
29              
30 0     0 1   sub ip_address { return( shift->_set_get_scalar( 'ip_address', @_ ) ); }
31              
32 0     0 1   sub ip_address_location { return( shift->_set_get_hash_as_object( 'ip_address_location', 'Net::API::Stripe::GeoLocation', @_ ) ); }
33              
34 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
35              
36 0     0 1   sub open { return( shift->_set_get_boolean( 'open', @_ ) ); }
37              
38 0     0 1   sub opened_reason { return( shift->_set_get_scalar( 'opened_reason', @_ ) ); }
39              
40 0     0 1   sub payment_intent { return( shift->_set_get_scalar_or_object( 'payment_intent', 'Net::API::Stripe::Payment::Intent', @_ ) ); }
41              
42 0     0 1   sub reason { return( shift->_set_get_scalar( 'reason', @_ ) ); }
43              
44 0     0 1   sub session { return( shift->_set_get_object( 'session', 'Net::API::Stripe::Fraud::Review::Session', @_ ) ); }
45              
46             1;
47              
48             __END__
49              
50             =encoding utf8
51              
52             =head1 NAME
53              
54             Net::API::Stripe::Fraud::Review - A Stripe Fraud Review Object
55              
56             =head1 SYNOPSIS
57              
58             my $review = $stripe->review({
59             billing_zip => '123-4567',
60             # Could also be a Net::API::Stripe::Charge object when expanded
61             charge => 'ch_fake1234567890',
62             ip_address => '1.2.3.4',
63             ip_address_location =>
64             {
65             city => 'Tokyo',
66             country => 'jp',
67             latitude => '35.6935496',
68             longitude => '139.7461204',
69             region => undef,
70             },
71             open => $stripe->true,
72             payment_intent => $payment_intent_object,
73             reason => 'Some issue',
74             session => $session_object,
75             });
76              
77             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
78              
79             =head1 VERSION
80              
81             v0.100.0
82              
83             =head1 DESCRIPTION
84              
85             Reviews can be used to supplement automated fraud detection with human expertise.
86              
87             =head1 CONSTRUCTOR
88              
89             =over 4
90              
91             =item B<new>( %ARG )
92              
93             Creates a new L<Net::API::Stripe::Fraud::Review> object.
94             It may also take an hash like arguments, that also are method of the same name.
95              
96             =back
97              
98             =head1 METHODS
99              
100             =over 4
101              
102             =item B<id> string
103              
104             Unique identifier for the object.
105              
106             =item B<object> string, value is "review"
107              
108             String representing the object’s type. Objects of the same type share the same value.
109              
110             =item B<billing_zip> string
111              
112             The ZIP or postal code of the card used, if applicable.
113              
114             =item B<charge> string (expandable)
115              
116             The charge associated with this review.
117              
118             When expanded, this is a L<Net::API::Stripe::Charge> object.
119              
120             =item B<closed_reason> string
121              
122             The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, or disputed.
123              
124             =item B<created> timestamp
125              
126             Time at which the object was created. Measured in seconds since the Unix epoch.
127              
128             =item B<ip_address> string
129              
130             The IP address where the payment originated.
131              
132             =item B<ip_address_location> hash
133              
134             Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address.
135              
136             This is a L<Net::API::Stripe::GeoLocation> object.
137              
138             =item B<livemode> boolean
139              
140             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
141              
142             =item B<open> boolean
143              
144             If true, the review needs action.
145              
146             =item B<opened_reason> string
147              
148             The reason the review was opened. One of rule or manual.
149              
150             =item B<payment_intent> string (expandable)
151              
152             The PaymentIntent ID associated with this review, if one exists.
153              
154             When expanded, this is a L<Net::API::Stripe::Payment::Intent> object.
155              
156             =item B<reason> string
157              
158             The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, or disputed.
159              
160             =item B<session> hash
161              
162             Information related to the browsing session of the user who initiated the payment.
163              
164             This is a L<Net::API::Stripe::Session> object.
165              
166             =back
167              
168             =head1 API SAMPLE
169              
170             {
171             "id": "prv_fake123456789",
172             "object": "review",
173             "billing_zip": null,
174             "charge": "ch_fake123456789",
175             "closed_reason": null,
176             "created": 1571480456,
177             "ip_address": null,
178             "ip_address_location": null,
179             "livemode": false,
180             "open": true,
181             "opened_reason": "rule",
182             "reason": "rule",
183             "session": null
184             }
185              
186             =head1 HISTORY
187              
188             =head2 v0.1
189              
190             Initial version
191              
192             =head1 AUTHOR
193              
194             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
195              
196             =head1 SEE ALSO
197              
198             Stripe API documentation:
199              
200             L<https://stripe.com/docs/api/radar/reviews>, L<https://stripe.com/radar>
201              
202             =head1 COPYRIGHT & LICENSE
203              
204             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
205              
206             You can use, copy, modify and redistribute this package and associated
207             files under the same terms as Perl itself.
208              
209             =cut