Braintree release notification not working

I used a Sandbox account for Braintree for recurring subscribers. Verification of the final URL of the web host completed successfully. But I didn't receive any push notifications on my server even after the subscription was successful. I am using PHP framework to get POST details. Below is the code segment.

<?php

require_once(app_classes.'DB.Class.php');
require_once(app_classes.'util.Class.php');
require_once app_classes.'braintree/lib/Braintree.php';
Braintree_Configuration::environment(bt_environment);
Braintree_Configuration::merchantId(bt_merchant_id);
Braintree_Configuration::publicKey(bt_public_key);
Braintree_Configuration::privateKey(bt_private_key);

if(
     isset($_POST["bt_signature"]) &&
     isset($_POST["bt_payload"])
) {
    $webhookNotification = Braintree_WebhookNotification::parse(
        $_POST["bt_signature"], $_POST["bt_payload"]
);

$message =    "[Webhook Received " . $webhookNotification->timestamp->format('Y-m-d H:i:s') . "] "
        . "Kind: " . $webhookNotification->kind . " | "
                . "Subscription: " . $webhookNotification->subscription->id . "\n";

$subDetails = array( 'data' => $message );
DB::insert('subscription_notifications', $subDetails);
}
return 200;
?>

      

The server is SSL certified. Please let me know if there is anything I need to do to make it work.

+3


source to share


1 answer


Finally I got a solution. This was an SSL certificate issue. The connection is closed with HTTP status 599 for all POST attempts. This happened due to the lack of an intermediate certificate on the server. We've added a certificate. I can now access push notifications from Braintree.



+2


source







All Articles