#linqisnice_unexpected
1 messages · Page 1 of 1 (latest)
👋 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.
here's a video too if that's interesting
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
no worries
Regarding that first question though, it appears as though the payment went through, no?
I can see you have as a return URL https://app.anigma.pongosystems.com//return?session_id={CHECKOUT_SESSION_ID}
judging from the reaction of the button
are you sure the // is needed?
yes it did go through
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
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
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
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
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?
no it's the one below
the one below is for stripe account updates...
type Account means that the events are happening on your account
the one above is for checkout sessions
You as a platform are creating checkout sessions on behalf of your connected account, right?
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.
the checkout session object is not created on your platform account but rather on the Connected Account in this case
based on the Checkout Session you shared that's what I see
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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?
ok! that's not the code I'm talking about though! I'm talking about the Checkout Session creation function
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)
as you can see you're passing the StripeAccount header
cant remember, but I've changed ths a few times since our business model was unclear.
which makes this a Direct Charge
perfect
i've gone back and forth on this
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
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?
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
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
I can't answer the bank question. For the webhook part, https://stripe.com/docs/connect/webhooks , you create a Connect-type endpoint that recieves events on a connected account
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
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
Right. But why did the retrieve checkoutsession fail?
probably because you didn't pass a Stripe-Account header or you passed it with the ID of the wrong account
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
is the ID you posted just above an example of a CheckoutSession where that was the case?
yes, you can see it in the video
are you based in Ireland when you load the Checkout page, or Sweden?
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
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?
no, Swish is its own method.
right ok, we had klarna, swish and card before
not sure why it's gone
the currency of the checkout was SEK
swedish krona
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.
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?
to an extent yes : https://docs.stripe.com/connect/dynamic-payment-methods you configure available payment method types that way but the complication is Swish is not a public payment method AFAIK (it's still in beta and each account has to be manually onboarded)
that's weird, i can swear we had swish before. the connected account even has swish payments
was it before august when this happened? https://support.stripe.com/questions/swish-payments-are-temporarily-paused-for-some-users
then there you go then
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
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?
if you use Direct Charges then the model is different yes and it's the capabilities/settings of the connected account that matter, see https://docs.stripe.com/connect/dynamic-payment-methods
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
so if I want klarna there too by default, without teh connected account having to set that itself, I should follow this? https://docs.stripe.com/connect/dynamic-payment-methods
yes
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
😬
yes, it is there in the video
but yes this makes a lot of sense haha, thanks a lot. I'll try to fix the webhook then. Thanks for the help!
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."
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 handle2024-04-10no.
wouldn't just updating the endpoints to the latest version and updating the stripe sdk to the latest version fix it, then?
your options are basically
- upgrade SDK to the latest, and change your webhook endpoint to use the latest version too
- downgrade SDK to the version that is pinned to
2024-04-10 - create a new webhook endpoint that uses the API version
2024-06-20which your installed version of stripe-dotnet can handle (you can't use the dashboard for that, but the API allows it : https://docs.stripe.com/api/webhook_endpoints/create#create_webhook_endpoint-api_version )
SDK == stripe-dotnet, if not clear
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
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
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)
Absolutely, thanks a lot for the help. much appreciated!
but this would update all my webhooks, right?
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.
technically the safe/tactical way to make the change is to create a brand new endpoint set to the use "Latest" API version, and direct that URL to your new code using the SDK version; or to use https://docs.stripe.com/api/webhook_endpoints/create#create_webhook_endpoint-api_version to create an endpoint pinned to a version). But upgrading your account default does update versions of endpoints yes.
ok makes sense. thanks a lot! i wont bother you anymore now haha