As mentionned in the official documentation extract access token
I want to integrate a paypal sandbox account into my Angular application
but I have encoutered
" 400 bad request error "
when I send a rest call to get access token
connectToPaypalAccount(paypalCode) : Observable<any> {
const headers = new HttpHeaders().set('Authorization' , 'Basic '+this.paypalClientID+':'+this.paypalClientSecret);
const body = {
grant_type : 'authorization_code' ,
code: paypalCode
}
return this.http.post('https://api.sandbox.paypal.com/v1/oauth2/token' , body , { headers }); }
i m sure that i have a valid ( clientID , Secret , authorization code ) and it works with postman
see this picture below
any help is appreciated