(#100) Tried accessing nonexisting field (consume) on node type (GamesIAPOrder)

272 Views Asked by At

I'm trying implement Payments Lite.

Purchase request works without any issues.

Same for purchases list. It returns:

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

But if I try to consume this purchase using purchase_token the request returns:

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

I'm using this code:

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

How can I solve it?

1

There are 1 best solutions below

0
On BEST ANSWER

The call to consume a purchase_token should be using HttpMethod.POST instead of HttpMethod.GET

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