EphemeralKey in .NET Stripe SDK does not have the field "secret" causing an error "Secret not found"

I am creating a .NET c# back-end and following the instructions from the Stripe docs (Stripe Docs)

However, in the .NET SDK the EphemeralKey class does not contain the "secret" field (NET SDK EphemeralKey.cs)

How is it supposed to return the field that the Android SDK looks for (Android SDK EphemeralKey.kt) if it’s not there ?

Stripe do have a sample app but that does not work with the .NET back end – same error.

I have successfully integrated Stripe.NET about 3 years ago but there seem to be some changes that have not been well integrated perhaps.

EDIT: I have realised that the EphemeralKey.cs class needs that secret field. Thus I just branched the sdk code and added the field and everything works fine. But is that the best solution ?

Add Comment
1 Answer(s)

I found that you are supposed to use the RawJson field so I just need to have that field in my response model class.

I was not looking for it, because i was trying to use the SDK EphemeralKey class but that’s not what that’s for, since this is a response from your server not Stripe API

So I just need to parse the response for the RawJson field and then create a model class out of that, which will have the secret field in it

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.