File Coverage

lib/Net/API/Stripe/Charge/Outcome.pm
Criterion Covered Total %
statement 19 26 73.0
branch n/a
condition n/a
subroutine 7 14 50.0
pod 7 7 100.0
total 33 47 70.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Charge/Outcome.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::Charge::Outcome;
11             BEGIN
12             {
13 2     2   21161110 use strict;
  2         17  
  2         65  
14 2     2   10 use warnings;
  2         4  
  2         64  
15 2     2   15 use parent qw( Net::API::Stripe::Generic );
  2         6  
  2         11  
16 2     2   177 use vars qw( $VERSION );
  2         4  
  2         129  
17 2     2   42 our( $VERSION ) = 'v0.100.0';
18             };
19              
20 2     2   11 use strict;
  2         3  
  2         42  
21 2     2   9 use warnings;
  2         4  
  2         354  
22              
23 0     0 1   sub network_status { return( shift->_set_get_scalar( 'network_status', @_ ) ); }
24              
25 0     0 1   sub reason { return( shift->_set_get_scalar( 'reason', @_ ) ); }
26              
27 0     0 1   sub risk_level { return( shift->_set_get_scalar( 'risk_level', @_ ) ); }
28              
29 0     0 1   sub risk_score { return( shift->_set_get_scalar( 'risk_score', @_ ) ); }
30              
31 0     0 1   sub rule { return( shift->_set_get_scalar( 'rule', @_ ) ); }
32              
33 0     0 1   sub seller_message { return( shift->_set_get_scalar( 'seller_message', @_ ) ); }
34              
35 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
36              
37             1;
38              
39             __END__
40              
41             =encoding utf8
42              
43             =head1 NAME
44              
45             Net::API::Stripe::Charge::Outcome - A Stripe Charge Outcome Object
46              
47             =head1 SYNOPSIS
48              
49             my $outcome = $stripe->charge->outcome({
50             network_status => 'approved_by_network',
51             reason => undef,
52             risk_level => 'normal',
53             risk_score => 0,
54             rule => undef,
55             seller_message => undef,
56             type => 'authorized',
57             });
58              
59             =head1 VERSION
60              
61             v0.100.0
62              
63             =head1 DESCRIPTION
64              
65             Details about whether the payment was accepted, and why. See understanding declines for details.
66              
67             =head1 CONSTRUCTOR
68              
69             =head2 new( %ARG )
70              
71             Creates a new L<Net::API::Stripe::Charge::Outcome> object.
72             It may also take an hash like arguments, that also are method of the same name.
73              
74             =head1 METHODS
75              
76             =head2 network_status string
77              
78             Possible values are approved_by_network, declined_by_network, not_sent_to_network, and reversed_after_approval. The value reversed_after_approval indicates the payment was blocked by Stripe after bank authorization, and may temporarily appear as “pending” on a cardholder’s statement.
79              
80             =head2 reason string
81              
82             An enumerated value providing a more detailed explanation of the outcome’s type. Charges blocked by Radar’s default block rule have the value highest_risk_level. Charges placed in review by Radar’s default review rule have the value elevated_risk_level. Charges authorized, blocked, or placed in review by custom rules have the value rule. See understanding declines for more details.
83              
84             =head2 risk_level string
85              
86             Stripe’s evaluation of the riskiness of the payment. Possible values for evaluated payments are normal, elevated, highest. For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value not_assessed. In the event of an error in the evaluation, this field will have the value unknown.
87              
88             =head2 risk_score integer
89              
90             Stripe’s evaluation of the riskiness of the payment. Possible values for evaluated payments are between 0 and 100. For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. This field is only available with Radar for Fraud Teams.
91              
92             =head2 rule string (expandable)
93              
94             The ID of the Radar rule that matched the payment, if applicable.
95              
96             =head2 seller_message string
97              
98             A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer.
99              
100             =head2 type string
101              
102             Possible values are authorized, manual_review, issuer_declined, blocked, and invalid. See understanding declines and Radar reviews for details.
103              
104             =head1 API SAMPLE
105              
106             {
107             "id": "ch_fake123456789",
108             "object": "charge",
109             "amount": 100,
110             "amount_refunded": 0,
111             "application": null,
112             "application_fee": null,
113             "application_fee_amount": null,
114             "balance_transaction": "txn_fake123456789",
115             "billing_details": {
116             "address": {
117             "city": null,
118             "country": null,
119             "line1": null,
120             "line2": null,
121             "postal_code": null,
122             "state": null
123             },
124             "email": null,
125             "name": null,
126             "phone": null
127             },
128             "captured": false,
129             "created": 1571176460,
130             "currency": "jpy",
131             "customer": null,
132             "description": "My First Test Charge (created for API docs)",
133             "dispute": null,
134             "failure_code": null,
135             "failure_message": null,
136             "fraud_details": {},
137             "invoice": null,
138             "livemode": false,
139             "metadata": {},
140             "on_behalf_of": null,
141             "order": null,
142             "outcome": null,
143             "paid": true,
144             "payment_intent": null,
145             "payment_method": "card_fake123456789",
146             "payment_method_details": {
147             "card": {
148             "brand": "visa",
149             "checks": {
150             "address_line1_check": null,
151             "address_postal_code_check": null,
152             "cvc_check": null
153             },
154             "country": "US",
155             "exp_month": 4,
156             "exp_year": 2024,
157             "fingerprint": "fake123456789",
158             "funding": "credit",
159             "installments": null,
160             "last4": "4242",
161             "network": "visa",
162             "three_d_secure": null,
163             "wallet": null
164             },
165             "type": "card"
166             },
167             "receipt_email": null,
168             "receipt_number": null,
169             "receipt_url": "https://pay.stripe.com/receipts/acct_fake123456789/ch_fake123456789/rcpt_fake123456789",
170             "refunded": false,
171             "refunds": {
172             "object": "list",
173             "data": [],
174             "has_more": false,
175             "url": "/v1/charges/ch_fake123456789/refunds"
176             },
177             "review": null,
178             "shipping": null,
179             "source_transfer": null,
180             "statement_descriptor": null,
181             "statement_descriptor_suffix": null,
182             "status": "succeeded",
183             "transfer_data": null,
184             "transfer_group": null
185             }
186              
187             =head1 HISTORY
188              
189             =head2 v0.1
190              
191             Initial version
192              
193             =head1 AUTHOR
194              
195             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
196              
197             =head1 SEE ALSO
198              
199             Stripe API documentation:
200              
201             L<https://stripe.com/docs/api/charges/object>
202              
203             =head1 COPYRIGHT & LICENSE
204              
205             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
206              
207             You can use, copy, modify and redistribute this package and associated
208             files under the same terms as Perl itself.
209              
210             =cut