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