#jay492-subscription-integration
1 messages · Page 1 of 1 (latest)
What do you mean it's not working on a server? Have you collaborated with your developer team who handles deploying code on your servers?
There is only me and my uni friend. I want to make the payment working on our website and embeded the payment features and it works when i use localhost but when i try to do on servers, when i click do payment in checkout.html, it doesn't go to anywhere.
Ah gotcha. I can't really advise on that, as the steps for pushing your code to a server will vary based on the server you're using
is it okay i send the code to you directly ? would you be able to take a look? it just checkout.html and server.js
No, that won't help since you're able to get your Stripe integration working in your local environment. That means the issue is not specific to Stripe so looking at the Stripe integration code is unrelated
when i try to do on servers
this is what you should focus on, and how your codepaths in production are being interpreted by your server
sorry what is this?
also, what do you have to do when you change it from test mode to live mode? I changed publish api key and secret key from test and change the domain to my webserver page.
also, what do you have to do when you change it from test mode to live mode?
changing your publishable and secret keys from test mode to live mode makes sense, as well as updating any URLs to point to the production pages (vs. using some local versions)
We also have some recommendations here: https://stripe.com/docs/development/checklist
This is still very vague to me: "when i try to do on servers". How did you push your live code to your website before?
oh so i made a local server with node.js and used localhost:3005(for example) and tried the payment links(checkout.hrml, successful.html, etc) work fine or not. And it worked fine and now i want to implement this on the website that my friend and myself made so that we actually can add payment feature on the website.
endPointSecret for webhook for the live mode that i should use is the one that you can get from the developer→webhook→signing signature, am i right?
That's right, as long as the webhook you're looking at was created in live mode
where are the files for your production website located?
now i want to implement this on the website that my friend and myself made
is this website still in development, too?
not fully finished but it's on the server so if you search the domains, you can visit them
this is the part that deals with create-checkout in checkout.html. I hid the DOMAIN but if i replace with my website's domain, it hsould work right?
not fully finished but it's on the server
What server? I don't think this is the best channel for these questions since they're not really about developing with Stripe, it's more a question about web development more generally.
I recommend starting here if you're not sure how to proceed: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/deployment
thank you i will check on it. I will come back when i have stripe issues
Am, sorry where do you use publishable key specifically? because you use secret key in server.js. I don't know where to use it.
Your publishable key is likely in client.js
do i have to parse it? if so how i parse it?
// In production, this should check CSRF, and not pass the session ID.
// The customer ID for the portal should be pulled from the
// authenticated user on the server.
document.addEventListener('DOMContentLoaded', async () => {
let searchParams = new URLSearchParams(window.location.search);
if (searchParams.has('session_id')) {
const session_id = searchParams.get('session_id');
document.getElementById('session-id').setAttribute('value', session_id);
}
this is from the stripe website
Which document from the Stripe website are you referencing?
This guide is specifically for using Stripe's hosted payment product, Stripe Checkout. A publishable key isn't necessary here since you're doing a full redirect to our hosted payment page.
what do you mean by that?
The alternative to this is using the Payment Element, which means you'd embed a payment form within a page that you own/host
i thought i was doing that...?
You can see the differences here. Checkout is fully hosted by Stripe and redirects your customer to a page we own: https://stripe.com/docs/payments/checkout
This guide uses Checkout: https://stripe.com/docs/billing/quickstart
Line 32 in server.js does a full redirect to the Checkout Session URL
um so i was doing checkout?
The guide you linked uses Checkout, yes
which is better using checkout or not checkout ?
There isn't really a "better" option as it totally depends on what you want the customer experience to be, if you want to maintain a page with a PaymentElement, how much developer resources you have
just myself so less management is using checkout?
That's right, integrating with Checkout requires less code
jay492-subscription-integration
what's the embedding one called?
https://stripe.com/docs/payments/elements I recommend referring to this
but the embedded one is called PaymentElement
oh sorry roadrunner already mentioned before ..
um would be able to help me understand how the create-checkout-session works? How stripe is directing users to checkout page? Is there a way i specify the checkout page when i do it on server?
so if i click checkout button, i want to direct user to stripe checkout page but currently it is returning 404 not found
there's no create-checkout-session. That's not really a thing unless you're solely talking about our demo example which is just a demo and should never be put in production
Are you an experienced developer who wrote the whole code end to end? Or is it more that you downloaded the basic example and deployed it to production?
yes that is purely an example for a developer to play with, it's absolutely not real code you should put in production on your real website/app
what do you mean by this?
you should put in production on your real website/app
if this isn't the right thing to follow, is there any materials that i can follow to put subscription function into my website?
This is a basic sample app, like an hello world. It's for a developer to play with to understand how it works after they rebuild this entirely for their own code/website. There's no error handling, no security/protection, it's just a demo
it seems you cloned it and are now pushing it to your server which is unsafe
I mean you are in the right place, but it's still aimed at developers experienced with their own code/app/website. If you're starting from scratch you'll have to learn that part first or hire a professional to help you set all of this up
yes that's what you likely should do in this case
is it possible to users to access to customer portal with non-coding version? I want users to change the card-info or update/ delete it like the non-coding version.
We have a no code customer portal option too yes
Also, do you know how long does it take for does experienced people to set the non-coding payment feature on webisite?
sweet, that means users can chagne it anytime, right? and i can place that page to where i want on the website?
yes
sweeet, also, do you know how long does it take for experienced people to set the non-coding payment feature on webisite?
I can't tell you I'm sorry, everyone is different
how about the approximate estimate? Like a week or a month...
I'm really sorry, I can't tell you. Some people build all of this in a few hours, others wil will take them a few weeks. It depends so much on your own needs, your existing systems, what you really want to handle, etc.
fair enough
Does stripe provide any resources for building full non-coding feature?
no we do not. We offer a lot of products and solutions even for no-code like PaymentLinks and the CustomerPortal but it's still something you need to set up based on your needs
so you provides bits and peices not the full example and we have to customise by ourselves and put them togather?
Yes
i see thank you i will try the non-coding one, i will shout out if i need help again
I'd recommend working directly with our support team if you have follow up questions about that part and they can guide you better!
aren't you the one of them? or is there any other places that i can get help from?