crucialwebstudio / chargify-sdk-php

Chargify SDK for PHP
Apache License 2.0
26 stars 44 forks source link

Implemented webhook handler #11 #14

Closed Powerhead13 closed 7 years ago

Powerhead13 commented 7 years ago

Added Chargify webhook handler

 # 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();
dan-bowen commented 7 years ago

Hello,

Thank you for your interest in the project. I'm really sorry for the slow response to this but I wanted to at least give some feedback on your efforts here.

This appears to simply log incoming webhook parameters to a file. Logging functionality is something that would need a much more thorough and generic implementation than what you have here for just webhooks. I'm going to close this for now since "generic logging functionality" should be a library-wide feature, not limited to webhooks only.

Thanks again for your interest in the project.