Not Able To Make Real Payment in Facebook Game

255 Views Asked by At

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?

2

There are 2 best solutions below

1
On

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

2
On

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