#linqisnice_unexpected

1 messages · Page 1 of 1 (latest)

regal vaultBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1303342260829818961

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

novel atlas
outer shell
#

👋 happy to help

#

would you mind sharing the checkout session ID please?

novel atlas
#

Sec, let me see

#

cs_live_a1GD5CJRoQPNJF9AAKwClEQCL7mHaTZPQfhPBCG4DpUEJxZaHxrDVtUGTx

This is the one from live, same issue. but i can check the test one that i just tried sec

#

for some reason, the error isn't showing up in my logs when i go to test mode in stripe

#

so i cant see the checkout session

#

ah nvm it's my bad, that was pointing to the wrong environment. let me retry

outer shell
#

no worries

novel atlas
#

Regarding that first question though, it appears as though the payment went through, no?

outer shell
novel atlas
#

judging from the reaction of the button

outer shell
#

are you sure the // is needed?

novel atlas
#

no that's incorrect, but it trims it when i paste that into the browser.

#

also if it went through, how can i not see it anywhere?

#

i cant see it in my account, i cant see it on stripe

#

it never hit any of my webhooks

outer shell
#

you won't see in it your logs if you're looking at the Platform's account

#

and in your registered connect webhook endpoints you're only listening to the account.updated event

#

which explains why you're not receiving any events

novel atlas
#

No but it never hits the webhook because i can't see it in my logs

#

i have logging in hte webhook

#

at the top and bottom

outer shell
#

this checkout session was not made on the platform account

#

it's made on the connected account

#

this means that your normal webhook handler won't receive these events

#

you need to subscribe to listen to these events on the Connect webhook endpoint

novel atlas
#

Man Im thoroughly confused by this connected stuff. It's been a constant thorn in my side haha

#

wait

#

let me see

#

so this is wrong?

outer shell
#

no it's the one below

novel atlas
#

the one below is for stripe account updates...

outer shell
#

type Account means that the events are happening on your account

novel atlas
#

the one above is for checkout sessions

outer shell
#

nop!

#

wait

#

give me a couple of minutes to explain this

novel atlas
#

they are different endpoints for different purposes

#

yes sure

outer shell
#

You as a platform are creating checkout sessions on behalf of your connected account, right?

novel atlas
#

I can't remember anymore since I've changed it so many times as per the recommendations here. I think the current iteration is correct, let me check my code.

outer shell
#

the checkout session object is not created on your platform account but rather on the Connected Account in this case

outer shell
#

So basically the platform account acct_1Owjb6GPWwmX339c is creating the Checkout Session on the Connect Account acct_1PRsUyQHwUK2JlBY

#

so the triggered events are also created on the connect account and not the platform account

#

Does that make sense?

novel atlas
#

So we have ONE connected account. It was registered like this:

#

yes im readng secd

outer shell
#

ok! that's not the code I'm talking about though! I'm talking about the Checkout Session creation function

novel atlas
#

this is how the checkout session is created

#

I'm guessing the requestoptions is the culprit there

#

but this is how I'm supposed to do it, correct? as this is what I was recommended here by another dev (or multiple)

outer shell
#

as you can see you're passing the StripeAccount header

novel atlas
#

cant remember, but I've changed ths a few times since our business model was unclear.

outer shell
#

which makes this a Direct Charge

novel atlas
#

yes

#

this is what we want, iirc

outer shell
#

perfect

novel atlas
#

i've gone back and forth on this

outer shell
#

now that we know where the objects are created let's move to the complexity of webhook endpoints

#

there are 2 types of webhook endpoint

#

one is to listen on the events that are triggered on your own account (type Account)

#

the other is to listen on the events that are triggered on your connect accounts (type Connect)

#

since you're listening to the checkout.session.completed event on the Account webhook and the event is triggered on the connect account this means you won't receive it

novel atlas
#

right ok, so, remind me again why I wanted direct charge. In my documentation I've noted:

"For standard accounts, there's 1 payment strategy (direct charge). Direct Charge means the transaction is between OUR customer (the connected account) and their customer. They don't even need o be aware of our platform's existence. We (the platform) can decide whether the Stripe fee is carged on us or the connected account"

is this correct?

outer shell
#

it's correct except this part

We (the platform) can decide whether the Stripe fee is carged on us or the connected account"
the Stripe fee is paid by the Connect Account and the Refund/Disputes liability is also shifted to them

#

you can actually lower your application_fee if you want to cover the Stripe fees but that's another story

regal vaultBOT
novel atlas
#

Right, ok.

So then, why didn't this transaction show up in my bank account? I tried a live transaction. It just hasn't showed up yet is all?

#

But I see what ur saying. That makes more sense. I just need to redirect the webhook, right?

#

ie. change the type

fossil narwhal
novel atlas
#

Yes ok, that seems like it should fix it. But I still had a checkout session fetch error after that

#

resource_missing
No such checkout.session: cs_test_b1vIy3kiTI3GVLs9uaBAGFnHgweF97JgVkriqlYWwrjSQdOD31coTDnzjV

this one

fossil narwhal
#

remember that you need the StripeAccount option when retrieving an object referred to by an event on a connected account. The account is a key in the event your webhook handler recieved so you can know what account ID to use

novel atlas
#

Right. But why did the retrieve checkoutsession fail?

fossil narwhal
#

probably because you didn't pass a Stripe-Account header or you passed it with the ID of the wrong account

novel atlas
#

right ok, thanks a lot. ill see if i can get it to work!

#

btw'

#

is there a reason we used to have multiple payment methods in the checkout but now it just defaults to card?

#

dont think i've changed anything

fossil narwhal
#

is the ID you posted just above an example of a CheckoutSession where that was the case?

novel atlas
#

yes, you can see it in the video

fossil narwhal
#

are you based in Ireland when you load the Checkout page, or Sweden?

novel atlas
#

sweden

#

where does it say ireland?

fossil narwhal
#

because other than card the other available method for the Session is Klarna and that can be filtered out by:
https://docs.stripe.com/payments/klarna

If you’re based in the EEA, UK, or Switzerland, then you can transact with consumers across the EEA, UK, and Switzerland,** provided the presentment currency matches the currency of the customer’s country.** For example, a Swedish business can present in EUR to accept Klarna from a buyer in Germany.

#

I think the IP address of your backend server that calls the API is in in Ireland so I was just quickly checking if it's that

novel atlas
#

We used to be able to Swish too, which I guess was part of Klarna

#

Hmm, ok. That might be it, it's hosted on azure. but should that really affect it?

#

is there anything I can do about that?

fossil narwhal
#

no, Swish is its own method.

novel atlas
#

right ok, we had klarna, swish and card before

#

not sure why it's gone

#

the currency of the checkout was SEK

#

swedish krona

fossil narwhal
#

right ok, we had klarna, swish and card before
before what?

#

the specific reason Swish is not available on that Session is because the connected account does not have that method active/onboarded.

novel atlas
#

I think before we moved to direct charges. So... can WE the platform set this up for the connected account? so they automatically get swish and klarna if possible?

fossil narwhal
novel atlas
#

that's weird, i can swear we had swish before. the connected account even has swish payments

fossil narwhal
novel atlas
#

yes

#

last payment was aug 7

fossil narwhal
#

then there you go then

novel atlas
#

actually

fossil narwhal
#

we had to stop offering Swish due to reasons I can't get into so it's been moved back to an invite-only beta for now, you likely recieved emails about this at the time

novel atlas
#

but we have klarna there, too. So why did it all that disappear? is that becaues of how we're creating the checkout session now? because of direct charge?

fossil narwhal
#

and to be clear Klarna does seem to be active on that Session. Not sure what "all that" means specifically. If it just means "swish" that was explained above

novel atlas
fossil narwhal
#

yes

novel atlas
#

yes well as u can see in the video above, klarna doesnt come up as an option

#

that's why i thought it was weird

#

because i can swear i'd enabled that.

#

nvm

#

im lying, klarna is there

#

😬

fossil narwhal
#

yes, it is there in the video

novel atlas
#

but yes this makes a lot of sense haha, thanks a lot. I'll try to fix the webhook then. Thanks for the help!

novel atlas
#

Btw, one last question if that's fine. How often should I be updating the api version?

#

I got api version mismatch on my webhook. my webhook is 2024-04-10 but Stripe.net 45.10.0 expects API version 2024-06-20

#

it seems the acacia release fixes this so i should just update everything to that?

#

"With the 2024-09-30.acacia release, Stripe follows a new API release process. As a result, you can safely upgrade your webhook endpoints to any API version within a biannual release (like acacia) without upgrading the SDK."

fossil narwhal
#

it's hard to say, there's no set requirement. Historically I would have said update it when you're making large changes or adding new features. As of September we are now doing a 6 month release schedule of API versions. Every 6 months there is a large release (Acacia is the first) and then every month there are smaller point releases with no breaking changes.

for webhooks, yes that mismatch is a pain.

it seems the acacia release fixes this so i should just update everything to that?
it fixes it in that the latest version of stripe-dotnet can handle a webhook in any of those "point" releases of Acacia. But it can't handle 2024-04-10 no.

novel atlas
#

wouldn't just updating the endpoints to the latest version and updating the stripe sdk to the latest version fix it, then?

fossil narwhal
#

your options are basically

#

SDK == stripe-dotnet, if not clear

novel atlas
#

yeah, i see it's a bit different. some classes are gone from the SDK. like the static Events class. Where can i best check what's missing? in the sdk changelog on github?

#

so this broke

#

i'll check it out

fossil narwhal
#

that's a breaking change mentioned in the changelog yes

novel atlas
#

right, that's great. thanks. is it possible to update the existing webhooks or do i need to recreate them?

#

in the stripe dashboard

#

ah i'll just update teh account api version

fossil narwhal
#

that also works, but I'll just caveat that making changes like this can break your live integration if you have one(like you have other endpoints expecting not to have the webhook version change on them)

novel atlas
#

Absolutely, thanks a lot for the help. much appreciated!

#

but this would update all my webhooks, right?

fossil narwhal
#

it updates the versions of all webhook endpoints that are not pinned to a specific version(which is probably all of them). Sorry, it's all quite complicated.

novel atlas
#

ok makes sense. thanks a lot! i wont bother you anymore now haha