#Mr Stinky Pants

1 messages · Page 1 of 1 (latest)

scarlet tundraBOT
storm field
#

Can you share the evt_xxx ID

fathom tide
#

evt_1M6WDBJKY8YXH2zhN9YF95Q7

#

if you look at the response i have sent the header and body to check

#

it is sending an event saying the intent requires me to take action, would that affect it?

storm field
#

Are you using stripe-dotnet?

fathom tide
#

yes you can ignore that as its being sent from webservice

#

yes

#

i mean its weird i have a setup intent created here that i just sent which is ok evt_1M6X0HJKY8YXH2zhi8q9DfKH

storm field
fathom tide
#

ill try this , throwOnApiVersionMismatch: false

storm field
#

Yeah the The signature for the webhook is not present in the Stripe-Signature header error isn't the actual error, you'd get the actual issue from err.Message

#

What version of stripe-dotnet are you using?

fathom tide
#

that is the error it gives in ex.Message

#

catch (StripeException ex)
{
responseJson.Add(new JProperty("status", "Stripe error"));
responseJson.Add(new JProperty("error", ex.Message));
}

#

this is what is posts back to stripe

#

40.14.0.0

storm field
#

Hmm, that version should be compatibler with the API version on that event (2022-08-01)

fathom tide
#

it must be the format of the body

#

but it works on some and no others

storm field
#

Is there an evt_xxx example that 'works'?

fathom tide
#

evt_1M6X0HJKY8YXH2zhi8q9DfKH is ok - this one not evt_1M6WAZJKY8YXH2zhEWVYhiG8 - same type of event

#

although just looking at that body has a lot of \\\

storm field
#

evt_1M6X0HJKY8YXH2zhi8q9DfKH is the most recent one, ~1 hour after evt_1M6WAZJKY8YXH2zhEWVYhiG8

#

Has something changed in your code? Can you try and trigger another event?

fathom tide
#

no changed, its send ok for me

#

i just sent this one evt_1M6XZjJKY8YXH2zhdgf3wrfr . ok

#

maybe something to do with the clients device?

storm field
#

Not sure what you mean?

fathom tide
#

does it generate something in the stripe.js that affects the body being sent?

storm field
#

Nope, nothing will impact the signature other than the endpoint the event was sent to (e.g. its signed with the unique secret of that endpoint)

#

If there's a mismatch in your code between what event was signed with and your secret, then it'll error

fathom tide
#

yes but have you seen the \\ in the failing event? evt_1M6WAZJKY8YXH2zhEWVYhiG8

storm field
#

That's the response you've returned to us, I guess you're parsing it somehow

fathom tide
#

thats the body its using in EventUtility.ConstructEvent(

storm field
#

Then something in your webhook code is malforming the payload before you pass it to the method

#

That method expects the raw event payload from us

fathom tide
#

yes but the code is the same for all events and it is ok for some

#

ill try find another way to get the body

storm field
#

Can you share your code?

fathom tide
#

var requestMessage = OperationContext.Current.RequestContext.RequestMessage;
var messageDataProperty = requestMessage.GetType().GetProperty("MessageData", (BindingFlags)0x1FFFFFF);
var messageData = messageDataProperty.GetValue(requestMessage);
var bufferProperty = messageData.GetType().GetProperty("Buffer");
var buffer = bufferProperty.GetValue(messageData) as ArraySegment<byte>?;
body = Encoding.UTF8.GetString(buffer.Value.Array);

#

the problem is im using web service becasue thats where my app code is

#

its in wcf .svc file

storm field
#

Yeah I'm not overly familiar with .NET and that ecosystem but I suspect either your code or the host/service is malforming the payload somehow

#

That's how we recommend you handle signature verification with stripe-dotnet

fathom tide
#

yes i did try but i have never used .net core

#

i think it needs a bit more info on this page for someone who hasnt use core before

storm field
#

What .NET flavour are you using?

fathom tide
#

just normal .net framework

#

ill try using this again

fathom tide
#

sorry it seems to have this problem here Received event with API version 2022-08-01, but Stripe.net 41.1.0 expects API version 2022-11-15.

#

did you say you need to delete the webhook in dashboard

#

this is on test mode

storm field
#

Oh, I thought you were using version 40.14.0

fathom tide
#

sorry i just got that .core app and did an update on the stripe etc

#

as that was using a very old version

storm field
#

Then yep, that will be an issue. Versions of the .NET library are fixed to a specific API version, which needs to match the version of the API event(s)

fathom tide
#

so you delete the webhook?

#

you cant updat eit?

storm field
#

Well your account default API version is 2022-08-01

#

So you're going to encounter more issues using 41.x (which is fixed to 2022-11-15)

fathom tide
#

so you just do upgrade api in dashboard to fix it?

storm field
#

I wouldn't just blindly upgrade your API version without first understanding the (breaking) changes and how they may impact your integration: https://stripe.com/docs/upgrades

Keep track of changes and upgrades to the Stripe API.

fathom tide
#

well i dont have a working api yet anyway

storm field
#

But yes, you either need to revert to 40.x of stripe-dotnet or upgrade API version of your webhook/account

#

By default, webhooks are set to the account API version so then that changes they automatically change too