How to add custom fields to popup form of Stripe Checkout

stripe custom checkout example
stripe custom checkout example php
stripe checkout custom amount
stripe checkout server example
stripe checkout session
stripe checkout link
stripe checkout roadmap
stripe checkout save card

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;

<script src="https://checkout.stripe.com/checkout.js"></script>

<form action="/charge" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_i2txBI2jUjSQIMoqFz3Fo326"
    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
    data-name="Matt's Widgets and Gizmos"
    data-description="2 widgets ($20.00)"
    data-amount="2000"
    data-billingAddress="true"
    data-shippingAddress="true">
  </script>
</form>

And i found that Stripe Checkout can only include the following custom values which are as under;

stripeBillingName: 
stripeBillingAddressLine1: 
stripeBillingAddressApt:
stripeBillingAddressZip: 
stripeBillingAddressCity: 
stripeBillingAddressState: 
stripeBillingAddressCountry: 
stripeBillingAddressCountryCode: 

Is there any way around this? Please let me know Thank you


There is no way to tweak Stripe Checkout unfortunately to add a custom field or a checkbox. The solution here is to use Custom Checkout and add those extra fields to your own form. You would for example collect the customer's name and ask him to accept your own Terms of Service and only allow them to click on the Pay button once they do.

Then, once the customer fills Checkout with their card details and Stripe sends you back the token you would send it to your server along with the extra details you collected on your end.

Customizing Checkout, I want to include a custom field so that I can match an item_id to an order in my If you do not add credit card fields to your form, Stripe Checkout will be used. list" payment types to popup one-time payment forms (Stripe checkout forms). Customizing Checkout. Learn about the different ways you can customize your Stripe Checkout integration. Branding. You can customize the look and feel of Checkout in the Stripe Dashboard. Go to Branding Settings where you can: Upload a logo or icon; Customize the background and button color of the Checkout page; Customizing the Submit button


Stripe now recommends using the stripe.js method versus the deprecated checkout modal method (not to be confused with the new Stripe Checkout).

To that end, in order to add custom fields (such as name, package type, custom tags, etc), what I found works is tweaking the stripe.js function stripeTokenHandler() by adding:

var customInput = document.createElement('input');
customInput.setAttribute('type', 'hidden');
customInput.setAttribute('name', 'customInput');
customInput.setAttribute('value', $("input[name=customInput]:checked").val());
form.appendChild(customInput);

So if I had a radio button group called "customInput", it would attach the value of whatever radio button was selected to the "customInput" $_POST field. This way the target script can retrieve it and use it.

Hope this helps someone.

Stripe Payments Additional Custom Fields Addon, Using a custom form is very similar: we still send the credit card information to Stripe, and Stripe will still give us back a token. This is just the Twig way of adding some new JavaScript to our page. This tells Stripe which data this field holds. You can find the code for the simple checkout here. Custom Stripe Checkout. Want to customize the look a feel of things? You'll need to use the custom Stripe Checkout integration. Let's add a custom button. Update the base template, adding in Bootstrap, a link to a custom stylesheet, and a block for scripts:


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",

Stripe checkout custom fields, The Stripe Checkout add-on allows you to accept credit card payments from your forms. When editing a custom button field, the field settings sidebar will appear. The Stripe Checkout pop-up is configured using the following settings:  If you are unfamiliar with code and resolving potential conflicts, we have an extension that can help: WooCommerce Checkout Field Editor.Installing and activating this extension overrides any code below that you try to implement; and you cannot have custom checkout field code in your functions.php file when the extension is activated.


Building the Custom Checkout Form > Stripe: Killer Payment , A form in WP Full Stripe is a set of input fields submitted by the customer that results address; Custom fields; Coupon code; Google reCaptcha; Cardholder's name Our plugin sends visitors to the checkout form for payment, and redirects back to and submit the form: WP Full Stripe - Popup form example with extra fields. The single input card Element automatically collects and sends the customer’s postal code to Stripe. If you build your payment form with multi-input card Elements (cardNumber, cardExpiry, cardCvc), add a separate input field for the customer’s postal code. Refer to our Stripe.js reference documentation for a full list of supported Element


The Stripe Checkout Add-On – WS Form, Passing parameters from the Simple Stripe Checkout form to your own parameters from your own HTML form to the Custom Stripe Checkout form into Stripe Checkout but it is also a workflow you may want to include on your site. You would like to auto-fill the name and email fields of this form using  A simple example of collecting text and textarea fields at membership checkout. An example of using a new Checkout Box with conditional fields based on dropdown selection. Using Register Helper fields in conjuction with the Member Directory and Profile Pages Add On


Introducing form types, Stripe Checkout Example with Default Popup Form where described the payment process with the custom HTML form using stripe.js library. Stripe Checkout. The quickest way to build conversion-optimized payment forms, hosted on Stripe. Checkout creates a secure, Stripe-hosted payment page that lets you collect payments quickly. It works across devices and is designed to increase your conversion.