I ran into something like this before a few times. I don't remember the
exact issue but you might want to use url variables instead of object for
params. You also may need to set the content type. I'll try and look it up
when I'm not on mobile. Post this on stack overflow and I'll help over
there.
On Mar 25, 2016 8:46 AM, "leokan23" <l...@best-web.gr> wrote:

> So i am trying to integrate PayPal in my Flex Mobile app. I make my first
> call like this:
>
> (keys are sandbox by paypal dev resources)
>
> protected function getPaypal():void {
>   var client_id:String="EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp";
>   var secret:String="EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp";
>
>   var params:Object = new Object();
>   params.grant_type="client_credentials";
>
>   var encoder:Base64Encoder = new Base64Encoder();
>   encoder.encode(client_id + ":" + secret);
>
>   //var s:String = JSON.stringify(params);
>   paypal.contentType = "application/x-www-form-urlencoded";
>   paypal.headers["Authorization"] = "Basic " + encoder.toString();
>   paypal.method = "POST";
>   paypal.url = "https://api.sandbox.paypal.com/v1/oauth2/token";;
>   paypal.send(params);
>   }
>
> This fails and returns the following:
> 'Error #2096: The HTTP request header Basic
>
> RU9KMlMtWjZPb05fbGVfS1MxZDc1d3NaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA6RUNsdXNNRVVrOGU5
> aWhJN1pkVkxGNWNaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA= cannot be set via
> ActionScript.' faultDetail:'null'
>
> I can't figure out what seems to be the problem.
>
> Any help?
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/PayPal-integration-Error-2096-tp12359.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Reply via email to