格子 - payment_status_input_needed

发布于 2025-01-25 06:28:48 字数 1784 浏览 3 评论 0原文

我在购物车上工作了格子付款启动,但是由于某种原因,所有付款的状态都为“ payment_status_input_needed”。

另外,只有在拨打“ plaid.create”呼叫时省略了“接收的雷德雷克里”时,我才能上班。如果我包括它,格子会引发以下错误:

display_message: null
documentation_url: "https://plaid.com/docs/?ref=error#invalid-request-errors"
error_code: "INVALID_FIELD"
error_message: "oauth_continuation.link_token does not match session"
error_type: "INVALID_REQUEST"
request_id: "aseWi7KyiQwxuVE"
suggested_action: null

有人遇到这个错误吗?格子的文档似乎没有涵盖这一点。这就是我的功能。

async plaidPay() {
    let amount = this.cart[0].item.amount * this.cart[0].quantity;
    console.log(window.location.href);
    
    const linkToken = await this.$axios({
    method: 'post',
    url: 'api/plaid-create-payment',
    data: { amount: amount },
    config: { headers: { 'Content-Type': 'application/json' }}
    })
    .then(res => {
        return res.data.link_token;
        
    })
    .catch(e => {
        console.log(e)
    })

    console.log(linkToken);

    const handler = window.Plaid.create({
        token: linkToken,
        onSuccess: (public_token, metadata) => {
            console.log('test 1');
            console.log(public_token);
            console.log(metadata);
        },
        onLoad: () => {
            console.log('test 2');
        },
        onExit: (err, metadata) => {
            console.log('test 3');
            console.log(err);
            console.log(metadata);
        },
        onEvent: (eventName, metadata) => {
            console.log('test 4');
            console.log(eventName);
            console.log(metadata);
        },
        //required for OAuth; if not using OAuth, set to null or omit:
        receivedRedirectUri: window.location.href,
    });

    handler.open();   
}

I've got Plaid payment initiation working on my cart but for some reason, all payments have the status of "PAYMENT_STATUS_INPUT_NEEDED".

Also, I can only get Plaid to work if "receivedRedirectUri" is omitted when making the "plaid.Create" call. If I include it, Plaid throws the following error:

display_message: null
documentation_url: "https://plaid.com/docs/?ref=error#invalid-request-errors"
error_code: "INVALID_FIELD"
error_message: "oauth_continuation.link_token does not match session"
error_type: "INVALID_REQUEST"
request_id: "aseWi7KyiQwxuVE"
suggested_action: null

Has anyone come across this? Plaid's docs don't seem to cover this. This is what my function looks like.

async plaidPay() {
    let amount = this.cart[0].item.amount * this.cart[0].quantity;
    console.log(window.location.href);
    
    const linkToken = await this.$axios({
    method: 'post',
    url: 'api/plaid-create-payment',
    data: { amount: amount },
    config: { headers: { 'Content-Type': 'application/json' }}
    })
    .then(res => {
        return res.data.link_token;
        
    })
    .catch(e => {
        console.log(e)
    })

    console.log(linkToken);

    const handler = window.Plaid.create({
        token: linkToken,
        onSuccess: (public_token, metadata) => {
            console.log('test 1');
            console.log(public_token);
            console.log(metadata);
        },
        onLoad: () => {
            console.log('test 2');
        },
        onExit: (err, metadata) => {
            console.log('test 3');
            console.log(err);
            console.log(metadata);
        },
        onEvent: (eventName, metadata) => {
            console.log('test 4');
            console.log(eventName);
            console.log(metadata);
        },
        //required for OAuth; if not using OAuth, set to null or omit:
        receivedRedirectUri: window.location.href,
    });

    handler.open();   
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枫以 2025-02-01 06:28:48

我认为这个问题是通过格子支持来处理的,但是对于那些谷歌搜索的后代和好处,问题似乎是您首次启动链接时正在使用Readyredrecturi启动。从OAuth流返回后,仅在重新定义链接时才包括此字段。

I think this question is being handled by Plaid support, but for posterity and the benefit of those Googling, the issue seems to be that you are launching with receivedRedirectUri the first time you launch Link. This field should only be included when reinitializating Link, after returning from the OAuth flow.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文