#kr7pt0

1 messages · Page 1 of 1 (latest)

lofty hingeBOT
#

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.

  • kr7pt0, 4 hours ago, 4 messages
  • kr7pt0, 4 hours ago, 12 messages
molten jasper
#

Hello

#

You want the balance transaction related to the Charge

#

So you likely want to listen for payment_intent.succeeded and then you retrieve the PaymentIntent and you expand the latest_charge.balance_transaction (info on expanding responses here: https://stripe.com/docs/expand)

analog topaz
#

the LatestCharge does not exist in my PaymentIntent response. Which version of the SDK is this for ?

molten jasper
#

Which SDK are you using?

analog topaz
#

i still have 39.95.0

molten jasper
#

Which language?

analog topaz
#

.NET

molten jasper
analog topaz
#

hmmm. are there big braking changes when upgrading to 41.0.0 ? the application is a bit bigger

molten jasper
#

If you don't want to upgrade you can also get the Charge ID from charges.data[0].id

#

And then retrieve the Charge and expand the balance_transaction

analog topaz
#

okay let me try it really quick

#

okay now my webhook crahses.. do i have to change settings in my dashboard to get this working again ?

Stripe.StripeException: Received event with API version 2020-08-27, but Stripe.net 41.0.0 expects API version 2022-11-15. We recommend that you create a WebhookEndpoint with this API version. Otherwise, you can disable this exception by passing throwOnApiVersionMismatch: false to Stripe.EventUtility.ParseEvent or Stripe.EventUtility.ConstructEvent, but be wary that objects may be incorrectly deserialized.
at Stripe.EventUtility.ParseEvent(String json, Boolean throwOnApiVersionMismatch) in //src/Stripe.net/Services/Events/EventUtility.cs:line 47
at Stripe.EventUtility.ConstructEvent(String json, String stripeSignatureHeader, String secret, Int64 tolerance, Int64 utcNow, Boolean throwOnApiVersionMismatch) in /
/src/Stripe.net/Services/Events/EventUtility.cs:line 128
at Stripe.EventUtility.ConstructEvent(String json, String stripeSignatureHeader, String secret, Int64 tolerance, Boolean throwOnApiVersionMismatch) in /_/src/Stripe.net/Services/Events/EventUtility.cs:line 88
at ichsagsnicht.Services.Payment.PaymentService.ConstructEvent(String json, StringValues header) in /Users/yannickkraus/Documents/workspace/ichsagsnicht/backend/ichsagsnicht/ichsagsnicht.Services.Payment/PaymentService.cs:line 392

molten jasper
#

You need to create a Webhook endpoint that pins to the right version. So as the error says you need to use 2022-11-15 -- so you specify that version when you create your Webhook endpoint: https://stripe.com/docs/api/webhook_endpoints/create#create_webhook_endpoint-api_version

Overall, if you are going to upgrade I'd suggest just upgrading to the newest version of the SDK and API. However, you should make sure to thoroughly test before doing that to make sure you handle any breaking changes.