I tried to call the Express Checkout Paypal API by $http.get(AngularJS) and I get error 81002(Method Specified is not Supported). After I tried to call the Express Checkout Paypal API by using the search bar of Google Chrome and I get the token so the call is successful. I also tried to call the Express Checkout Paypal API by form, and the call is successful. I do not understand why.
I tried to call Paypal API in this way:
$http.jsonp("https://api-3t.sandbox.paypal.com/nvp?USER=[user]&PWD=[PWD]&SIGNATURE=[SIGNATURE]&VERSION=109.0&PAYMENTREQUEST_0_PAYMENTACTION=Sale&PAYMENTREQUEST_0_AMT=19.95&RETURNURL=http%3A%2F%2Flocalhost%3A3000%2FexpressCheckout.html&CANCELURL=http%3A%2F%2Flocalhost%3A3000%2FpagamentoAnnullato.html&METHOD=SetExpressCheckout")
.success(function(data){
console.log(data);
}).error(function(error){
console.log(error);
});
And if I see the response, I get the token, but in the console I get this error: Uncaught SyntaxError: Unexpected identifier
and I'm not able to get the return data.