Is there a way to make the stripe payment element shorter?

56 views Asked by At

I'm using the stripe element and I need it to fit within a certain height on the screen. Once I add name and email and with stripe adding "Link" it kind of gets a bit too tall.

Is there a way to have credit card expiration date CVC and zip code all in one "field" or online?

Thanks

3

There are 3 answers

2
Patrick Moore On

To save space you can use the single-line cardElement https://stripe.com/docs/js/element/other_element?type=card

If your implementation does not require Link you can actually turn it off as a payment method from within your Dashboard's Payment Method settings https://dashboard.stripe.com/settings/payment_methods

1
qichuan On

You can consider using Card Element in your website, it's an one-line field that collect all card details, and it supports Link as well.

0
aj griffin On

Thank you Patrick and qichuan!

What I did was call paymetRequest.canMakePayment()

And then a bunch of if statements for each payment method that I want like Google pay cashApp pay etc. for credit card I'm now using the card element instead of the payment element.

Thank you!