我实现了来自facebook credits的示例,并创建了一个测试应用程序,在回调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'
};
}不确定我是不是弄对了。
有没有人能把我推向正确的方向?
发布于 2011-09-21 00:22:44
是的,你必须让你的用户选择他们想要购买的商品,然后调用buyMore函数,让他们通过Credits对话框确认他们的购买(就像你在第二个例子中所做的那样)。
我要做的第一件事是检查我在开发者应用程序中的信用设置。我以前在一个新的应用程序上遇到过这样的错误,直到我意识到我忘记了设置我的信用回调URL或将我的用户设置为信用测试用户。
发布于 2011-09-21 06:22:03
为什么要让用户购买一定数量的积分?
如果你要求用户购买一件商品(以积分计价),而Facebook处理用户自己购买必要的积分的步骤,那肯定是一个更容易的流程?
https://stackoverflow.com/questions/7450276
复制相似问题