#vrk-payment-intent-transfer

1 messages · Page 1 of 1 (latest)

plain wyvernBOT
fresh rose
#

I am always getting the "Object Reference not set to an instance of an object" error while geetting

snow oyster
#

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?

fresh rose
#

I am inspecting the body

snow oyster
#

Can you share a bit of your event handler code?

fresh rose
#

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

odd stump
#

Hello! I'm taking over and catching up...

fresh rose
#

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

odd stump
#

Can you give me the Event ID for one of the payment_intent.succeeded Events where you're getting this error?

fresh rose
#

evt_3OgyoSHvbngkCFkt0GoSF65r

#

and PaymentIntentID: pi_3OgyoSHvbngkCFkt00fMFRol

odd stump
#

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.

fresh rose
#

Okay Thanks

odd stump
#

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?

fresh rose
#

I will do that, Thanks for you'r help