#Murali-Card

1 messages · Page 1 of 1 (latest)

ivory prawn
#

Hi there, have you collected the payment method and attach it to customer?

whole trail
#

Hi Jack,
Yes , I did attached a setup intent to customer id

ivory prawn
#

OK, basically two steps

  1. Use listPaymentMethods API to get the card payment method of the customer https://stripe.com/docs/api/payment_methods/customer_list
  2. Once you have the payment method object, look for the card.last4 field https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-last4
whole trail
#

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.

ivory prawn