DEV Community

Discussion on: Any Framework, One Stripe Integration

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

Looking forward to it!

A few ideas I've been kicking around are adding a type attr like

<stripe-elements type="card|iban|idealbank|cvc|cardNumber|cardExpiry"></stripe-elements>

and using Element#update to sync form data to the element, maybe declaratively with slotted inputs

Collapse
 
btopro profile image
Bryan Ollendyke

Something like this?

<stripe-elements>
  <date-picker slot="cardExpiry" month year no-day name="cardExpiry"></date-picker>
  <input slot="card" name="card"/>
</stripe-elements>
Thread Thread
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 • Edited

PCI requires the inputs to be in Stripe's iframe, but I was thinking more something like

<stripe-elements>
  <form slot="billing-info">
    <input name="name"/>
    <input name="address"/>
  </form>
</stripe-elements>

or some such, so that the generated representation (token|source|paymentMethod) has that info inside
see stripe.com/docs/js/tokens_sources/... and stripe.com/docs/js/tokens_sources/...

It would be ideal if, even in a browser that doesn't support the formdata event, we could still get data from custom controls in the form.