提问人:Abhishek kumar 提问时间:11/16/2023 最后编辑:Abhishek kumar 更新时间:11/16/2023 访问量:26
Wordpress 中的格子 Webhook 处理
Plaid Webhook Handling in Wordpress
问:
我正在开发的应用程序需要 webhook 集成,我对这个概念相当陌生,但试图尽可能多地遵循给定的文档并在 Plaid 上注册一个 webhook,这有效并且我确实得到了响应,问题是我无法理解他们发送的响应以及我应该如何处理它们。
这是我的 webhooks 代码,我将响应保存在 txt 文件中,我确实计划在此处添加逻辑以更新回数据库:
function custom_webhook($request){
$data = array( "status" => "success", "message" => "",
'type' => "custom_webhook");
$data_link = file_get_contents("php://input");
$directory = dirname(__FILE__);
$fp = fopen($directory . "/custom_webhook.txt", "w");
fwrite($fp, $data_link);
fclose($fp);
$data['data'] = null;
return new WP_REST_Response($data, 200);
}
这是我从 Plaid 得到的回复:
{
"environment": "sandbox",
"error": null,
"item_id": "HIDDEN_FOR_OBVIOUS_REASONS",
"webhook_code": "NEW_ACCOUNTS_AVAILABLE",
"webhook_type": "ITEM"
}
请告诉我我做错了什么,或者还需要做什么。
答: 暂无答案
评论