#ayesha-shaikh_api

1 messages ¡ Page 1 of 1 (latest)

echo eagleBOT
karmic creekBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

echo eagleBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1255405402061803614

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

latent solstice
#

What do you mean by "card ID" ?

flat orbit
#

card_1PQu83GXlQ7PG1unVG3XIOaX

#

something like this

latent solstice
#

I don't quite follow you, is you question related to a payment method https://docs.stripe.com/api/payment_methods/object or card https://docs.stripe.com/api/issuing/cards/object ?

flat orbit
#

so, this customer (cus_Q7KpchZFMkmqr2) has card payment method (9729), but I dont see any card id there

latent solstice
#

I just checked and yes they have a card payment method, the payment method object ID starts with pm_

flat orbit
#

and how to get card id for that?

latent solstice
#

There's no card ID here because there's no card object

#

Can you tell why you need a card ID?

flat orbit
#

to create invoices for them

#

and we are using card id & storing it in our system as well

latent solstice
#

You can also use a payment method to create an invoice. Have you tried it?

flat orbit
#

this is how I am creating invoice req_NsQQdPz4uFcbUL

latent solstice
flat orbit
#

yeah that can be used - but I am using sources and card only - to use default_payment_method will require additional code changes which is not planned yet and this is the only customer with no card id -- so is there anyway i can get card id for that payment method?

latent solstice
#

No

#

And I'd highly recommend you upgrading to the PaymentMethod API.

#

Meaning you can pass a card ID to default_payment_method when creating an invoice.

flat orbit
#

but cant pass pm_id to default source?

#

is there anyway for billing portal to create card instead of payment method? like can I change this -- is there any setting for that?

latent solstice
#

No you can't use PM ID with default_source I'm afraid.

#

No, there's no options to make billing portal create card objects intead of payment methods

flat orbit
#

so that when customer adds a method through billing portal it will have card id and my current implementation will work as is

#

okay thanks!

#

just to confirm again, for this customer's payment method there is no card id. if I have to create invoice for them, only way is to have pm_id passed to default payment method instead of default source

latent solstice
#

To summarize, all you need to do is change your code and replace default_source with default_payment_method.

#

And it will work for both payment methods, and legacy card objects

flat orbit
#

any other changes that I'll have to care of if I use default_payment_method instead of source? like web hook etc.

latent solstice
#

Sure, your webhook endpoint should expect the invoice object has default_payment_method instead of default_source.

flat orbit
#

thanks

flat orbit
latent solstice
#

Is it about ACH direct debit?

flat orbit
#

evt_1P98KhGXlQ7PG1unkmx30wHr

#

this customer has bank account cus_Py90TDCGMRDz0Z, for them if I have to create invoice