#Yaziiit

1 messages · Page 1 of 1 (latest)

main swift
#

Hello! What do you need help with?

hybrid brook
#

Hi

#

i work with subscription

#

what us the best way to create a route for updating user cards ?

#

im using this

#

await this.stripe.paymentMethods.attach(
paymentMethod,
{
customer: customerId,
}
);

#

service side

#

and

#

const result = await stripe.createPaymentMethod(
{
card: await elements?.getElement(CardElement),
type: 'card',
billing_details: {
name: cbName,
},
})

#

client side

#

but when i use this, the old card is still by default

rich ether
#

@hybrid brook 👋 taking over as Discord is super busy right now, answering a few other people but I'll be right back

hybrid brook
#

no problem

rich ether
#

@hybrid brook So first we recommend using the SetupIntent API to collect card details without a payment. See https://stripe.com/docs/payments/save-and-reuse this is a way better flow, allows you to do 3D Secure if needed, etc. Don't create the PM yourself and attach it.