Facebook new payer promotion spec at https://developers.facebook.com/docs/payments/payer_promotion/#user_eligibility says it will return 1 if user is eligible, and nothing if not.

But, this code in PHP:

$fbdata = $facebook->api('/me?fields=id,locale,third_party_id,is_eligible_promo');

returns is_eligible_promo => '1';

But when i use that query on Graph API explorer, or with JavaScript:

FB.api('/me?fields=id,locale,third_party_id,is_eligible_promo', function(response) {});

it doesn't return is_eligible_promo field.

Also, calling this payement popup:

var obj = {
    method: 'fbpromotion',
    display: 'popup',
    package_name: 'zero_promo',
    product: '---my-open-graph-currency---'
};
FB.ui(obj, function() {});

, it returns something like "Sorry, the promotion is currently unavailable.".

有帮助吗?

解决方案 2

It resolved that user_is_eligible depends on IP of the user requests.

Since my servers are in country A, php request from that server to facebook returned that user is eligible. But when i request same params with javascript (i'm in country B), facebook says that user is not eligible.

Fixed this by moving all checks to javascript since it depends on user location.

其他提示

But when i use that query on Graph API explorer, or with JavaScript […] it doesn't return is_eligible_promo field.

I think this is an access_token issue – whether a player is eligible for a promotion depends on the individual app, I guess.

Try choosing your own app in the Graph API explorer (dropdown on the upper right), and see if then you get the same result as from within your PHP script.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top