首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Facebook Messenger bot购买按钮

Facebook Messenger bot购买按钮
EN

Stack Overflow用户
提问于 2017-02-18 21:58:20
回答 1查看 584关注 0票数 1

我试图在我的信使机器人中实现“购买”按钮,但是得到以下两个错误:

代码语言:javascript
运行
复制
{"error":{"message":"(#-1) Send API unexpected internal error","type":"OAuthException","code":-1,"error_subcode":2018012,"fbtrace_id":"BN47MpNqWNN"}} 

{"error":{"message":"(#100) Invalid button type","type":"OAuthException","code":100,"error_subcode":2018037,"fbtrace_id":"Agfk\/h+cEta"}}

有什么想法吗?我在哪里能查到这些错误代码?这是我要发送给Facebook的信使API的信息:

代码语言:javascript
运行
复制
{'message': {'attachment': {'type': 'template', 'payload': {'text': 'Please checkout.', 'template_type': 'button', 'buttons': [{'payment_summary': {'merchant_name': "Peter's Apparel", 'currency': 'USD', 'payment_type': 'FIXED_AMOUNT', 'price_list': [{'amount': '29.99', 'label': 'Subtotal'}, {'amount': '2.47', 'label': 'Taxes'}], 'requested_user_info': ['contact_name'], 'is_test_payment': True}, 'type': 'payment', 'payload': 'DEVELOPER_DEFINED_PAYLOAD', 'title': 'buy'}, {'type': 'postback', 'payload': '{"title": "Confirm Order", "event_value": "", "event_name": "confirm_order"}', 'title': 'Confirm Order'}, {'type': 'postback', 'payload': '{"title": "Add Coupon Code", "event_value": "", "event_name": "add_coupon"}', 'title': 'Add Coupon Code'}]}}}, 'recipient': {'id': '1232211580183568'}}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-19 14:32:04

“Button只适用于通用模板和列表模板,它必须是第一个按钮。”

您的模板类型是“按钮”。尝试将template_type更改为泛型或列表。此外,确保你有机会进入测试版的支付程序。

参考资料:https://developers.facebook.com/docs/messenger-platform/send-api-reference/buy-button

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42321143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档