#ceylon3388_code
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/1222247578972979244
đ 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.
- ceylon3388_code, 7 minutes ago, 8 messages
- ceylon3388_api, 9 hours ago, 65 messages
- ceylon3388_api, 6 days ago, 2 messages
Hello again! Can you give me the Payment Intent ID or the Event ID so I can take a look?
@alpine moth You there?
im here
Can you give me one of those IDs?
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;
});```
This does seem a bit unexpected, checking on that. Regardless, though, what you can do is listen for payment_intent.amount_capturable_updated instead of payment_intent.created. Have a look at this Event for the same Payment Intent, for example: https://dashboard.stripe.com/test/events/evt_3Oyd7RQGkRLVMROd1pJFYQcT
It sounds like that would be more appropriate for your use case.
i listen to both and they each give me requires_payment_method at times
Can you share an example of one that has requires_payment_method?
i temporarily removed the logic from that but im deploying it again
should be quick
ok
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.
Youre right, i shoudl probably just remove the created webhook logic
it tends to happen after the updated which didnt make sense to me
Events can come in any order: https://docs.stripe.com/webhooks#event-ordering
Happy to help!