#tallmanpapi
1 messages ยท Page 1 of 1 (latest)
Sorry, maybe the tweet from Nico, made my question more vague than needed.
My question is if I have a form field, and would like to pay per form that is being sent to my database, what would I need to use to let this work with Stripe?
Hope this clears it up, a bit.
@visual wing
I'm sorry I don't understand what "pay per form" means exactly
Do you mean metered billing? https://stripe.com/docs/billing/subscriptions/usage-based
Sorry, I mean, conditionally, so there is an input form, at the bottom of the form I would like a payment to be made, after the payment has been made the input data from the form will be sent to the database.
So a checkout page with a standard set price, and after the checkout has been done the input form values will be sent to the database.
My question, what would I need to use with Stripe to make this work? I am not asking for any examples of code, just curious what I would need to use.
Hi there ๐ taking over, as my colleague needs to step away
I'd recommend using the Payment Element in this case: https://stripe.com/docs/payments/payment-element
It's contained in a form that can have other fields, such that when it is submitted, you can grab data from those other fields.
Hi @fading stump , thank you for helping me!
Okay, thank you so much, I'll check this out, and will let you know if this is what I am looking for.
Thank you so much!
Best regards.
Sure thing!
From you answer, you mean the fields are in the Stripe Payment Element? Because I have a form that would be outside of the Stripe Payment Element with the values that need to be sent to the database.
My case is a form field on a the page-Next.js, TypeScript, tRPC-and at the bottom I would love to have the Stripe Payment Element, but the form fields can't be in the Stripe Payment Element, would it still be possible? Or would I need to use something like the Stripe web-hooks?
Website:
[Form] "Filled in"
[Stripe Payment Element] "Submit and only send to database when the payment has been made"
you mean the fields are in the Stripe Payment Element
No. They could be in the same HTML form, but not necessarily IN the Payment Element
Yes, exactly! Okay, perfect.
Look at the HTML in this Payment Element quickstart if youre confused: https://stripe.com/docs/payments/quickstart
So outside the Payment Element, right? That would be exactly what I am looking for.
Okay, thank you, I am looking into that! ๐
There's no TypeScript support? I see Next.js, but I am also using TypeScript.
You can use Typescript with Node or Next or React, and we have SDKs for all those, but you'll have to do a little extra configuring to import all the types and such