перенаправлено: false
status: 400
statusText: «Bad Request»
type: «cors»
url: «https://api.stripe.com/v1/customers»
вернуть эту ошибку.
let customer= {
"name": "xxxxxx",
"phone": "xxxxxxxxxx",
"email": "sxxxxxxa@gmail.com",
"description": "test account "
}
let url = 'https://api.stripe.com/v1/customers';
let body = {
method: 'POST',
headers: {
'Content-Type': 'application/form-data',
'Authorization':'Bearer sk_test_xxxxxxxxxxxxxxxx',
'Stripe-Version': '2014-12-22',
},
//body: JSON.stringify(customer),
//json:true
body: customer
}
let response = await fetch(url, body);
console.log("response ",response.type)
if (response.ok) {
let json = await response.json();
} else {
console.log("err",response)
}