NAME

Business::GoCardless::Webhook::Event

DESCRIPTION

A class for gocardless webhook events, extends Business::GoCardless::Resource. For more details see the gocardless API documentation specific to webhooks: https://developer.gocardless.com/api-reference/#appendix-webhooks

ATTRIBUTES

id
created_at
action
resource_type
links
details
metadata
resource_metadata
customer_notifications
source

This class is used for events in webhooks, and for events from the events API endpoints (see "events" in Business::GoCardless::Pro).

resources

Returns an array of resource objects (Payment, Subscription, etc) that are present in the event allowing you to do things with them or update your own data:

if ( $Event->is_payment ) {

    foreach my $Payment ( $Event->resources ) {

        if ( $Event->action eq 'paid_out' ) {
            ...
        }
    }
}

Shortcut methods to get the type of data in the event, and thus the type of objects that will be returned by the call to ->resources

is_payment

True if the event is for payments

is_subscription

True if the event is for subscriptions

is_payout

True if the event is for payouts

is_mandate

True if the event is for mandates

is_refund

True if the event is for refunds

is_customer

True if the event is for customers

is_billing_request

True if the event is for billing requests

is_instalment_schedule

True if the event is for instalment schedules

is_creditor

True if the event is for creditors

is_outbound_payment

True if the event is for outbound payments