mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 00:40:56 -04:00
Working on gocardless
This commit is contained in:
parent
a7afa16c69
commit
9f350c0c5b
@ -82,6 +82,27 @@ class GoCardlessV2RedirectPaymentDriver extends BasePaymentDriver
|
|||||||
\Log::info('handleWebHook... ' . $_SERVER['HTTP_WEBHOOK_SIGNATURE']);
|
\Log::info('handleWebHook... ' . $_SERVER['HTTP_WEBHOOK_SIGNATURE']);
|
||||||
\Log::info(json_encode($input));
|
\Log::info(json_encode($input));
|
||||||
|
|
||||||
|
/*
|
||||||
|
// We recommend storing your webhook endpoint secret in an environment variable
|
||||||
|
// for security, but you could include it as a string directly in your code
|
||||||
|
$token = getenv("GC_WEBHOOK_SECRET");
|
||||||
|
|
||||||
|
$raw_payload = file_get_contents('php://input');
|
||||||
|
|
||||||
|
$headers = getallheaders();
|
||||||
|
$provided_signature = $headers["Webhook-Signature"];
|
||||||
|
|
||||||
|
$calculated_signature = hash_hmac("sha256", $raw_payload, $token);
|
||||||
|
|
||||||
|
if ($provided_signature == $calculated_signature) {
|
||||||
|
// Process the events...
|
||||||
|
|
||||||
|
header("HTTP/1.1 200 OK");
|
||||||
|
} else {
|
||||||
|
header("HTTP/1.1 498 Invalid Token");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$event = $this->gateway()->parseNotification(
|
$event = $this->gateway()->parseNotification(
|
||||||
file_get_contents('php://input'),
|
file_get_contents('php://input'),
|
||||||
$_SERVER['HTTP_WEBHOOK_SIGNATURE']
|
$_SERVER['HTTP_WEBHOOK_SIGNATURE']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user