#Felix Cao
1 messages · Page 1 of 1 (latest)
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 center 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.
Or can you share with me the request_log_url?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
No I mean the request_log_url that you can get from the response.
wait a moment
let me check
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
that PaymentMethod belongs to a different customer
可是我刚新注册的,新加的
i'm sorry, but we're only able to help in English here
to be clear, that PaymentMethod is attached to cus_O9oeV3HmH8f1rs
no, the Stripe account header is not the reason.
This is the request for which you created the SetupIntent and passed in that specific customer id : https://dashboard.stripe.com/test/logs/req_kWNaZcF0SJsCBg
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
so subsequently when you confirmed that SetupIntent, that PaymentMethod was automatically attached to the customer : https://dashboard.stripe.com/test/logs/req_QmJ7XaKox0OR7q
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
/**
* @param {number} amount - will pay the amount
* @param {string} currency_code
* @param {string} customer_id
* @param {string} payment_method_id
* @param {string} connected_account_id
* @param {string} reference_number
*/
async function createCharge(amount, currency_code, customer_id, payment_method_id, connected_account_id, reference_number) {
try {
const paymentIntent = await stripe.paymentIntents.create(
{
confirm: true,
customer: customer_id,
currency: currency_code,
metadata: { reference_number },
amount: parseFloat(amount) * 100,
payment_method: payment_method_id,
automatic_payment_methods: { enabled: true, allow_redirects: 'never' },
},
{
stripeAccount: connected_account_id,
}
);
return paymentIntent;
} catch (err) {
console.log('Stripe Error log message: ', err.raw.message);
console.log('Stripe Error log URL: ', err.raw.request_log_url);
throw new Error(err.raw.message);
}
}
So, the above code, I don't need to pass the payment_method_id to stripe ?
Hi @karmic hazel can you tell me what you want to achieve?
I had get the customer_id and payment_method_id
and collected the payment detail
So I want to charge the it
Please help me to check:
customer_id: cus_O9oe71luyVtSMU
payment_method: pm_1NNV1UKg0o5MtnuxvTiOEqfN
So you want to create a direct charge on a connected account.
Yes
Ok, did you get any error when you execute createCharge ?
Yes the above error
request ID?
I tried to delete the payment_method_id on the above code
But still get 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.
Before this log --- added the payment_method_id
https://dashboard.stripe.com/acct_1NL0eJKg0o5Mtnux/test/logs/req_5jlE9xiYZwKcGJ?t=1687846084
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
In req_3buyL4DKluC2Fo, you didn't specify a payment_method but confirm is set to true
In req_5jlE9xiYZwKcGJ, you specifed a payment_method that doesn't belong to the customer.,
Use a payment_method that belongs to the customer, and try again.
I use the same card to more than 2 account
Is this the reason?
4242 4242 4242 4242 08/24 123 94107
No
even if the card number is the same, the payment methods that created from the same card number are considered as different objects.
What do you mean?
how to attach the payment_method_id to customer_id
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
const {error} = await stripe.confirmSetup({
elements,
clientSecret,
confirmParams: {
return_url: 'https://example.com/complete',
},
});
These code can attach the payment_method_id to customer_id ?