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