TypeError: Failed to execute ‘fetch’ on ‘Window’: Invalid name
fetch(‘https://api.razorpay.com/v1/payments/’, {
method: ‘GET’,
headers: {
Accept: ‘application/json’,
‘Content-Type’: ‘application/json’,
‘Access-Control-Allow-Origin’ :‘*’,
‘Access-Control-Allow-Credentials’ :‘true’,
‘Access-Control-Allow-Methods’ :‘GET’,
‘Access-Control-Allow-Headers’:‘Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type’,
‘Content-Type’:‘text/plain charset=UTF-8’,
‘add_header -Content-Length’:‘0’
},
‘Authorization’: JSON.stringify({
usr: ‘’,
pwd: ‘’
})
})
.then(r => r.json())
.then(r => {
console.log(r);
})