#kumar-PaymentMethod

1 messages · Page 1 of 1 (latest)

autumn lion
#

Hi there, can you share with me the code you wrote to retrieve the PaymentMethod?

halcyon nest
#

Sure

#

even I've tried to expand customer

autumn lion
#

Is this paymentMethod saved to a customer?

halcyon nest
#

how can I check that is it attached to the customer or not? can you help me !

autumn lion
#

Copy and paste the payment method ID to this chat

halcyon nest
#

pm_1LEXliDevSu7SoWJAS9yUDaA

autumn lion
#

Does paymentMethodDetails.id yield pm_1LEXliDevSu7SoWJAS9yUDaA ?

halcyon nest
#

Yes

autumn lion
#

can you print out the paymentMethod and let me take a look?

halcyon nest
#

{
"id": "pm_1LE9cEDevSu7SoWJVHs1n4cH",
"object": "payment_method",
"acss_debit": null,
"afterpay_clearpay": null,
"alipay": null,
"au_becs_debit": null,
"bacs_debit": null,
"bancontact": null,
"billing_details": {
"address": {
"city": null,
"country": "IN",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "as.sds@gmail.com",
"name": "ters",
"phone": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"country": "US",
"description": null,
"exp_month": 4,
"exp_year": 2054,
"fingerprint": "StzDox5zsVnyw5Zg",
"funding": "credit",
"iin": null,
"issuer": null,
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"card_present": null,
"created": 1656065995,
"customer": null,
"eps": null,
"fpx": null,
"giropay": null,
"grabpay": null,
"ideal": null,
"interac_present": null,
"livemode": false,
"metadata": {},
"oxxo": null,
"p24": null,
"sepa_debit": null,
"sofort": null,
"type": "card"
}

autumn lion
#

The PaymentMethod ID is different, it's not pm_1LEXliDevSu7SoWJAS9yUDaA

#

So this PaymentMethod pm_1LE9cEDevSu7SoWJVHs1n4cH is not saved to a customer yet.

halcyon nest
#

I have sent you the different payment Id details which I was trying earlier

#

forget the above, can you tell me is there any way to get setup_intent id i.e. "seti_1LEXugDevSu7SoWJ9D6l7MDG", with the help of payment method id i.e. "pm_1LEXliDevSu7SoWJAS9yUDaA"

autumn lion
#

You can't get setupIntent ID from PaymentMethod, but you can get PaymentMethod ID from SetupIntent.

#

Maybe you want to tell me what you want to achieve here?

halcyon nest
#

I am implementing webhook when a payment method is detached from a customer, I have to update our system too. For that I need the Stripe Customer ID or Setup_intent Id to verify and update our system.

#

As we store only Stripe's customer id and setup_intent id in our system.

autumn lion
#

What info do you need to update your system?

halcyon nest
#

Stripe Customer Id

autumn lion
#

And the webhook event that you are listening to?

halcyon nest
#

payment_method.detached

autumn lion
halcyon nest
#

Okay thanks