gpt4 book ai didi

javascript - Facebook Messenger,发送回执时暂时发送消息失败

转载 作者:行者123 更新时间:2023-11-30 07:02:05 24 4
gpt4 key购买 nike

我想用虚拟数据向用户发送我的收据。

我使用 this library这简化了向 Facebook 发送消息的过程。

我的有效载荷的结构是这样的:

var payload = {
template_type: 'receipt',
recipient_name: '@' + user.name + ' ' + user.surname,
order_number: (new Date).getTime(),
currency: 'USD',
payment_method: 'Наличными',
order_url: 'http://www.example.com',
timestamp: (new Date).getTime() + '',
elements: [
{
title: title,
subtitle: subtitle,
quantity: 1,
price: 20,
currency: 'USD',
image_url: image_url
}
],
address: {
street_1:"Nurly tau",
street_2:"",
city:"Almaty",
postal_code:"050000",
state:"KZ",
country:"KZ"
},
summary: {
subtotal: 20,
shipping_cost: 0,
total_tax: 0,
total_cost: 20
},
adjustments: []
};

我刚刚用简单的假数据填充了收据字段。此外,Facebook 会跟踪所有已发送收据的 order_numbers 的唯一性。

当我尝试发送此收据时,我收到一条错误消息:

{ message: '(#1200) Temporary send message failure. Please try again later',
type: 'OAuthException',
code: 1200,
fbtrace_id: 'BHmHRCEQUC4' }

这个错误是什么意思? Facebook 的错误信息如此神秘?

最佳答案

我刚刚遇到了同样的问题,经过一番摆弄后我弄明白了!问题是,当您使用 (new Date).getTime() 构建时间戳时,它会返回自纪元以来的毫秒数。但是,Facebook 要求它以秒为单位。

关于javascript - Facebook Messenger,发送回执时暂时发送消息失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36749184/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com