#Stephen He-setupintent
1 messages ยท Page 1 of 1 (latest)
Do you have the id of a SetupIntent that you saw this behavior with?
Copying your other messages here
I just create setupIntent first, and then use following to confirm setupintent
var options = new SetupIntentConfirmOptions
{
PaymentMethod = paymentMethodId,
};var service = new SetupIntentService(); var result = await service.ConfirmAsync(setupId, options, _myStripeOptions); return result;It is successful
thank you
I see a payment_method returned by that call with id src_1I4hM6EHlrcq0Td7GsTsyHK9 https://dashboard.stripe.com/test/logs/req_7aIp2PoTdp2Jol
What are you checking where the payment method is empty?
so after calling confirm setup intent by passing existing payment method id into it
I wanna see card object of payment method from the result of confirmed setup intent
I wanna fetch funding and country from card object
You will want to modify your SetupIntent create call to expand the payment_method property https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
By default, only the ID of the PaymentMethod is returned, but if you expand the payment_method property, the full object comes back
Otherwise you will have to do a separate lookup to get the full object
just add options.AddExpand("PaymentMethod")?
I believe so yes
If that does not work, it may be expecting the lower case version payment_method
Try it out and let me know what you see
this is the code I used
var options = new SetupIntentConfirmOptions
{
PaymentMethod = paymentMethodId,
};
var service = new SetupIntentService();
var result = await service.ConfirmAsync(setupId, options, _myStripeOptions);
let me test now.
got error
{"This property cannot be expanded (PaymentMethod)."}
try payment_method
I see in the .NET version of our docs it still uses the other style of name for these properties
options.AddExpand("payment_method")?
Correct
https://stripe.com/docs/api/expanding_objects
https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this https://stripe.com/docs/api/expanding_objects is useful, but I never realize it is working for other apis.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.