#svetidamir
1 messages ยท Page 1 of 1 (latest)
hi! was there a specific part you're struggling with? which type of Stripe integration are you building/have built?
Well I was writing a long message but I found it confusing, so I will try to explain it simple.
I have created a way to accept payments with the Token, and when a user enters his card details I create a token and create a cusomer and the a subscription based on that token.
Now with 3Ds as I understand I have to know the payment method and then create some Intent(I don't get this part) and then if the payment intent is success I get his ID as a token and use that token to subscribe the user to an item in Stripe.
well unfortunately Tokens are completely deprecated for a few years so you must have been using an old guide, so ultimately I think you'd need to throw out that code
what I would suggest is to follow this guide : https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout
it creates Subscriptions, and handles 3D Secure for you, and is really straightforward to implement
oh, didn't know that. Was using code from our "Senior Developer", he told me that it is working perfectyl xD.
Thx for the help, I will write here if I get stuck, but as far as I see it is not that hard ๐
So I was going trough the integration that you send me and where do I get the user Credit Card info and create a customer for the subscription?
Hi! I'm taking over this thread.
sure no problem,
so in the integration that karllekko send me the form is
<form action="/create-checkout-session" method="POST">
<!-- Note: If using PHP set the action to /create-checkout-session.php -->
<input type="hidden" name="priceId" value="price_G0FvDp6vZvdwRZ" />
<button type="submit">Checkout</button>
</form>
You create a Checkout Session, and send the Checkout Session URL to your user. There they will enter their card information and the Subscription will be created when they submit the form.
oooh, so I create a checkout session and redirect my user to my url where I ask for the credit card info and then accept the payment?
okay, so my checkout is in few steps.
First the user picks the product and picks the quantity, then the user creates an account and confirm his email. Now there is a screen where I say I confirmed his email, after that the payment window should show.
So basically I will create an checkout session when user press the I understand button on Email confirmed screen, and then it will take him to the checkout session.
Or
Should I create a checkout session in the beginning of the entire checkout(where he can chose the quantity and the product)
To be honest I'm asking what is a better practice in my case
You can only create the Checkout Session after you know which product the user will buy. Other than that, it's completely up to know.
Just know that by default Checkout Sesseion expire after 24 hours: https://stripe.com/docs/api/checkout/sessions/create?lang=node#create_checkout_session-expires_at
oh okay, I understand now. If I get confused along the implementation I will write in this chat ๐