#jordash_api
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/1225258247494172674
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jordash_api, 2 hours ago, 29 messages
Here is the code I am using
customer: stripeCustomer.id,
usage: 'on_session',
payment_method_types: ['card_present'],
}, {stripeAccount: process.env.connected_account});
let reader = await stripe.terminal.readers.processSetupIntent(reader_id, {customer_consent_collected: true, setup_intent: setupIntent.id}, {stripeAccount: process.env.connected_account});```
That's how I generate the setup intent which is working.
But then when I try and attach the setupIntent like this:
await stripe.paymentMethods.attach(setupIntent.payment_method, {customer: stripeCustomer.id}, {stripeAccount: process.env.connected_account})```
What steps should I follow to save the card for future payment from a terminal card reader?
Then I get this error:
ERROR PaymentMethods of type 'card_present' cannot be saved to customers.
The SetupIntent will generate another PM which can be used to attach
I think I found it, I had to do this:
let setupIntent = await stripe.setupIntents.retrieve(paymentIntent.id, {expand: ['latest_attempt']}, {stripeAccount: process.env.connected_account});
let paymentMethod = setupIntent.latest_attempt.payment_method_details.card_present.generated_card;