Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom fields to popup form of Stripe Checkout

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

like image 774
Ahmad Avatar asked Jun 02 '15 09:06

Ahmad


People also ask

What's the difference between Stripe and Stripe checkout?

You may be wondering what the difference is between Stripe and Stripe Checkout. While our “regular” Stripe Payments integration allows users to enter credit card payment information directly on your form, Stripe Checkout seamlessly redirects users to the Stripe website to process payment.


1 Answers

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.

like image 50
koopajah Avatar answered Oct 10 '22 10:10

koopajah