Facebook,信用付款过程错误,如何?
我实现了 facebook 积分中的示例,并创建了一个测试应用程序,在回调 URL 中添加了 callback.php
,正确放置了我的密钥。但我收到此错误:
Sorry, but we're having trouble processing your payment. You have not been charged for this transaction. Please try again.
我正在尝试创建一些具有不同货币值的按钮。就像:
Click to get 100 credits
Click to get 1000 credits
如果我使用这个通用代码,我可以很好地获得付款窗口,但我在那里看不到我的产品,我只能从已经制作的预设中进行选择:
function buyMore(){
// calling the API ...
var obj = {
app_id: 'xxxxxxxxxxxxxxxxxxxxx',
method: 'pay',
order_info: n,
purchase_type: 'item',
credits_purchase: true
};
为了向用户显示我的货币预设,我认为我需要传递不同的函数的值:
<p><a onclick="buyMore('100'); return false;">Buy More Credits 100</a></p>
<p><a onclick="buyMore('1000'); return false;">Buy More Credits 1000</a></p>
function buyMore(price) {
var order_info = {
"title":'title',
"description":'description',
"price":price,
"image_url":'http://....img_url',
"product_url":'http://....product_url'
};
// calling the API ...
var obj = {
app_id: '153230661424821',
method: 'pay',
order_info: order_info,
purchase_type: 'item'
};
}
不确定我是否正确。
有人能把我推向正确的方向吗?
I implement the example from facebook credits, and create an test app, added the callback.php
in the Callback Url, place my keys correctly. but I get this error:
Sorry, but we're having trouble processing your payment. You have not been charged for this transaction. Please try again.
I am trying to create a few buttons with different monetary values. Like:
Click to get 100 credits
Click to get 1000 credits
If I use this generic code, I get the payment window just fine, but I can't see my products there, I can only choose from already made presets :
function buyMore(){
// calling the API ...
var obj = {
app_id: 'xxxxxxxxxxxxxxxxxxxxx',
method: 'pay',
order_info: n,
purchase_type: 'item',
credits_purchase: true
};
to show the user my monetary presets I think I need to pass different values to the function:
<p><a onclick="buyMore('100'); return false;">Buy More Credits 100</a></p>
<p><a onclick="buyMore('1000'); return false;">Buy More Credits 1000</a></p>
function buyMore(price) {
var order_info = {
"title":'title',
"description":'description',
"price":price,
"image_url":'http://....img_url',
"product_url":'http://....product_url'
};
// calling the API ...
var obj = {
app_id: '153230661424821',
method: 'pay',
order_info: order_info,
purchase_type: 'item'
};
}
Not sure if I got it right.
Can anyone push me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您必须让用户选择他们想要购买的商品,然后调用 buyMore 函数让他们通过 Credits 对话框确认购买(就像您在第二个示例中所做的那样)。
我要做的第一件事就是检查开发者应用程序中的积分设置。我之前在新应用程序上遇到过这个错误,然后才意识到我忘记设置我的积分回调 URL 或将我的用户设置为积分测试用户。
Yeah, you'll have to have your users select the item they want to purchase, which will then call the buyMore function to have them confirm their purchase via the Credits dialog (like you're doing in your second example).
First thing I'd do is check my Credits setting in the Developer app though. I've gotten that error before on a new app before realizing I'd forgotten to set my credits callback URL or set my user as a Credits test user.
为什么要求用户购买一定数量的积分?
如果您要求用户购买商品(以积分定价)并且 Facebook 处理用户自己购买必要积分的步骤,那么流程肯定会更简单吗?
Why are you asking the user to buy a set number of credits?
Surely it's an easier flow if you ask the user to buy an item (priced in credits) and Facebook handles the step of the user buying the necessary credits themselves?