#videovillain

1 messages ยท Page 1 of 1 (latest)

coarse relicBOT
tight trench
#

๐Ÿ‘‹ Is there anything that I can help?

frank edge
#

Hi @tight trench maybe! I am sort of struggling to get my subscriptions set up.

Currently I made a big long component that filters through my products and prices to then match them up and display them neatly with monthly/yearly costs for 3 options and that works fine, and then I send it through the Checkout Form I built, which also works, but it doesn't create a subscription, its just a payment.

#

Also, I then found out (after finishing my component to do the same thing, lol) about the awesome product tables and implemented that. And that one works well at first but then sends the user out of the app and though I have the return address set up, it doesn't return me to the app, but rather gives me a CORS error.

tight trench
frank edge
#

I'd like to get both to work since we are still deciding which way to go

tight trench
#

Where was the CORS error thrown? Can you share the error message?

frank edge
#

Yes I can, give me a moment.

tight trench
#

Are you using Subscription API with Elements?

frank edge
#

Let me check, but also, is it safe to show the cs_test_********* string in the error or should I black it out if you don't need it?

tight trench
#

It's fine to share the Checkout Session ID (cs_xxx) here

#

Oh! So you're not using Elements, but Checkout Session instead

frank edge
#

well this is for the product table

#

its two different things I'm using, haha

#

this is the CORS error

#

but I've checked and triple checked, we have CORS handled properly

tight trench
#

Are you able to complete payment in Checkout Session page?

frank edge
#

yes, it finishes payment

tight trench
#

Since the payment can be completed, then this error is just red herring and shouldn't affect your integration

frank edge
#

hmmm, okay. but then I never get confirmation of payment an I can't update my backend

#

I'd have to separately ping the customerID or something to make sure payment was finalized to unlock their access rights

#

or am I overthinking things?

tight trench
frank edge
#

Ahh, missing a webhook, is that it?

tight trench
#

Yes! Webhook should be set up for getting notified with payment completion

frank edge
#

do you know if they are pretty traffic heavy?

tight trench
#

It depends on how many event types your webhook endpoint listens to. If you only listen to checkout.session.* events, then they will only be sent when there is a change to Checkout Session payment status. If you subscribe to many more event types, then the traffic will be higher for sure

frank edge
#

Okay, thanks!

As for the elements portion, I'm looking into it now but I think I'm creating a paymentIntent first that is based on price (actual price not id) and currency and getting back a clientsecret

But from the looks of it I'm supposed to be making a subscription with the priceid and customerid is that right? and THAT returns a clientsecret to finish the Elements?

tight trench
#

For subscription, then yes! You should create a Subscription with Price ID and Customer ID, then return the client secret of the latest invoice to complete payment with Elements

#

Payment Intent creation should only be used for one-time payment

frank edge
#

Does the subscription object have a 'client_secret' property the same way a paymentIntent object has one?

#

Oh, I see, it's berried deeper: subscription.latest_invoice.payment_intent.client_secret is that right?

tight trench