#jaf

1 messages · Page 1 of 1 (latest)

crimson flintBOT
knotty plover
#

hello! Elements works with PaymentIntents which don't work with Prices/Products

#

so if you want to use Elements, you create a PaymentIntent for a particular amount

#

Prices/Products work with Invoices, Subscriptions and Checkout

fallow warren
knotty plover
#

you have it in reverse

#

first question to ask is

#

1/ what payment flow do you want?

one time?
recurring?

#

2/ do you want everything in your own form? Or a full page redirect for the end customer (to a Stripe form?)

I know the answer is "your own form"

fallow warren
knotty plover
#

to be a bit explicit

Yes, I want to a) buy a product with a priceID
is a one time payment, right?

#

cause that only works with Checkout, not Elements

#

a) I'm already doing stripe.paymentIntents.create but that doesn't allow me to purchase a product, only charge a specific amount
PaymentIntents don't work with Prices , as I said earlier

fallow warren
#

Okay, thanks. Got it. So with checkout, how do I handle the payment myself on my website? Without directing the user to a stripe payment page

#

stripe.checkout.sessions.create doesn't give me back a client_secret

knotty plover
#

Without directing the user to a stripe payment page
you can't, Checkout requires a full page redirect.

#

the only way you can do your own form is to use PaymentElement which does not support Prices.

fallow warren
#

Okay, thanks

#

Is there a specific reason for this? I'd appreciate an explanation if that's not too much to ask 😉

knotty plover
#

for Checkout being full page redirect?

#

or for

PaymentElement which does not support Prices.

fallow warren
# knotty plover for Checkout being full page redirect?

Yes. It kind of seems weird to me that I can charge an arbitrary amount when I create a paymentIntent but not create a paymentIntent for a product with a pre-defined price, to me it looks like the same thing under the hood

#

I understand that it's not possible, it's not a huge deal, but having the purchases grouped under a product in the dashboard would have been nice

dusty cove
#

@fallow warren totally valid feedback. Happy to surface that to the product team. This bit here:

It kind of seems weird to me that I can charge an arbitrary amount when I create a paymentIntent but not create a paymentIntent for a product with a pre-defined price, to me it looks like the same thing under the hood
that is in regards to the Payment Element specifically, correct?

fallow warren
#

Yes, what I don't really understand is why I have to use a completely different flow to let users pay for a product, especially because a subscription is also a product. But I can create a subscription in basically the same way I can create a charge for an arbitrary amount, where I get back a client_secret that I can pass to my credit card form that I created with stripe elements.