File Coverage

lib/Net/API/Stripe/Fraud/Review.pm
Criterion Covered Total %
statement 19 33 57.5
branch n/a
condition n/a
subroutine 7 21 33.3
pod 14 14 100.0
total 40 68 58.8


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