douju5062 2015-09-25 22:30
浏览 102

Braintree webhooks,GET和POST配置

I am trying to use webhooks to send emails about whether subscriptions were successfully charged or not. I use bt_challenge code to successfully register the webhook on Braintree's dashboard:

if(isset($_GET["bt_challenge"])) {
    echo(Braintree_WebhookNotification::verify($_GET["bt_challenge"]));
}

However, when I use the subscription information from $webhook notification:

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

I don't get an email sent. Furthermore, when I try to re-register the webhook from the Braintree dashboard, it won't recognize it with this second snippet of code in the file. Are both of these snippets meant to be in the same file? This part is unclear to me.

Following these two snippets, I have my phpmailer code, which is properly configured and sends a email when the script is called not via webhook. The phpmailer code is not contained within the "if" statement of either of these first two code blocks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
    • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥120 计算机网络的新校区组网设计
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等