I use a Stripe Checkout session to set up a payment intent and want to expand the card property, nested three levels deep.
According to the documentation, I can expand a property and a sub-property with dot-notation:
const session = await stripe.checkout.sessions.retrieve(session_id, {
expand: ["setup_intent.payment_method"]
});
Then I receive this response:
{
id: 'cs_test...",
...
setup_intent: {
id: 'seti_1MDYkcAphQbVdSksInihHamA',
...
payment_method: {
id: 'pm_1MDYknAphQbVdSks1a1eohA7',
object: 'payment_method',
billing_details: [Object],
card: [Object],
...
type: 'card'
},
...
}
I would like to also expand the card to get the fingerprint and check if it is a duplicate. So I use this:
const session = await stripe.checkout.sessions.retrieve(session_id, {
expand: ["setup_intent.payment_method.card"]
});
But the result is the same as above: card: [Object] and it does not show the card's fingerprint.
The request does not throw an error on Stripe's end, so I presume that the syntax is correct.
Is this lack of expansion due to being in test mode? If not, how can I tell Stripe to include the card's fringerprint?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/6HiEc4R
Comments
Post a Comment