#manish_checkout-savedcard

1 messages ¡ Page 1 of 1 (latest)

midnight scarabBOT
vapid hollowBOT
#

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.

midnight scarabBOT
#

👋 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.

worldly charm
#
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 });
  });
midnight scarabBOT
uncut otter
#

@worldly charm Can you clarify what you mean "charge the payment after"?

worldly charm
#

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

#

step 5 is a bit confusing

uncut otter
#

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?

worldly charm
#

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

uncut otter
#

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

worldly charm
#

i mean they can use the same payment method multiple times

#

what would you suggest?

uncut otter
#

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

worldly charm
#

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

uncut otter
#

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

worldly charm
#

So for what time span does the payment details remain ?

uncut otter
#

manish_checkout-savedcard

worldly charm
#

PCI Compliance SAQ A will work with the above approach you mentioned?

uncut otter
#

yes, PCI is completely unrelated.

worldly charm
#

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

worldly charm
uncut otter
#

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

worldly charm
#

Suppose a user adds paypal on setup

#

ah man this is getting complex
sorry to bother

uncut otter
#

You need to clarify your question for me to help you

worldly charm
#

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

uncut otter
#

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)

worldly charm
#

ahh i see

#

so i have to create a payment intent as well

#

Thanks @uncut otter ,
You have been really helpful
Glad to connect with you