File Coverage

lib/Net/API/Stripe/WebHook/Object.pm
Criterion Covered Total %
statement 19 31 61.2
branch n/a
condition n/a
subroutine 7 19 36.8
pod 12 12 100.0
total 38 62 61.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/WebHook/Object.pm
3             ## Version v0.1.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   24106384 use warnings;
  2         14  
  2         65  
14 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         62  
15 2     2   9 use vars qw( $VERSION );
  2         7  
  2         14  
16 2     2   145 our( $VERSION ) = 'v0.1.0';
  2         5  
  2         129  
17 2     2   48 };
18              
19             use strict;
20 2     2   11 use warnings;
  2         5  
  2         55  
21 2     2   11  
  2         5  
  2         600  
22              
23 0     0 1   # Should be webhook_endpoint
24              
25              
26 0     0 1    
27              
28 0     0 1    
29             # * to enable all event, other array of event types
30 0     0 1    
31              
32 0     0 1    
33              
34 0     0 1   ## enabled or disabled
35              
36              
37 0     0 1   1;
38             # NOTE: POD
39 0     0 1    
40             =encoding utf8
41 0     0 1    
42             =head1 NAME
43 0     0 1    
44             Net::API::Stripe::WebHook::Object - An Stripe WebHook Object
45              
46 0     0 1   =head1 SYNOPSIS
47              
48 0     0 1   my $hook = $stripe->webhook({
49             api_version => '2020-03-02',
50             application => undef,
51             enabled_events => ['*'],
52             livemode => $stripe->false,
53             status => 'enabled',
54             url => 'https://api.example.con/stripe/CAC29A87-991E-44AF-8636-888E03082DDF',
55             });
56              
57             See documentation in L<Net::API::Stripe> for example to make api calls to Stripe to create those objects.
58              
59             =head1 VERSION
60              
61             v0.1.0
62              
63             =head1 DESCRIPTION
64              
65             This is a Stripe webhook endpoint object.
66              
67             =head1 CONSTRUCTOR
68              
69             =head2 new( %ARG )
70              
71             Creates a new L<Net::API::Stripe::WebHook::Object> 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 id string
77              
78             Unique identifier for the object.
79              
80             =head2 object string, value is "webhook_endpoint"
81              
82             String representing the object’s type. Objects of the same type share the same value.
83              
84             =head2 api_version string
85              
86             The API version events are rendered as for this webhook endpoint.
87              
88             =head2 application string
89              
90             The ID of the associated Connect application.
91              
92             =head2 created timestamp
93              
94             Time at which the object was created. Measured in seconds since the Unix epoch.
95              
96             =head2 description string
97              
98             An optional description of what the webhook is used for.
99              
100             =head2 enabled_events array containing strings
101              
102             The list of events to enable for this endpoint. You may specify ['*'] to enable all events.
103              
104             =head2 livemode boolean
105              
106             Has the value true if the object exists in live mode or the value false if the object exists in test mode.
107              
108             =head2 metadata hash
109              
110             Set of L<key-value pairs|https://stripe.com/docs/api/metadata> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
111              
112             =head2 secret string
113              
114             The endpoint’s secret, used to generate webhook signatures. Only returned at creation.
115              
116             =head2 status string
117              
118             The status of the webhook. It can be enabled or disabled.
119              
120             =head2 url string
121              
122             The URL of the webhook endpoint.
123              
124             =head1 API SAMPLE
125              
126             {
127             "id": "we_fake123456789",
128             "object": "webhook_endpoint",
129             "api_version": "2017-02-14",
130             "application": null,
131             "created": 1542006805,
132             "enabled_events": [
133             "invoice.created",
134             "invoice.payment_failed",
135             "invoice.payment_succeeded"
136             ],
137             "livemode": false,
138             "status": "enabled",
139             "url": "http://expugno.serveo.net/stripe/invoice"
140             }
141              
142             =head1 HISTORY
143              
144             =head2 v0.1
145              
146             Initial version
147              
148             =head1 AUTHOR
149              
150             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
151              
152             =head1 SEE ALSO
153              
154             Stripe API documentation:
155              
156             L<https://stripe.com/docs/api/webhook_endpoints>
157              
158             =head1 COPYRIGHT & LICENSE
159              
160             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
161              
162             You can use, copy, modify and redistribute this package and associated
163             files under the same terms as Perl itself.
164              
165             =cut