PHP code example of gocardless / gocardless-pro-php
1. Go to this page and download the library: Download gocardless/gocardless-pro-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// When you create a webhook endpoint, you can specify a secret. When GoCardless sends// you a webhook, it will sign the body using that secret. Since only you and GoCardless// know the secret, you can check the signature and ensure that the webhook is truly// from GoCardless.//// We recommend storing your webhook endpoint secret in an environment variable// for security, but you could hook.echo $event->id;
}
header('HTTP/1.1 200 OK');
} catch (GoCardlessPro\Core\Exception\InvalidSignatureException) {
// The webhook doesn't appear to be genuinely from GoCardless, as the signature//