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.”.
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.