#devparry

1 messages ยท Page 1 of 1 (latest)

fathom elbowBOT
knotty blaze
#

Hello ๐Ÿ‘‹
You'd just pass the one-time and the recurring price to the line_items array when creating a checkout session

#

Not sure if we have a specific guide for that but let me check

restive goblet
#

okay

knotty blaze
#

Yes, are you seeing any API errors when you run the code?

restive goblet
#

let me test this

#

its working let me do more testing...

knotty blaze
#

๐Ÿ‘

restive goblet
#

i am facing one issue under it

knotty blaze
#

What's the issue?

restive goblet
#

as I am checking under the product dashboard
it shows me the proper description but under the checkout session it is a little bit confusing

#

both price have same description but we set different differnt

knotty blaze
#

Can you share the product/price IDs?

restive goblet
#

sure

#

This is my product id : prod_Nrr5BrRGaaQTgL

knotty blaze
#

Ah it might be because Checkout is using Product description when rendered (instead of price description)

Can you try creating two different products for these prices?

restive goblet
#

you mean should i create new Product using these prices ?

knotty blaze
#

Create separate products for one time fee price and the recurring price

restive goblet
#

but as per the documentation, we can assign multiple prices to a single product so why i need to create a different product ?

knotty blaze
restive goblet
knotty blaze
#

These are two prices for the same product.

Checkout uses Product information when listing out line items on Checkout page and NOT price information.

restive goblet
#

Let me explain what is our requirement we have a subscription product and have two prices.
and The default price is monthly and 2nd price is for one time ( which is a one-time installation processing fee )
So how we can make it workable?

knotty blaze
#

Let's take a step back, I feel like we're talking past each other.

#

You are creating one product with two prices

Let's call this product - Product A,

  • It has a one-time fee of $10
  • And a recurring price of $20

Both the prices above belong to "Product A" (single product)

So when you use both prices as line items in a checkout session, Checkout page pulls the "Product" information when rendering the line items. In this case both prices belong to "Product A"

#

Hence, the line items would show the name & the description of "Product A" on the checkout page for both prices

#

If you want separate name & description for one-time fee and the recurring price then you'll need to create two separate products for them

#

That way one-time fee will belong to "Product A" and recurring price will belong to "Product B", in which case the Checkout page will pull two different product names/descriptions for line items

restive goblet
#

hmmm thanks for clear my doubt

knotty blaze
#

NP!

restive goblet
knotty blaze
#

Yes

restive goblet
#

and each have it own new product and price ids

knotty blaze
#

yup so you might end up with thousands of products/prices

restive goblet
#

LOL, noo we don't want to do that. This will create problems in our existing system. let me share this with my team

restive goblet
knotty blaze
#

No worries, happy to help

restive goblet
#

one thing more i have to ask

knotty blaze
#

Sure

restive goblet
#

so when checkout.session.completed fire we save the subscription order data on our local-db

#

Could you please let me know which event fire when ?

will checkout.session.completed return all the subscription data ( with active status ) + invoice data at the same time stripe provide me subscription data under different events listed above ?

knotty blaze
restive goblet
#

if you can explain to me that : what the fulfill_order($session) function do next it helps to me under stand easily.

restive goblet
#

When checkout.session.async_payment_succeeded event fire what data will stripe return to us as compared to checkout.session.completed ?

knotty blaze
#

fulfill_order in above case would most likely need to update your database and provision access to the product/service you're selling

restive goblet
#

means it is for only updating the data for the subscription

fathom elbowBOT
restive goblet
#

when ever fulfill_order() function call in the above example it means update the data on our local database

knotty blaze
#

correct

restive goblet
#

thanks for sharing valuable info

knotty blaze
#

NP! Happy to help ๐Ÿ™‚

restive goblet
#

have a nice day ahead