Saving transaction & customer info

This commit is contained in:
2024-08-12 19:10:27 +02:00
parent c3897d47bc
commit 5ab6ad85f7
4 changed files with 115 additions and 18 deletions

View File

@ -39,10 +39,17 @@ function stripePaymentMethodHandler(result, plan_id, api) {
} else {
// create a customer and subscribe to plan
let payload = {
product_id: document.getElementById("product_id").value,
plan: plan_id,
payment_method: result.paymentMethod.id,
email: document.getElementById("cardholder-email").value,
last_four: result.paymentMethod.card.last4,
card_brand: result.paymentMethod.card.brand,
expiry_month: result.paymentMethod.card.exp_month,
expiry_year: result.paymentMethod.card.exp_year,
first_name: document.getElementById("first-name").value,
last_name: document.getElementById("last-name").value,
amount: document.getElementById("amount").value,
};
const requestOptions = {