chargify-sdk-php
chargify-sdk-php copied to clipboard
How Can I use WebHooks?
I want to handle webhooks using this library.
Can you show me any code sample?
Thanks !
I've added PR for this. #14 Once it is approved, you will be able to handle webhooks in this way:
# Handle webhooks
$webhook = $chargify->webhook()->handle('webhook.log');
if($webhook) {
echo $webhook->getEvent() . PHP_EOL; // payment_success
echo $webhook->getId() . PHP_EOL; // 112233
print_r($webhook->getPayload()); // Array
}
// Generate fake webhook for testing
$webhook = $chargify->webhook()->handleFake();