Net::API::Stripe::Event - A Stripe Event Object
my $evt = $stripe->event({ api_version => '2020-03-02', data => { object => $invoice_object, }, livemode => $stripe->false, pending_webhooks => 2, request => { id => 'req_HwlkQJshckjIsj', idempotency_key => '677A3112-FBAD-4804-BA61-CEF1CC13D155', }, type => 'invoice.created', });
See documentation in Net::API::Stripe for example to make api calls to Stripe to create those objects.
v0.101.0
Events are Stripe's way of letting you know when something interesting happens in your account. When an interesting event occurs, Stripe creates a new Event object. For example, when a charge succeeds, Stripe creates a charge.succeeded event; and when an invoice payment attempt fails, Stripe creates an invoice.payment_failed event. Note that many API requests may cause multiple events to be created. For example, if you create a new subscription for a customer, you will receive both a customer.subscription.created event and a charge.succeeded event.
Events occur when the state of another API resource changes. The state of that resource at the time of the change is embedded in the event's data field. For example, a charge.succeeded event will contain a charge, and an invoice.payment_failed event will contain an invoice.
As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. Stripe also have a separate webhooks system for sending the Event objects directly to an endpoint on your server. Webhooks are managed in your account settings, and Stripe's Using Webhooks guide will help you get set up.
When using Connect, you can also receive notifications of events that occur in connected accounts. For these events, there will be an additional account attribute in the received Event object.
Creates a new Net::API::Stripe::Event object. It may also take an hash like arguments, that also are method of the same name.
Unique identifier for the object.
String representing the object’s type. Objects of the same type share the same value.
The connected account that originated the event.
The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014.
Time at which the object was created. Measured in seconds since the Unix epoch.
Object containing data associated with the event. This is an Net::API::Stripe::Event::Data object
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you’ve specified.
Information on the API request that instigated the event. This is a Net::API::Stripe::Event::Request object.
Description of the event (e.g., invoice.created or charge.refunded).
{ "id": "evt_fake123456789", "object": "event", "api_version": "2017-02-14", "created": 1528914645, "data": { "object": { "object": "balance", "available": [ { "currency": "jpy", "amount": 1025751, "source_types": { "card": 1025751 } } ], "connect_reserved": [ { "currency": "jpy", "amount": 0 } ], "livemode": false, "pending": [ { "currency": "jpy", "amount": 0, "source_types": { "card": 0 } } ] } }, "livemode": false, "pending_webhooks": 0, "request": { "id": null, "idempotency_key": null }, "type": "balance.available" }
Initial version
Jacques Deguest <jack@deguest.jp>
Stripe API documentation:
https://stripe.com/docs/api/events#events, https://stripe.com/docs/api/events/types
Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install Net::API::Stripe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::API::Stripe
CPAN shell
perl -MCPAN -e shell install Net::API::Stripe
For more information on module installation, please visit the detailed CPAN module installation guide.