我正在设置 facebook 画布付款并且我正在使用动态定价,所以我有一个回调设置来将价格发送到 facebook。我按照下面的说明进行操作,我也会粘贴我的代码。一切看起来都正确,但我仍然收到关于货币和金额返回参数不能为空的相同错误消息。我已经走到了尽头,非常感谢任何帮助!
An error occurred. Please try again later.
API Error Code: 1383148
API Error Description: The currency and amount return parameters from the dynamic pricing callback can not be empty
public class Item
{
public string product { get; set; }
public decimal amount { get; set; }
public string currency { get; set; }
}
public class RootObject
{
public List<Item> content { get; set; }
public string method { get; set; }
}
var objectToSerialize = new RootObject();
objectToSerialize.content = new List<Item>
{
new Item { product = "https://homeworkhelpers.azurewebsites.net/EssayFee.html", amount = 1.99M, currency = "USD" }
};
objectToSerialize.method = "payments_get_item_price";
var json = new JavaScriptSerializer().Serialize(objectToSerialize);
response.Write(json);
我正在遵循的说明:
此时,您应该验证购买并使用 JSON 数组响应 HTTP 请求,其中至少包含以下定义的格式的产品、金额和货币。
{
"content":
{
"product": "http://www.friendsmash.com/og/smashingpack.html",
"amount": 1.99,
"currency": "USD",
},
"method":"payments_get_item_price"
}
这是我返回的json:
{"content":[{"product":"https://mywebsite/product.html","amount":1.99,"currency":"USD"}],"method":"payments_get_item_price"}