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

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?

Upvotes: 0

Views: 269

Answers (1)

Fredrik Widerberg
Fredrik Widerberg

Reputation: 3108

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

Upvotes: 1

Related Questions