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