#rajput.abd_22
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- rajput.abd_22, 4 hours ago, 4 messages
- rajput.abd_22, 21 hours ago, 4 messages
- rajput.abd_22, 1 day ago, 20 messages
- rajput.abd_22, 1 day ago, 10 messages
- rajput.abd_22, 2 days ago, 5 messages
- rajput.abd_22, 6 days ago, 16 messages
this is my first question on this topic
i need to confirm payment but payment is not getting confirm
Could you please share the PaymentIntent ID pi_xxx?
There's an error message, do you see it?
yupp i see that but i don't have any idea how to resolve it
Basically, if you want to charge this bank account Payment Method in the future, you will need to collect customer's consent: https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-mandate_data
But what are you using to collect the payment details?
means??
const paymentMethods = await stripe.paymentMethods.list( {
customer: customerId,
});
i am fetching the paymentMethods details by this
Are you using Payment Element?
yes
@raw salmon is someone there
Catching up
I'm really sorry but I don't understand what you're asking. What does "i need to confirm payment but payment is not getting confirm" mean?
is there some code you ran that is giving an error?
can you share the exact complete frontend code you're using?
okay
nodejs
`module.exports.createSubscriptions = async ( data ) =>
{
try
{
const { customerId, description, items, payment_settings } = data;
const add_invoice_items = data.add_invoice_items ? { add_invoice_items: data.add_invoice_items } : {};
return await stripe.subscriptions.create( {
customer: customerId,
description: description,
items: items,
...add_invoice_items,
payment_behavior: 'default_incomplete',
payment_settings: payment_settings,
expand: [ 'latest_invoice.payment_intent' ],
} );
} catch ( error )
{
throw error;
}
}`
module.exports.retrievePaymentMethod = async ( customerId, type ) => { try { const paymentMethods = await stripe.paymentMethods.list( { customer: customerId, }); const paymentMethod = paymentMethods.data[ 0 ]; return { paymentMethodId: paymentMethod.id, billing_details: paymentMethod.billing_details, card: paymentMethod.card, us_bank_account: paymentMethod.us_bank_account, type: paymentMethod.type } } catch ( error ) { throw error; } }
the above is backend code(nodejs) for creating a subscription.
`elements = { clientSecret: data.subscription.clientSecret, paymentMethodId: data.subscription.paymentMethodId }
async function confirmPaymentThroughParent ( elements ){
stripe.confirmPaymentIntent( elements.clientSecret, {
payment_method: elements.paymentMethodId,
} ).then( function ( result ){
} );
}`
this is frontEnd code
but i have two types of payment method
card and us_bank_account