| 1 | ##---------------------------------------------------------------------------- | ||
| 2 | ## Stripe API - ~/lib/Net/API/Stripe/WebHook.pm | ||
| 3 | ## Version v0.100.0 | ||
| 4 | ## Copyright(c) 2020 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; | ||
| 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
| |||
| 15 | 1 | ▶ | our( $VERSION ) = 'v0.100.0'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | }; | ||
| 17 | |||
| 18 | ## Creating a web hook | ||
| 19 | |||
| 20 | 1 | 1; | |
| 21 | |||
| 22 | __END__ | ||
| 23 | |||
| 24 | =encoding utf8 | ||
| 25 | |||
| 26 | =head1 NAME | ||
| 27 | |||
| 28 | Net::API::Stripe::WebHook - An interface to manage and handle Stripe WebHooks | ||
| 29 | |||
| 30 | =head1 VERSION | ||
| 31 | |||
| 32 | v0.100.0 | ||
| 33 | |||
| 34 | =head1 DESCRIPTION | ||
| 35 | |||
| 36 | Create a webhook: | ||
| 37 | |||
| 38 | curl https://api.stripe.com/v1/webhook_endpoints \ | ||
| 39 | -u sk_test_khaffUjkDalUfkLhWD: \ | ||
| 40 | -d url="https://example.com/my/webhook/endpoint" \ | ||
| 41 | -d "enabled_events[]=charge.failed" \ | ||
| 42 | -d "enabled_events[]=charge.succeeded" | ||
| 43 | |||
| 44 | See L<Net::API::Stripe::WebHook::Apache> for detail of implementation using Apache with mod_perl and L<Net::API::Stripe::WebHook::Object> for the Stripe WebHook object. | ||
| 45 | |||
| 46 | =head1 API SAMPLE | ||
| 47 | |||
| 48 | { | ||
| 49 | "id": "we_fake123456789", | ||
| 50 | "object": "webhook_endpoint", | ||
| 51 | "api_version": "2017-02-14", | ||
| 52 | "application": null, | ||
| 53 | "created": 1542006805, | ||
| 54 | "enabled_events": [ | ||
| 55 | "invoice.created", | ||
| 56 | "invoice.payment_failed", | ||
| 57 | "invoice.payment_succeeded" | ||
| 58 | ], | ||
| 59 | "livemode": false, | ||
| 60 | "status": "enabled", | ||
| 61 | "url": "http://expugno.serveo.net/stripe/invoice" | ||
| 62 | } | ||
| 63 | |||
| 64 | =head1 HISTORY | ||
| 65 | |||
| 66 | =head2 v0.1 | ||
| 67 | |||
| 68 | Initial version | ||
| 69 | |||
| 70 | =head1 AUTHOR | ||
| 71 | |||
| 72 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||
| 73 | |||
| 74 | =head1 SEE ALSO | ||
| 75 | |||
| 76 | Stripe API documentation: | ||
| 77 | |||
| 78 | L<https://stripe.com/docs/api/webhook_endpoints>, | ||
| 79 | L<https://stripe.com/docs/webhooks/configure>, | ||
| 80 | L<https://stripe.com/docs/api/events/types>, | ||
| 81 | L<https://stripe.com/docs/api/webhook_endpoints/list?lang=curl>, | ||
| 82 | L<https://stripe.com/docs/webhooks/signatures>, | ||
| 83 | L<https://stripe.com/docs/webhooks/best-practices#event-handling> | ||
| 84 | |||
| 85 | =head1 COPYRIGHT & LICENSE | ||
| 86 | |||
| 87 | Copyright (c) 2019-2020 DEGUEST Pte. Ltd. | ||
| 88 | |||
| 89 | You can use, copy, modify and redistribute this package and associated | ||
| 90 | files under the same terms as Perl itself. | ||
| 91 | |||
| 92 | =cut | ||