#anarkali_42928
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- anarkali_42928, 15 minutes ago, 11 messages
Because you didn't reply. We close threads after ~30 minutes of inactivity
ok
sent you screen shot
here when i call CreateCustomer , that direct goes to exception
That looks like an exception thrown by your code, not necessarily an API request returning an error. You can see in the screenshot it returns a 200 reponse indicating success
before 2 weeks it was working fine
Sure, maybe your code has changed?
No
we have not changed code
we cheking with release package
which was already tested
please check screen shot it goes to Stipe.Exception
this is stripeexception class from Stripe.net dll
Please do this
As you can see that request was successful and returned a 200 response
{<Stripe.StripeResponse status=200 Request-Id=req_DLIA42OXEMrRMW Date=2024-02-13T10:26:23>}
So your code in that block where that API call is made is throwing an exception. You need to debug that
call from service.create direct jump to exception
and service,create is Stipe.net dll method
have you seen Message in first screen shot?
Which version of the .NET SDK are you using?
.Net standard 2.0
Stripe.Net is of 39.126.0.0
this line throws exption
you there ?
Yes, please be patient
ok
@next siren can you copy and paste the complete Message from the exception so we can see the full string?
ok
Give me 5 min please
Invalid response object from API: "{
"id": "cus_PYQWpFWhwU0P4c",
"object": "customer",
"address": {
"city": "Andover",
"country": "US",
"line1": "456CranberryStreet",
"line2": "",
"postal_code": "67002",
"state": "KS"
},
"balance": 0,
"created": 1707821824,
"currency": null,
"default_currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "basketball.stadium@customer35.consolidatedmessenger.com",
"invoice_prefix": "75976849",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": {
"CustomerId": "1001"
},
"name": "BasketballStadium",
"phone": "987-555-0145",
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}"
Above is full string from Message
hmm. What version of the Newtonsoft Json.NET DLL does your project use? have you patched it in any way?
13.0.2.27524 this is Newtonsoft Json version we are using
does this only happen when creating Customers or when making other API calls?
not checked with other call, Can i give a try ?
sure, please do try.
Yes this happens to each API call
Invalid response object from API: "{
"id": "pm_1OjJqWG4DeLvSy0OGXBAXlBt",
"object": "payment_method",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"country": "US",
"exp_month": 12,
"exp_year": 2025,
"fingerprint": "Gb0HxNnr4LInZsej",
"funding": "credit",
"generated_from": null,
"last4": "1111",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"created": 1707822496,
"customer": "cus_PYQWpFWhwU0P4c",
"livemode": false,
"metadata": {},
"type": "card"
}"
i tried PaymentMethodService.Attach
hmm. I guess I'd suggest uninstalling the stripe-dotnet and JSON.NET dependencies from your project entirely and then adding them back, maybe something is corrupt in your environment.
hmm, not sure what else to try then. One option is to try using the latest version of stripe-dotnet, but that will require updating your overall code.
I suppose you could try a small standalone project doing some basic API calls, using the latest version of stripe-dotnet, and see if that has the same problem when deployed in the same environment.
Yes, i tried with latest Stipe.Net dll and that break our integration
if we want to use latest stripe , do we need to re-wite code?
yes, there are breaking change in each major version X.y.y. and you'd be moving from 39.y.y to 43.y.y
We get below errors with latest Stripe.net
'SessionLineItemOptions' does not contain a definition for 'Amount'
'SessionLineItemOptions' does not contain a definition for 'Currency'
'SessionLineItemOptions' does not contain a definition for 'Description'
'SessionLineItemOptions' does not contain a definition for 'Name'
'PaymentIntent' does not contain a definition for 'Charges' and no accessible extension method 'Charges' accepting a first argument of type 'PaymentIntent' could be found
What will be substitute for this ?
for SessionLineItemOptions, passing a Price object, or using PriceData.
for PaymentIntent, use LatestCharge instead. https://stripe.com/docs/upgrades#api-changelog:~:text=The charges property,latest_charge property instead.
note there would be many many changes here so I can't go through all of them with you.
What I would suggest is setting up a really simple project with a simple API call to just e.g. create a Customer and nothing else, use the latest version of stripe-dotnet in that project, and then deploy and run that project in the same environment as your application with the problem and see if it works or not. If it works then you at least have some sort of path forward, if it doesn't then you know something is strange in your environment/dependencies
ok