#HarryET - client_secret

1 messages ยท Page 1 of 1 (latest)

upper wasp
atomic kernel
#

Even on the server side

upper wasp
#

Yes if you are retrieving the object it will be there

atomic kernel
upper wasp
#

You can see it's listed as expandable on that object

atomic kernel
#

Right, but in the go sdk its nil even after expansion

upper wasp
#

Can you share your code and the invoice id you're checking?

atomic kernel
#
        subscriptionParams := &stripe.SubscriptionParams{}
        subscriptionParams.AddExpand("latest_invoice.payment_intent")
        subscription, err = sub.Get(subscriptionId, subscriptionParams)
upper wasp
#

Can you share the subscription id?

atomic kernel
upper wasp
#

Oh it's because latest invoice is for $0

atomic kernel
upper wasp
#

So the payment intent is null since it's a $0 invoice

#

there was no payment intent created

atomic kernel
#

ohhhh, is there a way to make a payment intent for the customer to store the payment details?

upper wasp
#

Let's step back for a moment. What does your flow look like currently and what are you ultimately trying to do?

atomic kernel
#

It's a SaaS product and on account creation I also register a stripe customer. I then have an endpoint which either creats or returns the subscription's ID and the client secret and it is used with the Stripe Checkout Element

wise valve
#

๐Ÿ‘‹ Just hopping in since @upper wasp has to head out soon

#

When you create a Subscription and the first Invoice has no payment required ($0), you can expand 'pending_setup_intent' on the Subscription instead, to get a Setup Intent that you can use to collect payment details

wise valve
#

Yup!

atomic kernel