Reputation: 141
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?
Upvotes: 1
Views: 262
Reputation: 7100
Change the reference of https://apps.facebook.com
to https://apps.secure.facebook.com
or vice-versa.
Upvotes: 0
Reputation: 131
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
Upvotes: 3