【发布时间】:2021-06-01 09:50:38
【问题描述】:
我正在使用 ReactPlaidLink 构建一个应用程序来检索用户交易历史并将其显示在前端。我现在的目标是让 webhook 在指定的端点触发。我设置了一个端点来监听使用 webhook.site 和 requestbin 的请求,但没有看到请求通过。我已经在 React-Plaid 中指定了端点。根据我对文档的理解,指定 webhook 参数是 webhook 触发正确端点所必需的。当谈到 webhook 时,我绝对是一个新手,我希望我不会错过一些非常明显的东西。希望您能提供任何见解。
<PlaidLinkButton
buttonProps={{
className:
"btn btn-large waves-effect waves-light hoverable blue accent-3 main-btn"
}}
plaidLinkProps={{
clientName: "BankLinker",
key:" ",
token: "my-token",
env: "sandbox",
product: ["transactions"],
webhook: 'https://webhook.site/465538a7-f2a5-4d55-b017-db23b949ef91',
onSuccess: this.handleOnSuccess,
}}
onScriptLoad={() => this.setState({ loaded: true })}
>
Add Account
</PlaidLinkButton>```
and HandleSuccess
```handleOnSuccess = (token, metadata) => {
const { accounts } = this.props;
const plaidData = {
public_token: token,
metadata: metadata,
accounts: accounts,
// webhook: "https://webhook.site/465538a7-f2a5-4d55-b017-db23b949ef91",
};
this.props.addAccount(plaidData);
};
【问题讨论】: