How can i add custom fields to Stripe Checkout form such as First Name, Last Name and maybe even a checkbox with a custom button? So far i\'ve come up with this;
You can try add own filed by pass as clientReferenceId ie. => extrauserid::option2::option2 but unfortunately you don't get this in in payment_intent.succeeded same as missing SKUs.
clientReferenceId string
A unique string to reference the Checkout session. This can be a customer ID, a cart ID, or similar. It is included in the checkout.session.completed webhook and can be used to fulfill the purchase.
var data = {
customerEmail: eml,
successUrl: 'https://...',
cancelUrl: 'https://...',
clientReferenceId: user + '::' + option1,
items: [{
sku: sku,
quantity: 1
}],
}
stripe.redirectToCheckout(data);
checkout.session.completed
"cancel_url": "https://....",
"client_reference_id": "user123::somevalue",
"customer": "cus_H1vFYbxY2XMAz6",