(#100)尝试访问节点类型(GamesIAPOrder)上不存在的字段(消耗)

时间:2018-08-16 16:33:22

标签: facebook unity3d facebook-graph-api facebook-payments

我正在尝试实现Payments Lite

购买请求有效,没有任何问题。

与购买清单相同。它返回:

[
  {
    "purchase_token": "###",
    "product_id": "###",
    "app_id": "###",
    "purchase_time": ###,
    "payment_id": "######",
    "consumed": false,
    "signed_request": "###",
    "payment_action_type": "charge"
  }
]

但是,如果我尝试使用purchase_token消费此购买,则请求将返回:

{
  "error": {
    "message": "(#100) Tried accessing nonexisting field (consume) on node type (GamesIAPOrder)",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "CPjKLsTkf/G
"
  }
}

我正在使用以下代码:

FB.API("/" + purchaseToken + "/consume", HttpMethod.GET, OnConsume, new Dictionary<string, string> {
     {"access_token", accessToken}
});

我该如何解决?

1 个答案:

答案 0 :(得分:1)

使用purchase_token而不是HttpMethod.POST来消耗HttpMethod.GET

  

https://developers.facebook.com/docs/games_payments/payments_lite#consuming