#romerocox-Payment

1 messages ยท Page 1 of 1 (latest)

proud pond
#

Hi there, do you mean PaymentIntent?

shut cape
#

Yes, and with the PaymentIntent, I can generate another secret, right?

#

My scenario is:

Whenever a user clicks on a "buy now" button, it will generate a subscription, an setupintent and a payment secret.

#

To avoid multiple sub creation, I'm assigning that subscription_id to that user on my end ( mysql )

#

Also, I'm recording that setupintent Plus the secret.

#

What happens is, if the CX goes back to the Plans page, and selects a different plan, the secret and intent retrieved from the DB is related to the other plan, so it messes everything up.

proud pond
#

So basically you want to avoid duplicate subscription creations am I right?

shut cape
#

that is exactly right

#

so whenever a sub is left "incomplete" I want the user to get that one and finish it, and during this process, we may need to update the original price_id

proud pond
shut cape
#

that I already have on my DB

proud pond
#

Why are you updating the price_id after the subscription creation?

shut cape
#

because the customer may change his mind

#

before paying.

proud pond
#

OK. Why not cancel the incomplete subscriptions and create new ones for your customers?

shut cape
#

I was afraid this would cause trouble depending on how many customers I have and how many times they would change their minds lol

#

so I thought of doing that to avoid all these unnecessarily requests

proud pond
#

What kind of trouble?

shut cape
#

too many hanging subscriptions..

#

Stripe would be like 'wth is this guy doing'

proud pond
#

Haha, don't worry about that at all.

shut cape
#

I was afraid this would somehow ending up blocking my account for some reason

#

so, there is no easy way to update the price_id on a sub, right?

proud pond
#

To my knowledge I don't think Stripe will block an account because too many subscriptions.

shut cape
#

Good to know.

proud pond
shut cape
#

Yeah I saw that, but I'm not sure how to replace the old one

#

I think that by setting somehow the price_id on the same array offset

#

that may replace it

proud pond
#

You can retrieve the incomplete subscription, and get the subscription item ID from the items list

#

Yes you can also replace the whole items list

shut cape
#

Ok, I'll try that, thank you, sir!

proud pond
#

No problem!

shut cape
#

bad news:

You cannot update a subscription in incomplete status in a way that results in a new invoice or invoice items. Only minor attributes, like metadata or default_payment_method, can be updated on such subscriptions

#

need to find another workaround

proud pond
#

Cancel the incomplete subscription and create a new one

shut cape
#

๐Ÿ˜„

shut cape
#

where can I check if Stripe is being slow or if its my internet? ๐Ÿ˜„

proud pond