#Oblox Alert-checkout-shipping

1 messages ยท Page 1 of 1 (latest)

tulip sundial
atomic palm
#

Hi

#

thank you for helping

#

I am not sure where I add the shipping address demand

tulip sundial
#

Hey there! Seems like you're using an older version of Checkout? None of this looks overly familiar

atomic palm
#

possibly

#

never the less will it work?

tulip sundial
#

Well, generally we'd advise against using that as it's no longer supported and relies on an older version of Stripe.js

atomic palm
#

will it be very long to change

tulip sundial
atomic palm
#

with the version of stripe i am using>

#

?

tulip sundial
#

I believe so, it's hard to tell from your code. How are you importing Stripe.js?

atomic palm
#

store.js ?

tulip sundial
atomic palm
#

the file is called store.js

#

it is complicated i do not understand much javascript

tulip sundial
#

I've no idea what that is. How does it include Stripe.js from our CDN?

atomic palm
tulip sundial
#

But again, I instead recommend you upgrade and use the new Checkout

atomic palm
#

i do not know how to upgrade

#

to new checkout

tulip sundial
atomic palm
#

no payment links is for scrubs

#

i need add to cart

#

is thjere a way to add shipping option to this old version?

tulip sundial
#

Did you look at the JS Fiddle URL I shared?

atomic palm
#

yes

tulip sundial
#

Then that should answer your question:

data-billing-address="true"
data-shipping-address="true
atomic palm
#

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 ?

tulip sundial
#

It's all there at the link (you pass those parameters to the <script> tag that includes Stripe.js)

atomic palm
#

<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"

tulip sundial
#

Have you tried it?

atomic palm
#

does not work

tulip sundial
#

Is there an error?

atomic palm
#

no error but shipping box does not display

tulip sundial
#

As I said, this is now a old, deprecated version of Checkout so we don't really offer support for it

atomic palm
#

okay is there a way to update without changing too much code?

tulip sundial
atomic palm
#

there is no shipping form

#

this is my store.js file with checkout javascript in it

#

How can i update this

tulip sundial
atomic palm
#

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?

tulip sundial
atomic palm
#

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

tulip sundial
tulip sundial
atomic palm
#

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

tulip sundial
#

Then I'm not sure unfortunately. As stated we no longer support that version of Checkout and encourage users to migrate

atomic palm
#

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

primal storm
atomic palm
#

Yes i would rather update if i will get payment failed

#

i cannot have any payments failing

#

i am from Europe

primal storm
#

cool, then you've seen all the migration guides for how to use the current version of Checkout so you know what to do.

atomic palm
#

can you point out what needs to be changed specifically the guide is unclear

#

can you see my store.js file ?

primal storm
#

it's not a simple "change this one line, tweak that change" so we can't help you that way, no.

atomic palm
#

But it is possible to keep my javascript cart functions ?

primal storm
#

It's an entirely different overalls design and paradigm. I'd suggest looking through the various docs and sample projects and experimenting

atomic palm
#

Damn what a headache just when i thought i was finnished

#

will payments definately fail using this old system?

primal storm
#

can I ask why you used Legacy Checkout in the first place? what guide did you follow?

atomic palm
#

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

primal storm
atomic palm
#

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?

primal storm
atomic palm
#

really sorry for consistent n00b questions

primal storm
atomic palm
#

no way would i provide third parties with fees and funds

#

salty enough that stripe takes fees

#

is this guide okay?

primal storm
#

fair, but you're getting value from them since it's development you don't have to do/pay for yourself.

atomic palm
#

I can do it, it's only a matter of time

primal storm
#

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!

atomic palm
#

Thanks I will follow that guide hopefully successfull this time

atomic palm
#

Now i am struggling with getting stripe to checkout the items that are added to the cart

primal storm
#

glad you made progress! What's the specific problem?

atomic palm
#

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

primal storm
atomic palm
#

This is confusing I am a complete javascript noob

primal storm
#

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

atomic palm
#

can't that be exploited though?

primal storm
#

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.

atomic palm
#

i am using client and server

#

client and server cart

primal storm
#

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.

atomic palm
#

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?

primal storm
#

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.

primal storm
atomic palm
#

i mean the code that processes the checkout

primal storm
#

that doesn't change my answer.

atomic palm
#

would a guide from 2020 march be up to date?

#

or would stripe be outdated

#

Last question ๐Ÿ˜›