#koks_api

1 messages ยท Page 1 of 1 (latest)

cursive zealotBOT
#

๐Ÿ‘‹ 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/1391796162062848162

๐Ÿ“ 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.

frozen temple
deep mica
#

ok let me check

#

Here is the code i tried but it is not helping

frozen temple
#

did you refer to the doc I shared above and compare with your code? ๐Ÿ™‚

The first issue is you're using mode: 'payment'
The second is you're either creating a SetupIntent or PaymentIntent (?)

#

You need to use mode: 'subscription' and then create a Subscription when trying to confirm with the collected payment method details

deep mica
#

ah ok, subscription is for recurring...my bad

#

i want to auto charge the card (google pay) like pay as you go. Like I want to collect the payment details and later charge the customer.

frozen temple
#

When you say "auto charge" and "later charge the customer", what do you mean exactly? The only way to charge a payment method automatically is through Subscriptions.

Are you trying to save the payment method and charge it later by making an API call?

deep mica
#

Are you trying to save the payment method and charge it later by making an API call? Yes

frozen temple
deep mica
#

I did similar to what you mentioned above

#

but it is not working

frozen temple
#

What's not working though? Are you seeing any errors or something?

#

also what did you change in your code after looking at the docs I shared?

For example, for SetupIntents - you need to use mode: 'setup'

deep mica
frozen temple
#

The log suggests you're trying to access id param from an object, where the object does not exist is undefined?

Can you double check your code to make sure you're accessing the right param?

deep mica
#

let me check

#

seti_1RiH0rPJyrrClAxygeEBROSQ

frozen temple
#

Looking at your code:

     payment_method: event.paymentMethod.id
}) ```

This does not make sense at all.

Please take some time to read through this doc - https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=setup

Step 6 in the guide above is what you need
deep mica
#

updated the code

#

let me try

#

at what point, Payment Method Id get generated?

frozen temple
#

After the SetupIntent is confirmed