Business::GoCardless::Webhook
A class for gocardless webhooks, extends Business::GoCardless::Resource. For more details see the gocardless API documentation specific to webhooks: https://developer.gocardless.com/#webhook-overview
resource_type action
Allows you to set the json data sent to you in the webhook:
$Webhook->json( $json_data )
Will throw a Business::GoCardless::Exception exception if the json fails to parse or if the signature does not match the payload data.
Returns an array of resource objects (Bill, Subscription, etc) that are present in webhook allowing you to do things with them or update your own data:
if ( $Webhook->is_bill ) { foreach my $Bill ( $Webhook->resources ) { ... } } elsif ( $Webhook->is_subscription ) { ...
Shortcut methods to get the type of data in the webhook, and thus the type of objects that will be returned by the call to ->resources
See if the webhook is a legacy (Basic API) webhook
if ( $Webhook->is_legacy ) { ... }
According to the gocardless API docs you should respond once the signature of the webhook has been checked. The response is a HTTP status 200 code:
HTTP/1.1 200 OK
You should handle this in your own code, the library will not do it for you. See https://developer.gocardless.com/#response for more information
Lee Johnson - leejo@cpan.org
leejo@cpan.org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you would like to contribute documentation, features, bug fixes, or anything else then please raise an issue / pull request:
https://github.com/Humanstate/business-gocardless
To install Business::GoCardless, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::GoCardless
CPAN shell
perl -MCPAN -e shell install Business::GoCardless
For more information on module installation, please visit the detailed CPAN module installation guide.