#adminimvbox

1 messages · Page 1 of 1 (latest)

modest ospreyBOT
wanton briar
#

So a Payment Method object can represent any type of payment method. A Payment Method object may have a Card object nested under it if it represents a card payment method.

Sources are deprecated, so if you're implementing a new feature/workflow, you should just use Cards and Payment Methods.

#

Not sure if that all answers your questions, but I'm happy to clarify or get you oriented in a different direction if that answer isn't helpful

tired scroll
#

thanks. Is it possible with php to convert payment method to card?

wanton briar
#

Are you creating a Card because you're on a legacy system that uses Cards and Sources? Or are you creating a new workflow entirely?

tired scroll
#

yes creating a card because previously on legacy system we used Sources. Now we've added on new website ability to add card/delete card/set as default. But all of our old users don't have a card added just a payment method.

wanton briar
#

That's odd. Why do your old users have Payment Methods if they're using Cards and Sources? Normally they would only be on one or the other. Are you sure you're not getting these mixed up?

#

Cards and Sources is the deprecated/legacy tech. Payment Methods are the new tech

tired scroll
#

when i check a customer on stripe dashboard, under Payment methods, the first has an ID of pm_xxxx and other card we added through the dashboard,which has id card_xxxx

wanton briar
#

Yeah, Payment Methods still have Cards, but the Sources + Cards implementation is deprecated. Do you know how your system is creating Payment Methods right now?

tired scroll
#

I'll confirm this with developer next week. Is there a way to add payment methods default as card default? I just looked at first time customer and they have a payment method (pm_xxxx) but no card on file(card_xxxx)

wanton briar
#

I think you may have a fundamental misunderstanding of how these objects work and what they're used for. I would recommend having the developer in this chat, as they would likely understand all of this stuff right out of the gate (plus this chat is specifically for developers)

#

Is there a way to add payment methods default as card default?
Yeah, Payment Methods can be set as default on the Invoice object (if you're using Invoices): https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method

Otherwise you would just specify which Payment Method to use for Payment Intents

tired scroll
#

I'm a developer working on a new feature. I understand how it works. With stripe-php package when i retrieve cards for a first time customer, object is empty. Now when i switch to get all paymentmethods for that customer, payment method object is returned, and i can access cards. However these cards have a different ID, which is pm_xxxxx. If i add a card to file on the stripe dashboard for this cusomter, the new card has an ID card_xxxxxx.

#

I'm asking with the cards api, is there anyway for me to assign this payment method as a card? Because no cards are be returned when i use the cards api.

wanton briar
#

Do you have an ID of a Payment Method that has no Card on it?

tired scroll
#

yes, just a minute.

#

pm_1MKjPC4AwZRIpujQQF3of0Fx

#

if i use customer api, no cards are returned for this customer

#

Here's another this customer: cus_N4urpox7Ru6CYT , if i search using customer API no card is returned. Payment method: pm_1MKl2Z4AwZRIpujQ5Bcp96h6

wanton briar
#

Okay, so you have a Card on that Payment Method, but it doesn't have it's own ID to use. So, what are you hoping to do with the Card ID?

tired scroll
#

set as default source

#

but this required customer id and card id.

#

this feature is for customers to set default card in their billing section

wanton briar
#

Are you using Invoices or Subscriptions?

tired scroll
#

To update the default source? or are you referring to when user pays?

wanton briar
#

I mean, does your integration use those products when interacting with the Customer object?

tired scroll
#

Subscriptions

wanton briar
#

So in that case you would use the Payment Method ID to set default_payment_method on the Customer object. Subscriptions use Invoices for creating payments, so setting this will make sure that the default is set: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method