#ceylon3388_code

1 messages ¡ Page 1 of 1 (latest)

vale grottoBOT
#

👋 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/1222247578972979244

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

undone oceanBOT
#

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.

wicked verge
#

Hello again! Can you give me the Payment Intent ID or the Event ID so I can take a look?

#

@alpine moth You there?

alpine moth
#

im here

wicked verge
#

Can you give me one of those IDs?

alpine moth
#

evt_3Oyd7RQGkRLVMROd1oVtlSSy

#

i can still capture it and the intent has a payment method attached in the stripe dashboard

#

im just concerned how this will behave in production

#

Here is my implementation to authorize funds:

    const cloned_payment_method = await stripe.paymentMethods
      .create(
        {
          customer: customer.id,
          payment_method: paymentMethodId
        },
        {
          stripeAccount: fleet?.connectedStripeAccountId
        }
      )
      .catch(err => {
        throw "Error cloning payment method" + err;
      });
    const pi = await stripe.paymentIntents
      .create(
        {
          amount: amount,
          currency: "usd",
          payment_method: cloned_payment_method.id,
          capture_method: "manual",
          confirm: true,
          description: "Rental authorization: Amount " + amount,
          expand: ["latest_charge"],
          metadata: {
            customerId: customer?.id,
            fleetRef: fleet?.id,
            bookingId: booking?.bookingId,
            connected_account_id: fleet?.connectedStripeAccountId
          },
          application_fee_amount: calculateFumesFee(amount),
          return_url: "https://owner.fumes.app/#/dashboard"
        },
        {
          stripeAccount: fleet?.connectedStripeAccountId
        }
      )
      .catch(err => {
        throw "Failed creating payment intent:" + err;
      });```
wicked verge
#

It sounds like that would be more appropriate for your use case.

alpine moth
#

i listen to both and they each give me requires_payment_method at times

wicked verge
#

Can you share an example of one that has requires_payment_method?

alpine moth
#

i temporarily removed the logic from that but im deploying it again

#

should be quick

#

ok

wicked verge
#

The requires_payment_method is expected for the .created Event as that's the status for all Payment Intents when they're first created internally. I would not expect that status for .amount_capturable_updated but I'd like to see a specific Event to be sure.

alpine moth
#

Youre right, i shoudl probably just remove the created webhook logic

#

it tends to happen after the updated which didnt make sense to me

wicked verge
alpine moth
#

i understand

#

thank you Rubeus

wicked verge
#

Happy to help!