#shahzaib_terminal-reusable
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1296503769344901202
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
shahzaib_terminal-reusable
Basically In my application, I am handling subscription manually meaning I just store customerId and paymentMehtodId and when time comes for payment, I use them to do a payment. I am successfully doing that with other payment methods but "card_present" is giving me this error "The provided PaymentMethod type (card_present) cannot be reused. You may only use this PaymentMethod type by providing it via payment_method_data on a new PaymentIntent."
PaymentMethods with a card_present as the type are single-use and can't be reused no.
But Terminal offers a flow where during the in-person payment you can save the underlying card as a card PaymentMethod that is reusable. See https://docs.stripe.com/terminal/features/saving-cards/overview
I am doing that still, we use payment method id get above mention error
And you check my request "req_vYEsGfWnE1VZ4J"
You aren't doing that if you are passing the card_present PaymentMethod id though
The doc I shared explains this clearly when it says
To save a card from a Terminal PaymentIntent, attach the
generated_cardPaymentMethod to a Customer.
you are misunderstanding how this works. You have a PaymentIntent pi_123 that is paid with Terminal and gives you the PaymentMethod pm_ABC with type: 'card_present'
What it does is create a separate PaymentMethod pm_XYZ that has type: 'card' and that's the id you need to use for future payments
Does that make sense?
Yes, meaning I will use "pm_XYZ" with payment method type "card"
yes, and right now you are using pm_ABC
how can I get pm_XYZ from intent
here is intentId "pi_3QAIBSCLCRxVyViw01DMLsfA"
const paymentMethodDetails = paymentIntentObject.data.object.charges.data[0].payment_method_details;
const savedPaymentMethod = paymentMethodDetails.card_present.generated_card;
Sorry did you those docs? They link you to https://docs.stripe.com/terminal/features/saving-cards/save-after-payment which clearly explains this in details
ah you figured it out
Yeah thanks I understand now, I should used "pm_1QAIBYCLCRxVyViwe0w6OVHw" instead of "pm_1QAIBXCLCRxVyViwuCwqVelY"
Just one last question in "payment_method_types" of intent should I use "card" or "card_present"
Meaning for first transaction "card_present" but when next payment of subscription comes then "card"