#ceylon3388_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/1221996860626047066
📝 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_api, 5 days ago, 2 messages
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", // Set the appropriate currency
payment_method: cloned_payment_method.id,
capture_method: "manual",
confirm: true,
description: "Rental authorization: Amount " + amount,
automatic_payment_methods: {
enabled: true,
allow_redirects: "never" // did not work without this
},
expand: ["latest_charge"],
metadata: {
customerId: customer?.id,
fleetRef: fleet?.id,
bookingId: booking?.bookingId,
connected_account_id: fleet?.connectedStripeAccountId
},
return_url: "https://owner.fumes.app/#/dashboard"
},
{
application_fee_amount: calculateFumesFee(amount),
stripeAccount: connectedAccountId
}
)
.catch(err => {
throw "Failed at paymentIntents:" + err;
});
Can you share the request ID (req_xxx) that you are facing error? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_a2dhciy3wjGqOp
This https://dashboard.stripe.com/test/logs/req_a2dhciy3wjGqOp was successful with 200 status code. I don't see any error
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
yes but its giving me a "requires_payment_method" status
please refer to the code block i posted above
is it correct?
im able to capture with the "requires_payment_method" status, but i worry how this will behave in production
This request showed the status as succeeded. Where did you see requires_payment_method status from?
https://dashboard.stripe.com/test/payments/pi_3OyMno4aQWfIHion1RsiNI3s also showed succeeded and it was refunded later
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
i listen to payment intents on connected accounts. The event where it sets status to "requires_payment_method" is when this event fires.
"payment_intent.amount_capturable_updated"
The payment_intent.amount_capturable_updated event https://dashboard.stripe.com/test/events/evt_3OyMno4aQWfIHion1ZJp7fql for this payment intent showed requires_capture status
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Not requires_payment_method status
requires_capture status is expected for payment_intent.amount_capturable_updated event
evt_3OyMno4aQWfIHion1JVzO8il
this happened before i captured it
that status reflects on my UI
This is payment_intent.created event: https://dashboard.stripe.com/test/events/evt_3OyMno4aQWfIHion1JVzO8il
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This is expected
When a payment intent is created, it doesn't have a payment method yet - that's why the status in requires_payment_method
but i am cloning the payment method when i make the authorization
just want to reiterate that
if thats how the api behaves then i have no issue, i just don't want to do something incorrectly just because its accepted
Ah! I see where you're coming from. The payment method was set in the Payment Intent creation request and its response returned requires_capture status, but payment_intent.created event reflected as requires_payment_method status. Let me double check why this happened
We are unable to find out why this happened and it shouldn't be the case. Can I suggest writing to Support https://support.stripe.com/contact/email with the issue and example Payment Intent ID now, so that I can find the email and escalate to the relevant team?
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
We will follow up the issue from there
Let me know once you email in
one more question
from the logs, how can i see how this request was made. Like what parameters?
req_kDDX2vn4bX4Axo
It can be found in https://dashboard.stripe.com/test/connect/accounts/acct_1OW7Be4aQWfIHion/activity > Choose "From the account" tab and look for req_kDDX2vn4bX4Axo
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
it says it used charge api but i cant see it used in the stripe shell
im just trying to refund the payment intent but it says charge id or payment intent id does not exist. Again this is on a connected account.
case "refund_charge":
try {
if (!amount) {
throw "No amount to refund specified";
}
functions.logger.info("Refund Payment intent", paymentIntentId);
// Payment Intent here is actually Charge ID
return await stripe.refunds.create({
charge: paymentIntentId,
amount
});
} catch (error) {
throw error;
}```
also tried
return await stripe.refunds.create({
payment_intent: paymentIntentId,
amount
});```
Hi @royal glen I'm taking over this thread
thanks
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_WQ7AKDnhr7KQUo
one i just created
webhook "payment_intent.created" gives me "requires_payment_method"
This is on a connected account
This request succeeded. Can you share with me the ID of the request that failed?
No requests are failing
im getting "requires_payment_method" status when i cloned it upon creating the payment intent
You said "I'm just trying to refund the payment intent but it says charge id or payment intent id does not exist."
oh that was a side question not my main issue
i have resolved it by passing the connected account id
are you able to look at my technical implementation?
OK. So what's the PaymentIntent ID?
pi_3OyRhkQGkRLVMROd1lfPrydD
Its status is require_capture, not require_payment_method.
Ok, it's indeed require_payment_method in the payment_intent.created event
I listen for the events on my webhook handler
payment_intent.created & payment_intent.amount_capturable_updated, either one can give me the require_payment_method status
can i show you how i create the payment intent?
In evt_3OyRhkQGkRLVMROd1V3E1Aqx I saw the status is already require_capture
yes but sometimes its require_payment_method
either one can set that status
should i ignore that?
Do you have a payment_intent.amount_capturable_updated event with require_payment_method status? can you share with me the ID?