File Coverage

lib/Net/API/Stripe/Dispute.pm
Criterion Covered Total %
statement 19 36 52.7
branch n/a
condition n/a
subroutine 7 24 29.1
pod 17 17 100.0
total 43 77 55.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/usr/local/src/perl/Net-API-Stripe/lib/Net/API/Stripe/Dispute.pm
3             ## Version v0.101.0
4             ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2020/11/16
8             ## All rights reserved
9             ##
10             ## This program is free software; you can redistribute it and/or modify it
11             ## under the same terms as Perl itself.
12             ##----------------------------------------------------------------------------
13             ## https://stripe.com/docs/api/disputes/object
14             BEGIN
15             {
16             use strict;
17 2     2   24427309 use warnings;
  2         14  
  2         61  
18 2     2   13 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         58  
19 2     2   9 use vars qw( $VERSION );
  2         4  
  2         10  
20 2     2   137 our( $VERSION ) = 'v0.101.0';
  2         5  
  2         108  
21 2     2   39 };
22              
23             use strict;
24 2     2   10 use warnings;
  2         3  
  2         39  
25 2     2   9  
  2         5  
  2         709  
26              
27 0     0 1    
28              
29 0     0 1    
30             ## Array that contains Net::API::Stripe::Balance::Transaction
31 0     0 1    
32              
33 0     0 1    
34              
35              
36 0     0 1    
37              
38 0     0 1    
39              
40 0     0 1    
41              
42 0     0 1    
43              
44 0     0 1   1;
45              
46 0     0 1    
47             =encoding utf8
48 0     0 1    
49             =head1 NAME
50 0     0 1    
51             Net::API::Stripe::Dispute - A Stripe Dispute Object
52 0     0 1    
53             =head1 SYNOPSIS
54 0     0 1    
55             my $dispute = $stripe->dispute({
56 0     0 1   amount => 2000,
57             # could also use a Net::API::Stripe::Charge object
58 0     0 1   charge => 'ch_fake124567890',
59             currency => 'jpy',
60 0     0 1   # Or a Stripe transaction id such as trn_fake1234567890
61             disputed_transaction => $transaction_object,
62             evidence => $dispute_evidence_object,
63             is_charge_refundable => $stripe->true,
64             metadata => { transaction_id => 123, customer_id => 456 },
65             reason => 'insufficient_funds',
66             status => 'warning_needs_response',
67             });
68              
69             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
70              
71             =head1 VERSION
72              
73             v0.101.0
74              
75             =head1 DESCRIPTION
76              
77             From the documentation:
78              
79             A dispute occurs when a customer questions your charge with their card issuer. When this happens, you're given the opportunity to respond to the dispute with evidence that shows that the charge is legitimate. You can find more information about the dispute process in L<Stripe Disputes and Fraud documentation|https://stripe.com/docs/disputes>.
80              
81             =head1 CONSTRUCTOR
82              
83             =head2 new( %ARG )
84              
85             Creates a new L<Net::API::Stripe::Dispute> object.
86              
87             =head1 METHODS
88              
89             =head2 id string
90              
91             Unique identifier for the object.
92              
93             =head2 object string, value is "dispute"
94              
95             String representing the object’s type. Objects of the same type share the same value.
96              
97             =head2 amount integer
98              
99             Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed).
100              
101             =head2 balance_transaction
102              
103             It seems this property is removed from the API documentation or maybe an omission?
104              
105             This is an id or a L<Net::API::Stripe::Balance::Transaction> object.
106              
107             =head2 balance_transactions array, contains: balance_transaction object
108              
109             List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute.
110              
111             This is an array of L<Net::API::Stripe::Balance::Transaction> objects.
112              
113             =head2 charge string (expandable)
114              
115             ID of the charge that was disputed or an L<Net::API::Stripe::Charge> object.
116              
117             =head2 created timestamp
118              
119             Time at which the object was created. Measured in seconds since the Unix epoch.
120              
121             =head2 currency currency
122              
123             Three-letter ISO currency code, in lowercase. Must be a supported currency.
124              
125             =head2 disputed_transaction string (expandable)
126              
127             When expanded, this is a L<Net::API::Stripe::Balance::Transaction> object.
128              
129             =head2 evidence hash
130              
131             Evidence provided to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review.
132              
133             Below is the list of types and also L<available on the web|https://stripe.com/docs/disputes/categories>.
134              
135             =over 4
136              
137             =item * access_activity_log
138              
139             =item * billing_address
140              
141             =item * cancellation_policy
142              
143             =item * cancellation_policy_disclosure
144              
145             =item * cancellation_rebuttal
146              
147             =item * customer_communication
148              
149             =item * customer_email_address
150              
151             =item * customer_name
152              
153             =item * customer_purchase_ip
154              
155             =item * customer_signature
156              
157             =item * duplicate_charge_documentation
158              
159             =item * duplicate_charge_explanation
160              
161             =item * duplicate_charge_id
162              
163             =item * product_description
164              
165             =item * receipt
166              
167             =item * refund_policy
168              
169             =item * refund_policy_disclosure
170              
171             =item * refund_refusal_explanation
172              
173             =item * service_date
174              
175             =item * service_documentation
176              
177             =item * shipping_address
178              
179             =item * shipping_carrier
180              
181             =item * shipping_date
182              
183             =item * shipping_documentation
184              
185             =item * shipping_tracking_number
186              
187             =item * uncategorized_file
188              
189             =item * uncategorized_text
190              
191             =back
192              
193             =head2 evidence_details hash
194              
195             Information about the evidence submission. This is a L<Net::API::Stripe::Dispute::EvidenceDetails> object.
196              
197             =head2 is_charge_refundable boolean
198              
199             If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute.
200              
201             =head2 livemode boolean
202              
203             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
204              
205             =head2 metadata hash
206              
207             Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
208              
209             =head2 payment_intent expandable
210              
211             ID of the PaymentIntent that was disputed.
212              
213             When expanded this is an L<Net::API::Stripe::Payment::Intent> object.
214              
215             =head2 reason string
216              
217             Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons.
218              
219             =head2 status string
220              
221             Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, charge_refunded, won, or lost.
222              
223             =head1 API SAMPLE
224              
225             {
226             "id": "dp_fake123456789",
227             "object": "dispute",
228             "amount": 1000,
229             "balance_transactions": [],
230             "charge": "ch_fake123456789",
231             "created": 1571197169,
232             "currency": "jpy",
233             "evidence": {
234             "access_activity_log": null,
235             "billing_address": null,
236             "cancellation_policy": null,
237             "cancellation_policy_disclosure": null,
238             "cancellation_rebuttal": null,
239             "customer_communication": null,
240             "customer_email_address": null,
241             "customer_name": null,
242             "customer_purchase_ip": null,
243             "customer_signature": null,
244             "duplicate_charge_documentation": null,
245             "duplicate_charge_explanation": null,
246             "duplicate_charge_id": null,
247             "product_description": null,
248             "receipt": null,
249             "refund_policy": null,
250             "refund_policy_disclosure": null,
251             "refund_refusal_explanation": null,
252             "service_date": null,
253             "service_documentation": null,
254             "shipping_address": null,
255             "shipping_carrier": null,
256             "shipping_date": null,
257             "shipping_documentation": null,
258             "shipping_tracking_number": null,
259             "uncategorized_file": null,
260             "uncategorized_text": null
261             },
262             "evidence_details": {
263             "due_by": 1572911999,
264             "has_evidence": false,
265             "past_due": false,
266             "submission_count": 0
267             },
268             "is_charge_refundable": true,
269             "livemode": false,
270             "metadata": {},
271             "reason": "general",
272             "status": "warning_needs_response"
273             }
274              
275             =head1 HISTORY
276              
277             =head2 v0.1
278              
279             Initial version
280              
281             =head1 AUTHOR
282              
283             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
284              
285             =head1 SEE ALSO
286              
287             Stripe API documentation:
288              
289             L<https://stripe.com/docs/api/disputes>, L<https://stripe.com/docs/disputes>
290              
291             =head1 COPYRIGHT & LICENSE
292              
293             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
294              
295             You can use, copy, modify and redistribute this package and associated
296             files under the same terms as Perl itself.
297              
298             =cut