#ahmad-confirmcardpayment
1 messages ยท Page 1 of 1 (latest)
Can you clarify what you're doing here exactly
You can provide that PM explicitly based on what you attached to the customer, but we recommend flipping this around and confirming the initial payment of the new subscription using elements in the front end app:
https://stripe.com/docs/billing/subscriptions/build-subscription?ui=elements#collect-payment
Note this requires using payment_behavior=default_incomplete as included in the examples here
I understand. We would need to update our integration to follow that pattern. For now since we are attaching that token id directly to the customer, is there a way to retrieve the related payment method id from somewhere preferably from the response of customer or subscription creation?
Where do you supply the token when creating the customer?
If you have an older integration, you might be attaching as a source
stripe.customers.create({ email: 'test2@test.org', card: tokenId });
as a card
I am attaching it as a card
@tired anchor, it seems like you are on many threads at the same time ๐
So instead of this, you can use the same card element to createPaymentMethod and associate the produce payment_method with the customer
https://stripe.com/docs/api/customers/create#create_customer-payment_method
then also use that ID with the subscription/confirmation
if you need to retrieve it you can do that here: https://stripe.com/docs/api/payment_methods/customer_list