We are trying to use Paypal to sell physical items through our app. We have tried using UnityWebRequest to do the call which allows us to log in and get a token back from Paypal which would allow us to then make a purchase.
However, for some odd reason on iOS the response was returning an error and we couldn't get it to work. It worked fine on Android and in the Unity editor.
So then the thought was to use Playfab cloud scripting. I saw the Playfab example of an HTTP request and copied it, replacing information to match what is needed. The encodeString is a combination of id and secret.
Unfortunately, the response is empty and is not returning the json from Paypal (we can get this using UnityWebRequest, just iOS isn't working right).
Is there something that we're missing for why this script doesn't work the same?
Thank you for any help provided.
var headers = { "Accept": "application/json", "Accept-Language": "en_US", "Authorization": "Basic " + args.encodeString }; var data = { "grant_type": "client_credentials" }; var url = "https://api.sandbox.paypal.com/v1/oauth2/token"; var content = JSON.stringify(data); var httpMethod = "post"; var contentType = "application/json"; // The pre-defined http object makes synchronous HTTP requests var response = http.request(url, httpMethod, content, contentType, headers); return { responseContent: response };