#Oblox Alert-checkout-shipping
1 messages ยท Page 1 of 1 (latest)
Hey there! Seems like you're using an older version of Checkout? None of this looks overly familiar
Well, generally we'd advise against using that as it's no longer supported and relies on an older version of Stripe.js
will it be very long to change
Having said that, there's an example here of how you can request shipping/billing info: http://jsfiddle.net/rnfueoz8/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
I believe so, it's hard to tell from your code. How are you importing Stripe.js?
store.js ?
I instead recommend upgrading to the new Checkout: https://stripe.com/docs/payments/checkout/migration
I've no idea what that is. How does it include Stripe.js from our CDN?
<script src="https://checkout.stripe.com/checkout.js" defer> </script>
yup, that's old Checkout. This example here is what you need: http://jsfiddle.net/rnfueoz8/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
But again, I instead recommend you upgrade and use the new Checkout
Or Payment Links if you're looking for a no-code solution: https://stripe.com/docs/payments/payment-links
no payment links is for scrubs
i need add to cart
is thjere a way to add shipping option to this old version?
Did you look at the JS Fiddle URL I shared?
yes
Then that should answer your question:
data-billing-address="true"
data-shipping-address="true
where do i add this though
<link rel="stylesheet" href="styles.css" />
<script src="https://checkout.stripe.com/checkout.js" defer></script>
<script>
var stripePublicKey = '<%= stripePublicKey %>'
</script>
<script src="store.js" defer></script>
to this ?
It's all there at the link (you pass those parameters to the <script> tag that includes Stripe.js)
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
data-image="/img/documentation/checkout/marketplace.png"
data-name="Stripe.com"
data-description="2 widgets"
data-billing-address="true"
data-shipping-address="true" defer> </script>
<script>
var stripePublicKey = '<%= stripePublicKey %>'
</script>
<script src="store.js" defer></script>
is this ok
but without class="stripe-button"
Have you tried it?
does not work
Is there an error?
no error but shipping box does not display
As I said, this is now a old, deprecated version of Checkout so we don't really offer support for it
okay is there a way to update without changing too much code?
You need to uncheck the box that says addresses are the same
there is no shipping form
this is my store.js file with checkout javascript in it
How can i update this
Not really, no. There'll be some changes required. Updating the Stripe.js import for starters
Then you can look to import client-only Checkout. Whilst limited, it'll serve a function for your use case: https://stripe.com/docs/payments/checkout/client#enable-checkout
There's likely any guides out on the internet for how to migrate! Including our own: https://stripe.com/docs/payments/checkout/migration
What is the stripe.js import is that in my node_modules
i did npm install stripe
yes i looked through the checkout migration but i do not understand it
is there a cart option for payment links?
There is not, no
You'll need to use redirectToCheckout: https://stripe.com/docs/js/checkout/redirect_to_checkout
I am lost as to why i cannot simply use the old stripe
surely there was an option to demand shipping address
this is a 2018 version not stone age
Because it's old, unmaintained and no longer supported. It doesn't support new payment regulations (such as SCA), so you're likely to see a significant share of failed payments if you're operating in Europe
There is, and I shared an example of how you can do it!
okay that is unfavourable
yes i did add <script src="https://checkout.stripe.com/checkout.js"
data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
data-image="/img/documentation/checkout/marketplace.png"
data-name="Stripe.com"
data-description="2 widgets"
data-billing-address="true"
data-shipping-address="true" defer></script>
and it did not do anything
Then I'm not sure unfortunately. As stated we no longer support that version of Checkout and encourage users to migrate
Is there a way to integrate stripe so that it checks out the balance of the cart ?
I use javascript to get a carts end value
The way to do it is you pass shippingAddress:true to StripeCheckout.configure() , like adding it at https://gist.github.com/eoinmcnulty425/d74c57a98bf4dc2784cd1b3793a8d2cd#file-gistfile1-txt-L32 (it's not a data-param) But 100% you should not be spending any time and development resources on this.
IF you need to touch your payment integration, you may as well take the resources to upgrade to new Checkout instead.
Yes i would rather update if i will get payment failed
i cannot have any payments failing
i am from Europe
cool, then you've seen all the migration guides for how to use the current version of Checkout so you know what to do.
can you point out what needs to be changed specifically the guide is unclear
can you see my store.js file ?
it's not a simple "change this one line, tweak that change" so we can't help you that way, no.
But it is possible to keep my javascript cart functions ?
It's an entirely different overalls design and paradigm. I'd suggest looking through the various docs and sample projects and experimenting
probably!
Damn what a headache just when i thought i was finnished
will payments definately fail using this old system?
can I ask why you used Legacy Checkout in the first place? what guide did you follow?
sorry for the stupid questions i am just a noob
I followed a guide on youtube for creating a shopping cart with javascript
there are no stripe guides for shopping cart that i found
where users add to shopping cart
yep. Try it for yourself if you have your payment page, use a test card from https://stripe.com/docs/testing#regulatory-cards and observe that it fails
Are there any guides for processing stripe payments based on the price that is given by my javascript
will a guide from 4 months ago be okay?
what's the guide?
JavaScript Simplified Course: https://javascriptsimplified.com
Accepting payments is one of the most important parts of any application, but getting started with accepting payments can be very daunting. In this video I will show you how to easily get started accepting payments with Stripe.
๐ Materials/References:
GitHub Code: https://github....
really sorry for consistent n00b questions
nothing I'm too aware of, but once you have something running it should be fairly clear how you'd pass the amounts to it.
Or you could use a third-party platform that builds all this e-commerce system for you and uses your Stripe account.
no way would i provide third parties with fees and funds
salty enough that stripe takes fees
is this guide okay?
JavaScript Simplified Course: https://javascriptsimplified.com
Accepting payments is one of the most important parts of any application, but getting started with accepting payments can be very daunting. In this video I will show you how to easily get started accepting payments with Stripe.
๐ Materials/References:
GitHub Code: https://github....
fair, but you're getting value from them since it's development you don't have to do/pay for yourself.
I can do it, it's only a matter of time
anyway I can't really endorse a specific third party but I looked at that video and it seems good and it uses the current version of Checkout so seems nice to me!
Thanks I will follow that guide hopefully successfull this time
Now i am struggling with getting stripe to checkout the items that are added to the cart
glad you made progress! What's the specific problem?
Any suggestions on how i can get the stripe checkout to connect with whats in my javascript cart
I will send a gist one sec
Send the details of the cart to the server, parse them, and then send the equivalent information to the line_items when creating the CheckoutSession object(https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items) with some custom code.
To answer:
How do i get my shopping cart to checkout through stripe
The most straightforward way would be, on the frontend, read the contents of your cart and then send them on the POST request being made to that 'create-checkout-session' URL. On the backend you can read them from req.body. Then you can write some code to convert the information from that cart into the structure Stripe's API needs for line_items
can't that be exploited though?
yes, it's possible for the user to edit the Javascript in the browser or the request being sent to influence what they're being charged for. I assumed you were aware of that since you are using a client-only cart system so you assessed that risk.
Usually the way you avoid that is you have a cart that involves cookies and a backend so for example you store the actual details of the order in a database/on the server, and you would use the authentication from the cookie to look up the details of the current customer's order and pass that to an API like Stripe's.
ah ok. Then I suppose however you get the details of the cart, you can write some code to convert the information from that cart into the structure Stripe's API needs for line_items.
not sure how much I can help you since I don't know your cart system, it's something you have to do as the developer of this site.
i sent my cart system in that gist
it uses ejs
is there a way to edit the stripe code to get it to charge the price
is there tutorials in developer docs
about carts ?
shopping carts and checkouts?
not really no, we don't focus on carts as that's a more bespoke thing that is different for every site and is part of the wider e-commerce platform, Stripe only really focusses on the payment components today.
well there is no "Stripe code", it's code you write. You have a cart system, and you have Stripe's API. You'd have to write some business logic to glue things together, as a developer.
i mean the code that processes the checkout
that doesn't change my answer.