#feni-patel_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/1305797142220242975
đ 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.
- feni-patel_api, 3 days ago, 45 messages
- feni-patel_api, 3 days ago, 11 messages
- feni-patel_webhooks, 4 days ago, 21 messages
- feni-patel_webhooks, 5 days ago, 7 messages
- feni-patel_webhooks, 5 days ago, 17 messages
- feni-patel_api, 5 days ago, 6 messages
Hello @granite hazel
Hi there, how can I help?
I have implemented the saparate charge and transfer method for payment. so i have one question when i am creating the payment intent do i need to add meta data, so that i came to know which cutsmer make payment . how can i do that ?
const response = await stripe.paymentIntents.create({
amount:finalAmountWithTax * 100,
currency: 'usd',
payment_method_types: ['card'],
description: Payment for booking ID: ${bookingDetails._id.toString()},
transfer_group: bookingDetails._id.toString()
});
You can pass a customer when creating a paymentIntent
can you provide some guide related to this ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have one more question, i need to allow user to make payment with the same card, so will this possible using the separate charge and transfer method ?
You mean you want to block payments if the customer uses a differnt card?
no, it's not like that. user is able to make payment with creating the new card and also able to male payment with same card. i want to cover both of the cases
Ok, no problem. You can use seperate charges and transfers for this scenario.
means if one customer make payment with new card then this card is created so i can stored that card id into database. so if custoer wants to make payment with that card id then they are able to make payment.
so my question is how can i achieve this flow ?
So you want to get the payment method ID from the paymentIntent and save the ID in your DB? https://docs.stripe.com/api/payment_intents/object#payment_intent_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes, correct
Ok, when the payment completes successfully (i.e., its status is succeeded), you can get the payment_method from the PaymentIntent object. Refer to the API reference that I shared earlier
when any customer make payment with the new card and if payment is completed then i am getting the one "payment_method" data, which i will store in my database and when user wants to make payment with same card at that time i need to make payment with the same card id then i want to pass the payment method id into below api to creat payment inetent with the same payment method id ?
const response = await stripe.paymentIntents.create({
amount:finalAmountWithTax * 100,
currency: 'usd',
payment_method_types: ['card'],
description: Payment for booking ID: ${bookingDetails._id.toString()},
transfer_group: bookingDetails._id.toString()
});
Yes you should specify the payment_method when creating the payment Intent https://docs.stripe.com/payments/save-during-payment?platform=web&ui=elements#charge-saved-payment-method refer to this doc for more details
Ok that's great, Thanks