#afenster
1 messages · Page 1 of 1 (latest)
An example is pi_3MRlHlR9Aspy0pBQ14TaVmK8
Hi, you do not pass the customer id, https://stripe.com/docs/api/payment_intents/object?lang=node#payment_intent_object-setup_future_usage. The Payment Method attachment can happen after the PaymentIntent is confirmed and any required actions from the user are complete.
When I run my code, I am getting this:
I retrieve the PaymentIntent, but the PaymentMethod is null. The PaymentMethodId has a value, but PaymentMethod is null.
I'm trying to get pi.PaymentMethod.Card, but PaymentMethod is null.
The payment has to be completed. You complete the payment, then create the customer, then attach the payment method to the customer.
So if I do the capture, then PaymentMethod will no longer be null?
That is correct
It's the payment method id
I see that has a value. It had a value before capture too. But I want to get at the paymentIntent.PaymentMethod.Card object. Is there some way to do that?
Maybe I take the payment method ID and retrieve the payment method, and then I can get it?
I need the last 4 digits of the card that was used.
In short, maybe this isn't about the PaymentIntent so much as a .Net question. I know there's a PaymentMethod out there. But when I retrieve the PaymentIntent object, all it has is the ID. It doesn't have the PaymentMethod object.
I see, in this case, yes. You'd need to retrieve the Payment Method and attain the card object, https://stripe.com/docs/api/payment_methods/retrieve