Client-side HTML form without Elements

158 views
Skip to first unread message

Igor Shmukler

unread,
Nov 2, 2020, 4:29:42 PM11/2/20
to Stripe API Discussion

Hello,

I found a bunch of modern Stripe payment form examples. They all seem to be using Stripe Elements. I want to build my own form. Found a few dated examples, like one at gist jQuery custom payment form and at another jQuery stripe payment example making/submitting forms without Elements.

Based on that, it would seem that I just need to do:

Stripe.setPublishableKey('pk_eAZ06pBC0vowwUT7VkIQbD27S512k'); 
const response = await Stripe.createToken({
  number: cardNumber,
  cvc: cardCvc,
  exp_month: cardExpiryMonth, 
  exp_year: cardExpiryYear
});
const token = response.id;

I see that v2 version API would then take the token append it to the form then submit? 

Could I use this together with Payment Intents API?

What is the correct way of building the HTML form WITHOUT Elements?

If someone could please share links to the documentation, or code example, it would be awesome.

Thank you


Remi J.

unread,
Nov 2, 2020, 4:32:55 PM11/2/20
to Stripe API Discussion
Hello Igor,

The guides you found are outdated and use Stripe.js v2 which has been deprecated well over 2 years ago now. The vetted approach to collect card details is to use Elements instead. This is required as it allows you to meet the simplest level for PCI compliant, SAQ A, and Stripe handles all of that for you. Using your own payment form and collecting card details yourself puts you under a higher threshold for PCI compliance which is highly discouraged. You can read more about this here: https://stripe.com/docs/security/guide#validating-pci-compliance

We recommend that you use Elements in your integration and do not handle card details yourself.

Hope this helps,
Remi

--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Igor Shmukler

unread,
Nov 2, 2020, 4:39:24 PM11/2/20
to api-d...@lists.stripe.com
Hello Remi,

While interesting information your letter does not directly answer my question.

Does this mean that I want to make my own form, I should be processing using a different vendor?

Sincerely,

Igor Shmukler 

Remi J.

unread,
Nov 2, 2020, 4:41:46 PM11/2/20
to Stripe API Discussion
Hello Igor,

You don't have to use another vendor, but you will need to first confirm your own level of PCI compliance and provide relevant documentation. If you have all that's required, you can get access to a specific feature by talking directly to our support team: https://support.stripe.com/contact but it's not something we would discuss on list since it's something almost no one requires today.

Best,
Remi

Igor Shmukler

unread,
Nov 2, 2020, 7:06:14 PM11/2/20
to api-d...@lists.stripe.com
Hello Remi,

Based on what I know about PCI compliance and your answer, I
understood that we just need to complete the annual SAQ.

I went to the URL, which you suggested - https://support.stripe.com/contact
It tells me to select a topic, so I picked "other." Now, I am waiting
for the Stripe representative. Interestingly, for the past six (6)
minutes, the chat is telling me that the estimated wait time is three
(3) minutes. :)

Sincerely,

Igor Shmukler

On Mon, Nov 2, 2020 at 4:41 PM 'Remi J.' via Stripe API Discussion

Remi J.

unread,
Nov 2, 2020, 7:07:55 PM11/2/20
to Stripe API Discussion
Hey Igor,

You would have to complete at least SAQ-D to get access since you could send card details to your server. Unfortunately, this is not something we can discuss on-list here and I would recommend that you contact our support team. I'd recommend not using live chat as this is something really specific that they will not be able to help you with directly.

Best,
Remi

Igor Shmukler

unread,
Nov 2, 2020, 7:34:08 PM11/2/20
to api-d...@lists.stripe.com
Hello Remi,

I already did this - contacted Stripe people.

Unfortunately, while integrating Stripe should be easy and quite
possibly, for most it is, in my case, it is nothing of sorts. I have
not even gotten to the point when I could start on technical issues,
and already I am communicating with multiple Stripe employees trying
to figure out whether my business processes could be easily supported
by Stripe.

This forum is great, though.

Thank you,

Igor Shmukler

On Mon, Nov 2, 2020 at 7:07 PM 'Remi J.' via Stripe API Discussion

Remi J.

unread,
Nov 2, 2020, 7:39:01 PM11/2/20
to Stripe API Discussion
Hey Igor,

I'm sorry for the trouble here. Unfortunately, I think we're a bit beyond the scope of this list at this point. I'd recommend talking with our support team directly and aggregating your questions if you have many of them. Without sounding like a broken record here, you really should use Elements. It's a JS library, you control the UI and the styling as you please and this is the canonical and vetted integration path. So my advice here would be to dive into the Elements documentation and start using it, any alternative would cause friction down the line.

Moving forward, I'd recommend discussing that specific question with our support team directly. If you have technical questions about your code, the API or our products, I'd recommend joining our IRC channel, we're in #stripe on Freenode with a lot of Stripe users and can help with your questions.

Best,
Remi

Igor Shmukler

unread,
Nov 2, 2020, 7:48:26 PM11/2/20
to api-d...@lists.stripe.com
Awesome. Will do all of those. Thank you for detailed answers and your patience.

If my business processes could be fully supported by Elements, makes things only much easier. I do understand/agree that using common scenario makes it easier for Stripe to help customers at scale, and there makes customers lives easier.

I will certainly discuss all of those with support when I hear back from them, and try my luck with chat.
Reply all
Reply to author
Forward
0 new messages