#Simo-savedcards

1 messages · Page 1 of 1 (latest)

ivory quartz
#

@stable plover hi! well if you have already used the card_xxx then you can't attach it to a customer any more, you generally have to do that before charging it for the first time.

#

(card_xxx is a legacy object type too and you should use PaymentMethods pm_xxx, which those guides do).

stable plover
#

Thanks! I know how it usually goes, but a client of mine is using an idiotic platform that integrates with Stripe and only makes a charge (ch_123) without creating a customer. So I don't have a customer or a PM

#

I have the charge object, from which I can get the customer email (and create a customer via the API) and the card_123

#

And I wanted to link those together

#

This is what the support told me

#

Sure, in this case, with the Card ID you'll create the source :
https://stripe.com/docs/sources/cards#create-source

Then attach the source to the customer:
https://stripe.com/docs/sources/cards#attaching-the-source-to-a-customer
(create call for new customer, update call for existing customer)

Then, you can either:
create a charge for that customer :
https://stripe.com/docs/sources/cards#making-a-charge-request-to-finalize-the-payment
create a payment_intent for that customer :
https://stripe.com/docs/payments/save-and-reuse?platform=web#web-create-payment-intent-off-session

In that payment_intent, you would use payment_method=card_xxx

#

BUT I don't see how to create a source from an existing card

ivory quartz
#

integrates with Stripe and only makes a charge (ch_123) without creating a customer.
so if it does that then you have no way to get the card details and charge them again, you would have to recollect them from the customer.

#

And I wanted to link those together
you can't do that

#

support's answer is just confusing there and I'd mostly ignore it unfortunately

#

your only option here is to change what that platform does so that it does save cards(using our current integrations ideally), there's nothing you can really do for existing payments made, the design of the API is that if you create a Token and charge it, that's it, the card details are 'consumed' and you can't attach them to a customer object later.

stable plover
#

Thanks for that! I'll look for another way around it and maybe change the platform

stable plover
#

Hey, another question regarding this thing. What my client wants is basically to charge the card via Stripe's dashboard (or via Stripe's API). They have a space lending business and sometimes people need overtime and my client wants to be able to charge them for that without having them make the payment themselves again

#

This is why I started with the above approach - having a Stripe customer record with a Payment method linked. That way the PM could be charged either through Stripe's dashboard or through the API.