async function createCustomer(paymentMethod, cardholderEmail) {
var formData = new FormData();
formData.append('email', cardholderEmail);
formData.append('payment_method', paymentMethod);
formData.append('csrfmiddlewaretoken', csrftoken);
return fetch('/create-customer/', {
method: 'post',
// headers: {
// 'Content-Type': 'application/json'
// },
body: formData,
mode: 'cors',
cache: 'default',
credentials: 'include',
})
.then(response => {
return response.json();
})
.then(subscription => {
handleSubscription(subscription);
});
}