#jordash_api

1 messages ¡ Page 1 of 1 (latest)

dapper tinselBOT
#

👋 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.

elder sageBOT
#

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.

velvet spruce
#

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.

elder sageBOT
eternal monolith
#

The SetupIntent will generate another PM which can be used to attach

velvet spruce
#

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;