#Murali-Card
1 messages · Page 1 of 1 (latest)
Hi Jack,
Yes , I did attached a setup intent to customer id
OK, basically two steps
- Use
listPaymentMethodsAPI to get thecardpayment method of the customer https://stripe.com/docs/api/payment_methods/customer_list - Once you have the payment method object, look for the
card.last4field https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-last4
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.
I m testing using postman , before writing the actual logic in React & Node.
when I try to create a customer with below payload
email: 'jenny.rosen@example.com',
payment_method: 'pm_card_visa',
invoice_settings: {default_payment_method: 'pm_card_visa'}
I am getting below customer response object
{
"id": "cus_LEtjaqNSyLCZCj",
"object": "customer",
"address": null,
"balance": 0,
"created": 1646118960,
"currency": null,
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": null,
"invoice_prefix": "C8195732",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null
},
"livemode": false,
"metadata": {},
"name": null,
"next_invoice_sequence": 1,
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none"
}
I provided email, default_payment_method. But still I m not receiving those details in return customer object.
the payment method property is not available in customer object, you need to use https://stripe.com/docs/api/payment_methods/customer_list API instead.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.