1

I am trying to implement facebook payment in Unity game for Webgl build. It is working fine when I pay as a tester but when I am trying to purcahse by real money it is giving me following error:

XMLHttpRequest cannot load https://apps.secure.facebook.com/ajax/payment/token_proxy.php?tpe=%2Fpayments%2Fcredit_card%2Fmutator%2Fcreate%2F&__a=1. The 'Access-Control-Allow-Origin' header has a value 'https://apps.secure.facebook.com' that is not equal to the supplied origin. Origin 'https://apps.facebook.com' is therefore not allowed access.

What does this mean and how do I solve it?

Arlen Beiler
  • 15,336
  • 34
  • 92
  • 135
user831413
  • 141
  • 1
  • 8

2 Answers2

3

The script is limited by the "same origin policy" which means a page can send requests to a server with exactly the same domain name. In your case, the page'https://apps.facebook.com' is trying to send a request to the domain name 'https://apps.secure.facebook.com'. As u can see, there is a difference in the domain names. They differ by the 'secure' word. For more information on this problem and solution for it, refer this page - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '...' is therefore not allowed access

Community
  • 1
  • 1
  • But this is bugs from facebook side.How we can solve that ? I am seeing some game made on Unity working fine. – user831413 Sep 10 '15 at 16:39
0

Change the reference of https://apps.facebook.com to https://apps.secure.facebook.com or vice-versa.

user3071284
  • 6,955
  • 6
  • 43
  • 57