#vrk-payment-intent-transfer
1 messages · Page 1 of 1 (latest)
I am always getting the "Object Reference not set to an instance of an object" error while geetting
That sounds like a syntax error
Though does this mean you're making a separate call after receiving the event or are you inspecting the body of the payment_intent.succeeded event?
I am inspecting the body
Can you share a bit of your event handler code?
PaymentIntent? paymentIntentSucceeded = JsonConvert.DeserializeObject<PaymentIntent>( message );
if( paymentIntentSucceeded is null )
{
success = false;
kLog.Error( $"{eventType} event received without a related PaymentIntent.\n{message}" );
break;
}
if( paymentIntentSucceeded.TransferData != null )
{
kLog.Info( $"{paymentIntentSucceeded.TransferData.DestinationId}" );
}
if( paymentIntentSucceeded.TransferData != null )
{
kLog.Info( $"{paymentIntentSucceeded.TransferData.Amount}" );
}
I am getting the value of "paymentIntentSucceeded.TransferData.DestinationId" but not the value of Amount
Hello! I'm taking over and catching up...
Thanks
I am trying to access the PaymentIntent.TransferData.Amount and PaymentIntent.TransferData.DestinationID during the payment_intent.succeeded webhook event, I am getting the DestinationID but not Amount
I am getting the "Object Reference not set to an instance of an object" error for amount
Can you give me the Event ID for one of the payment_intent.succeeded Events where you're getting this error?
There is no amount property under transfer_data in that payload, so that seems to be expected.
transfer_data is present, and destination is present inside it, but that's it.
Okay Thanks
Your code has two if( paymentIntentSucceeded.TransferData != null ) lines. Maybe you need to alter the second to check for the presence of the Amount property instead?
I will do that, Thanks for you'r help