#mink4501_api

1 messages · Page 1 of 1 (latest)

high pebbleBOT
#

👋 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/1305742264861196369

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

summer orchid
lyric kayak
#

@summer orchid

#

Hi. I have a few questions and I'm going to ask them itemized to make sure I get a clear answer.

Q1. I want to register my card information from a user, issue a token, and store it in the server's DB so that the user can continue to pay via token in the future, but the server should not receive the card information directly. What should I do?

Q2. I receive a webhook when the payment is completed, can I receive the token from there?

Q3. I want to trigger a payment at a random time on the server using the token stored in the DB. Which API should I use to process the payment?

Q4. I need to notify the user to register a new card when the user's card information has expired or there is a problem with the card. How should I do this?

Q5. If you have any additional documentation that I can refer to, I would appreciate it.

summer orchid
#

Q1. I want to register my card information from a user, issue a token, and store it in the server's DB so that the user can continue to pay via token in the future, but the server should not receive the card information directly. What should I do?

The guide goes through how to do this in detail. I really recommend reading through the guide first.

Q2. I receive a webhook when the payment is completed, can I receive the token from there?

In Stripe, this "token" is typically know as a PaymentMethod. You can see the PaymentMethod id in the webhook when the payment is completed.

Q3. I want to trigger a payment at a random time on the server using the token stored in the DB. Which API should I use to process the payment?

How you determine the random time is up to you. The steps to do so is covered in this section : https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=stripe-hosted#charge-saved-payment-method

Q4. I need to notify the user to register a new card when the user's card information has expired or there is a problem with the card. How should I do this?

Stripe provides a Card Account Updater service so in most cases, you don't need to notify the user to register a new card. If the card is declined though, you can send an email to the customer to come back on-session (on your site) to provide new card details (as per your step 1).

Q5. If you have any additional documentation that I can refer to, I would appreciate it.

If you have other questions, I can point you to the relevant documentation. The first guide that I shared is what you would want to start off with though.

Here’s what businesses need to know about card account updaters (CAUs), from how they work to the benefits and challenges of using them.

Learn how to save payment details and charge your customers later.

high pebbleBOT
lyric kayak
#

Thank you for your response. I will take a look at the documents you forwarded to me first !

lyric kayak
#

@summer orchid
hello. I have reviewed the document you forwarded to me and have some additional questions.

When using the Checkout Session API, setting the mode to setup seems to be a way to save the card information and process the payment later.

Q6. How can I create a payment window with mode as payment via Checkout Session API to perform payment and extract paymentMethodId from it when checkout.session.completed webhook comes?

I want to save the card information at the same time as the payment and process the payment with the paymentMethodId next time.

drifting wolf
#

I’m taking over this thread

#

If I understand you correctly, you want to save a payment method during payment?

lyric kayak
#

exactly

#

yes

drifting wolf