#SGAlistair-card-default

1 messages · Page 1 of 1 (latest)

radiant dirge
#

@bronze condor it could be many things. Do you have more specific details like an example customer id cus_123 that I can look at?

bronze condor
#

cus_J6XyRbauUSvQM7

radiant dirge
#

Okay it's because you use 2 separate APIs, one is legacy and one isn't. If you look at that customer it has 2 cards, one is a PaymentMethod (newer API from 2018, more powerful) with an id pm_123'. The other one is a Card (Legacy from 2010) with an id card_123.
Those are compatible but they behave differently.

The first one is the default right now because you have explicitly set invoice_settings[default_payment_method] on that Customer and it will be automatically used for Subscriptions and Invoices in the future.
The other one is... the default too, because it's a Card object and one of those is always marked as the default in default_source, or in your case default_card because you are on an extremely old API version (almost 10 years old 😅 )

#

Basically, it looks like your integration is using newer APIs now like SetupIntent and PaymentIntent but you still have some parts of your integration using the legacy Card and Token APIs and they behave subtly differently

bronze condor
#

hmm, okay. We don't reference PaymentIntent or SetupIntent anywhere in our application but we use Stripe Elements in some places so maybe that part is the newer api?

#

Are there docs somewhere for upgrading?

radiant dirge
#

and that Connect platform uses the newer APIs. You won't be able to use the PaymentMethod pm_123 properly on Charges because they are incompatible

#

@bronze condor does that unblock you?

bronze condor
#

Sort of, I understand the issue now at least. I've been updating the card when I should have been updating the payment method so I need to figure out how to do that still. Looking at https://stripe.com/docs/api/customers/update I see that there is a parameter to set the payment method when creating a customer but that parameter apparently isn't there on update so I'll have to figure how I'm supposed to update that.

radiant dirge
#

@bronze condor the PaymentMethod works differently. But you really need to first explain what you are really trying to do. If you integration was built in 2012 and uses Cards and Tokens and Charges you'll never be able to use that PaymentMethod properly that the Connect platform created

bronze condor
#

I want to let customers change which card they are using for their subscriptions

radiant dirge
#

Okay and you never do one-off charges? Only Billing/Subscriptions?

bronze condor
#

We have a separate Stripe account for one off orders. This account is only for the subscriptions

radiant dirge
#

Okay so that should work fine in that case, but you need to take into account the fact that some Customers will have a PaymentMethod

bronze condor
#

Okay, I don't know what the Connect platform you're referring to is. So when updating a card I could create a card https://stripe.com/docs/api/cards/create and then update the default payment method of the customer?

#

And I would pass in the card id to default_payment_method?

#

hmm I'm getting Stripe::InvalidRequestError: Received unknown parameter: default_payment_method

radiant dirge
bronze condor
#

Oh it's under invoice_settings, that's probably why

radiant dirge
#

there's the platform's name in the top right column

#

And yes it's under invoice_settings

bronze condor
#

I saw the link. I still don't know what a connect platform is but I don't think I need to here.

#

I think it's working now, thanks for your help

radiant dirge
#

Okay you or someone at your company configured the platform ChurnBuster to help you recover lost revenue. And that company is connected to your Stripe account and collects new card details for you

bronze condor
#

Okay, yeah looks like that was set up long before I started on the project. Thanks

radiant dirge
#

sure! Let me know if you're still blocked