#manish_checkout-savedcard
1 messages ¡ Page 1 of 1 (latest)
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.
- manish_api, 56 minutes ago, 36 messages
- manish_api, 22 hours ago, 13 messages
- manish_api, 1 day ago, 33 messages
- manish_api, 1 day ago, 16 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1246202411375398973
đ Have more to share? Add details, code, screenshots, videos, etc. below.
stripe.checkout.sessions
.create(
{
customer: "cus_xxxxx",
currency: "usd",
mode: "setup",
success_url: "https://developer.com/success",
cancel_url: "https://developer.com/test/cancel",
},
{
idempotencyKey: uniqueKey,
}
)
.then(result => {
console.log("RESULT BLOCK");
console.dir(result, { depth: null });
})
.catch(error => {
console.error("ERROR BLOCK");
console.dir(error, { depth: null });
});
@worldly charm Can you clarify what you mean "charge the payment after"?
so i created a checkout session so that customer can add the payment method at a certain stage in my site
now i want to charge the customer for the payment method which the user added
i was following this https://docs.stripe.com/payments/save-and-reuse
step 5 is a bit confusing
in step 5 it asks us to use payment intent https://docs.stripe.com/api/payment_intents/confirm
but in step 4 i dont get anything related to payment intent in the response
Sorry that's still really confusing to me. Why are you using the Checkout Session in setup mode if you're taking a payment right after?
lets take some example
customer creates an account on my site, after account creation, i trigger the checkout session in setup mode and he enters his payment details in it.
after 5-6 days he wish to order a product from my site, now when he clicks on the checkout button he gets redirected to stripe with his saved payment method
i hope this makes sense now
ah okay so the payment is 5/6 days later.
Honestly I think you're optimizing for the wrong thing. If you are going to send them back to Checkout 5/6 days later, there's no point collecting the card details upfront
i mean they can use the same payment method multiple times
what would you suggest?
If you send them to Checkout, don't bother getting them to pre-save their card details. Checkout doesn't show the previously saved card anyway except in a really specific flow.
So I would say just send them to Checkout by creating a new Checkout Session with mode: 'payment' this time and it will all just work
i understand what you are trying to say
but this is the business requirement
i dont have an ecom site i just gave you an example
Just to be clear, I work for Stripe, I know our products inside out. What you are trying to do will not work. When they come back 5/6 days later they won't see the card they had before
So for what time span does the payment details remain ?
It's really complex. But if you want to go deep I recommend carefully reading: https://support.stripe.com/questions/prefilling-saved-cards-in-checkout
manish_checkout-savedcard
PCI Compliance SAQ A will work with the above approach you mentioned?
yes, PCI is completely unrelated.
Okay
just to make sure i expressed my use case in a better way, i am summarising the things here
I wanted to attach a payment method to a customer so that i can charge it at a later stage
but i want to charge for any payment method
I don't know what those words mean unfortunately "for any payment method".
I asked and you explicitly said you are sending the customer to Checkout when they come back 5 days later
Suppose a user adds paypal on setup
ah man this is getting complex
sorry to bother
Can you help me with this one please?
https://docs.stripe.com/payments/save-and-reuse
You need to clarify your question for me to help you
Step 4 says
Using the setup_intent ID, retrieve the SetupIntent object. The returned object contains a payment_method ID that you can attach to a customer in the next step.
but in step 5 payment intent is used and for confirming payment payment intent id is compulsory, but in step 4 i didnt received any paymentIntent object
Gotcha, you are misunderstanding the whole thing I think.
What it's telling you is that in the future you can charge the Customer by creating a PaymentIntent and passing the PaymentMethod pm_12345 you got from the SetupIntent (on Checkout)