#Sh0w3D - JSON
1 messages ยท Page 1 of 1 (latest)
Hi there!
Are you trying to get a customer with https://stripe.com/docs/api/customers/retrieve?lang=dotnet ?
I just need one specific customer
And is that code working? If not, what is the error message?
Yes, the code is working
So what is the issue?
Just the json response is too big. Like the stripeResponse object is additional and unwanted and some properties look something like:
testClock": null, "rawJObject": { "id": [], "object": [], "address": [ [ [] ], [ [] ], [ [] ], [ [] ], [ [] ], [ [] ] ],
and this:
stripeResponse": { "content": "private", "statusCode": 200, "headers": [
stripeResponse is unwanted property. when i request Customer
and response is like:
customer object,
stripeResponse object
I want only customerObject
this is response
It does not look like person class
some customer properties have nested rawJObject properties and that is not what customer in docs look like
test.json contains fake data**
@grizzled scarab, sorry to bother but please check the file i'll upload and (correct me if I am wrong) please check if this is Customer api response with customer object
๐ taking over for my colleague. Let me catch up.
thank you
are you using await with the GetAsync?
you shouldn't be getting a raw body, you should receive the Customer Object
no worries
i don't know how to send the code
you can use three `
ohh
that will generate a code span
Okey, thank You
The same response came for list of customers, with controller return type StripeList<Customer>
what I don't understand is where are you reading the JSON response?
In Postman
you should only care about the Customer object
I know and I am returning the Customer object
I am using Clean Architecture dot .NET 6.0
I don't understand the question then
you shouldn't concern yourself with the raw body of the request
this is used by our SDK to construct the correct object you are awaiting for
So I need You api to return CLEAN CUSTOMER object, but You give me additional unwanted info, and I don't know how to remove or avoid the info
I can't return to my frontend this kind of object
I need clean customer object
it is a clean Customer object if you use the Customer object provided by the SDK
if there are info you don't need to send to the front-end you'd have to build your own object
and do some mappings
Hey, taking over here. Can you clarify the Q?
yes, one moment
Look at this json
This is Your api response for customerService.GetAsync()
but it does not look like Customer object in documentation
It contains rawJObject
Can you share the code you're using to make the API request
This is my code
If You need any more information, You can call me on discord in a few moments
I don't know if it'll be easier to explain while talking
We don't do voice calls
Ok, no problem
I am not mapping any returned object and everywhere I am returning type Customer
Which version of stripe-dotnet are you using?
This is just a part of how that SDK works. As it's a typed lib, we need a way to return undocumented/beta parameters from the API: https://github.com/stripe/stripe-dotnet#properties
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - GitHub - stripe/stripe-dotnet: Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class libr...
So, how do I avoid returning undocumented properties?
You can't
Oh
I get it, thanks
I'll just create new Customer and fill it with retrieved data from api
This way I can remove some of the unwanted properties
thank you all for your time
np!