在我的购买验证过程中有一个三方
- iOS 客户端
- ASP.NET 服务器(验证中介)
- 苹果服务器
iOS Client与ASP.NET Server通信方式中的JSON-RCP
验证过程是;通过网络服务发送付款收据到 ASP.NET 服务器(服务器使用 AppleReceiptVerifier 验证收据)
我有 5 个用于支付的产品标识符,其中 2 个运行良好并返回预期的响应,但其他三个像这样返回 JsonException
{
error = {
errors = (
{
message = "Found String where Object was expected.";
name = JsonException;
}
);
message = "Found String where Object was expected.";
name = JSONRPCError;
};
id = "<null>";
}
还有这个
{
error = {
errors = (
{
message = "Missing value.";
name = JsonException;
}
);
message = "Missing value.";
name = JSONRPCError;
};
id = "<null>";
}
所有产品标识符都是同一类型,只是价格不同 我不知道为什么会出现这个问题???
怎么办???
最佳答案
阅读json-rpc的规范后, 看来 params 是一个数组,试试这个:
{
"method":"sendReceipt",
"params" :[
{
"ReceiptData":"ewoJInNpZ25hdHVyZSIgPSAiQXJ.....",
"PersonID":"sam@am.com"
}
],
"id":"1"
}
或者这个:
{
"method":"sendReceipt",
"params" :[
"ewoJInNpZ25hdHVyZSIgPSAiQXJ.....",
"sam@am.com"
],
"id":"1"
}
jsonrpc 2.0 版:
{
"jsonrpc": "2.0",
"method": "sendReceipt",
"params":
{
"ReceiptData":"ewoJInNpZ25hdHVyZSIgPSAiQXJ.....",
"PersonID":"sam@am.com"
},
"id": 1
}
它们都应该根据您的需要工作。
关于c# - Apple Receipt Verifier 返回 JsonException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18506047/