#dzidor - Products and Prices

1 messages · Page 1 of 1 (latest)

dull crown
#

You can create an Invoice using the Products/Prices you want. The Invoice will then produce a Payment Intent you can use with Elements.

balmy crystal
#

let's say if this respond to my use case

#

I need to create a product/price Life Time Access for a promotion for new user on my website

#

so i need for the promo that the use have a form to register and pay ONLY one time the life time access

#

so you said i need to use in this use case apis: Invoice

dull crown
#

Yep.

balmy crystal
#

sorry I don't see the way i will introduce stripe elements in this flow

dull crown
#

Instead of step 6 there you would get the Payment Intent from the Invoice and use that with Elements.

balmy crystal
#

look up the guides but still stuck

#

i don't see the use of the payment intent with Stripe Elements

#

this is the part I don't catch up

#

let's say we have the payment Intent, next

#

how integrate with Elements

dull crown
#

In step 3 there instead of creating the Payment Intent you would use the one from the Invoice.

balmy crystal
#

ok so i can get the client_secret for the payment intent to pass it to the frontend to. card elements

#

i think i got the idea

dull crown
#

Yep!

balmy crystal
#

thanks so much

dull crown
#

Happy to help!

balmy crystal
#

when calling in the frontend: confirmCardSetup

#

it will charge the client for the invoice

dull crown
#

No, confirmCardSetup is only for Setup Intents. You want confirmCardPayment.

balmy crystal
#

whatever i use the card elements not the payment elements api

#

?

dull crown
#

What do you mean?

#

Where did you see confirmCardSetup?

balmy crystal
#

I am sorry you right

#

you said confirmCardPayment and not confirmPayment

#

which is use with the card payment api

dull crown
#

I'm not sure what you mean by "card payment api", can you provide more details?

#

You would use stripe.confirmPayment with the Payment Element and stripe.confirmCardPayment with the Card Element.

balmy crystal
#

yes this is what i mean card element vs payment element

#

i need to use the right api call as you mentionned

#

confirmPayment vs confirmCardPayment

#

go it now

#

thank you for you help

#

i gonna move on the integration

dull crown
#

Awesome!

#

Let us know if you run into any issues building it!

balmy crystal
#

sorry but i still have an issue

#

i just seen it

#

with my flow

#

when server send to my promo page, at this step i don't have yet a stripe customer to create my invoice to get the payment intent

#

because this is a public page that when someone get on it it is invite to make in ONE step

#

register to my website and pay the Product LifeTime

#

so no customer to create invoice, get payment intent and pass the secret to frontend at this point

#

you catch me?

#

and i don't want to have the flow in 2 steps

dull crown
#

Yep, you would need to create a Customer for this to work.

#

This flow would work a lot better with Payment Intents alone (no Invoices or Customers). Why is using a Product and Price a requirement?

balmy crystal
#

i am stuck with the pricing models already defined. not my choice

#

the the pricing models: we have subscription plan recurring to have a premium menbership. and another product with a non recurring price for a LifeTime access

#

it the user wants to pay the lifetime access upon registration ONLY

#

it will never have in the future to subscription to a recurring plan to have the premium access on the site

#

so the idea is at the time you register on the site you can take the life time access. but if you dont you will never have the change anymore. but you will only be able to go a take subscription (recurring) plan to have the premieum access.

dull crown
#

Right, that makes sense. What I'm confused about is why there has to be a hard link between the Price and the one-time payment? Can you look up the Price's details and create a Payment Intent using those details? Maybe put the Price ID in the metadata as well?

#

Does that make sense?

balmy crystal
#

hmm this make sense, we will have the ability to link base on the metadata.

#

ok i will discuss this to the product owner