#phant

1 messages ยท Page 1 of 1 (latest)

glacial acornBOT
#

Hello! We'll be with you shortly. 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.

  • phant, 2 hours ago, 31 messages
  • phant, 14 hours ago, 44 messages
  • phant, 5 days ago, 26 messages
  • phant, 5 days ago, 105 messages
  • phant, 5 days ago, 35 messages
  • phant, 6 days ago, 96 messages
    and 2 more
knotty vigil
#

Hello! Payment Methods represent someones payment info, like a credit card. Payment Intents represent someone's specific intent to pay. The Payment Method associated with a Payment Intent is the payment info they use to pay.

hollow olive
#

so what are the options that can i fill in it?

knotty vigil
#

Not sure I understand your question. Can you tell me more about what you're trying to do and what's stopping you?

hollow olive
#

what do i fill out in this

#

idk which is payment_method_id that is desired

knotty vigil
#

You would provide an existing Payment Method ID there. They start with pm_.

hollow olive
#

where do i create these?

knotty vigil
hollow olive
#

sorry not able to follow this documentation

#

how can i create these id's from dashboard?

knotty vigil
#

That's not how it works.

#

Let's back up.

#

What are you trying to build?

hollow olive
#

oh like this one pm_1OjO2BCqhyxGoBc4MJwEFnc0

#

this was created when a subsction payment happened

#

so can use right away this?

#

like i want to charge before a user cancels his subsription

knotty vigil
#

Yes, you can use that one.

hollow olive
#

with payment method id i cannot create a payment intent?

knotty vigil
#

I don't understand what you mean. In order to help I need you to provide a lot more detail.

hollow olive
#

like i want to charge user before a user cancels his subsription

knotty vigil
#

Okay. What's stopping you from doing that?

hollow olive
#

payment method id

knotty vigil
#

How is that stopping you?

hollow olive
#

why cant user select that on the payment page

knotty vigil
#

What payment page?

#

One you built?

#

Or one of Stripe's?

hollow olive
#

strips checkout page basically

#

this is how payment method id is stopping me

knotty vigil
#

But it sounds like you're not using Stripe Checkout?

hollow olive
#

but what if there are none of saved payment methods?

knotty vigil
#

Then you need to collect a new one using something like Stripe Elements.

hollow olive
#

so with strip element i got client_secret key

#

what after that?

#

there?

knotty vigil
#

What guide are you following?

#

Or what doc?

hollow olive
knotty vigil
#

Okay, so what specific step there are you having an issue with?

hollow olive
#

this step is done

#

generated client_secret

#

now what?

knotty vigil
#

Okay, so take the client secret from that Payment Intent, pass it client-side, then confirm the payment with it.

hollow olive
#

pass it client side?

knotty vigil
#

The client secret is designed to be sent to the client for use client-side. Typically the client in a situation like this is a web browser, where your frontend JavaScript code is.

glacial acornBOT
hollow olive
#

pass it how thats my question

#

in some url?

knotty vigil
#

Client secrets are sensitive and we don't generally recommend you put them in a URL. Typically your JavaScript would make a fetch request to your server which would trigger the creation of the Payment Intent and the response would have the client secret in it.

hollow olive
#

dude i get these if i send to client side

#

and do what with these in frontend?

wintry gorge
#

๐Ÿ‘‹ taking over here as Rubeus needs to step away soon

hollow olive
#

alright

wintry gorge
hollow olive
#

yes i tried please its been an hour and couldnt get a resolution on these simple steps

#

wrote this and getting client_secret key

#

passing the whole thing to frontend

#

what now?

wintry gorge
#

so that's step 2 in the guide...
I'd recommend implementing step 3

#

where you use the client-secret to collect payment details with Stripe Elements

hollow olive
#

where is that step

hollow olive
#

but why cant i get a url right away

#

just like in subscription

wintry gorge
#

That code is for Stripe hosted Checkout page which is a different flow.

The code you've shared in the beginning is for custom flow which utilizes our APIs and Elements.

What exactly is your usecase? What are you trying to integrate?

hollow olive
#

i just want to go to stripe one time payment page to get money from user

#

thats all

#

go to strip customer page

#

get money

#

one time payment

wintry gorge
hollow olive
#

okay so webhook event wont be triggered when mode is payment?

wintry gorge
#

It should be triggered

hollow olive
#

it wont trigger invoice.paid?

wintry gorge
hollow olive
#

which is better to use

#

invoice.paid event or invoice.payment_succeeded

wintry gorge
#

for what purpose exactly?

hollow olive
#

to be sure that the payment has been successful, for one time or subscription

wintry gorge
#

Either of them work. Ideally, guides suggest to rely on invoice.paid since that event is generated when invoice status gets updated

hollow olive
#

oh got it thanks

wintry gorge
#

NP! ๐Ÿ™‚ Happy to help

hollow olive
#

how will i know in the triggered event if its a subscription or a one time payment

wintry gorge
#

For invoice.paid event?

hollow olive
#

yes

wintry gorge
hollow olive
#

or else it would be an id right?

wintry gorge
#

yes

hollow olive
#

payment_intent.payment_failed

#

in this event we dont have subscription

#

how will i know in the triggered event if its a subscription or a one time payment