File Coverage

lib/Net/API/Stripe/Payment/Source/Redirect.pm
Criterion Covered Total %
statement 19 23 82.6
branch n/a
condition n/a
subroutine 7 11 63.6
pod 4 4 100.0
total 30 38 78.9


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Payment/Source/Redirect.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             BEGIN
11             {
12             use strict;
13 2     2   24506316 use warnings;
  2         13  
  2         64  
14 2     2   12 use parent qw( Net::API::Stripe::Generic );
  2         8  
  2         60  
15 2     2   10 use vars qw( $VERSION );
  2         5  
  2         11  
16 2     2   142 our( $VERSION ) = 'v0.100.0';
  2         5  
  2         115  
17 2     2   37 };
18              
19             use strict;
20 2     2   12 use warnings;
  2         6  
  2         53  
21 2     2   12  
  2         4  
  2         261  
22              
23 0     0 1    
24              
25 0     0 1    
26             1;
27 0     0 1    
28              
29 0     0 1   =encoding utf8
30              
31             =head1 NAME
32              
33             Net::API::Stripe::Payment::Source::Redirect - A Stripe Payment Redirect
34              
35             =head1 SYNOPSIS
36              
37             my $redirect = $stripe->source->redirect({
38             failure_reason => 'user_abort',
39             return_url => 'https://example.com/return',
40             status => 'failed',
41             url => 'https://example.com/auth',
42             });
43              
44             =head1 VERSION
45              
46             v0.100.0
47              
48             =head1 DESCRIPTION
49              
50             Information related to the redirect flow. Present if the source is authenticated by a redirect (flow is redirect).
51              
52             This is part of the L<Net::API::Stripe::Payment::Source> object
53              
54             =head1 CONSTRUCTOR
55              
56             =head2 new( %ARG )
57              
58             Creates a new L<Net::API::Stripe::Payment::Source::Redirect> object.
59             It may also take an hash like arguments, that also are method of the same name.
60              
61             =head1 METHODS
62              
63             =head2 failure_reason string
64              
65             The failure reason for the redirect, either user_abort (the customer aborted or dropped out of the redirect flow), declined (the authentication failed or the transaction was declined), or processing_error (the redirect failed due to a technical error). Present only if the redirect status is failed.
66              
67             =head2 return_url string
68              
69             The URL you provide to redirect the customer to after they authenticated their payment.
70              
71             This is a L<URI> object.
72              
73             =head2 status string
74              
75             The status of the redirect, either pending (ready to be used by your customer to authenticate the transaction), succeeded (succesful authentication, cannot be reused) or not_required (redirect should not be used) or failed (failed authentication, cannot be reused).
76              
77             =head2 url string
78              
79             The URL provided to you to redirect a customer to as part of a redirect authentication flow.
80              
81             This is a L<URI> object.
82              
83             =head1 API SAMPLE
84              
85             {
86             "id": "src_fake123456789",
87             "object": "source",
88             "ach_credit_transfer": {
89             "account_number": "test_52796e3294dc",
90             "routing_number": "110000000",
91             "fingerprint": "ecpwEzmBOSMOqQTL",
92             "bank_name": "TEST BANK",
93             "swift_code": "TSTEZ122"
94             },
95             "amount": null,
96             "client_secret": "src_client_secret_fake123456789",
97             "created": 1571314413,
98             "currency": "jpy",
99             "flow": "receiver",
100             "livemode": false,
101             "metadata": {},
102             "owner": {
103             "address": null,
104             "email": "jenny.rosen@example.com",
105             "name": null,
106             "phone": null,
107             "verified_address": null,
108             "verified_email": null,
109             "verified_name": null,
110             "verified_phone": null
111             },
112             "receiver": {
113             "address": "121042882-38381234567890123",
114             "amount_charged": 0,
115             "amount_received": 0,
116             "amount_returned": 0,
117             "refund_attributes_method": "email",
118             "refund_attributes_status": "missing"
119             },
120             "statement_descriptor": null,
121             "status": "pending",
122             "type": "ach_credit_transfer",
123             "usage": "reusable"
124             }
125              
126             =head1 HISTORY
127              
128             =head2 v0.1
129              
130             Initial version
131              
132             =head1 AUTHOR
133              
134             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
135              
136             =head1 SEE ALSO
137              
138             Stripe API documentation:
139              
140             L<https://stripe.com/docs/api/sources/object>
141              
142             =head1 COPYRIGHT & LICENSE
143              
144             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
145              
146             You can use, copy, modify and redistribute this package and associated
147             files under the same terms as Perl itself.
148              
149             =cut