#mangell03_code

1 messages ¡ Page 1 of 1 (latest)

modest streamBOT
ocean perchBOT
#

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.

modest streamBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1237173255144738876

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

brazen jacinth
#

So you've downloaded a demo project for getting started with Terminal. What link did you download that from?

Then you looked at the Quickstart guide for getting started with Terminal, which gives you a different project folder to demo Terminal (likely expected, not all project demos are the same). Neither of them are working for you, but what are you actually trying to do?

hardy torrent
#

That is mostly correct

#

The download button is not allowing a copyable link.

#

First "Download Full App" zip file is not aligned with the document.

#

I juat want to have a demo project that I can plug in my test key and simulated-wpe ID and programtically send a card swipe $ and see it in my test dashboard.

brazen jacinth
#

It's likely that the demo has a slightly different way of setting up Terminal. Can you be specific about what's different?

hardy torrent
#

Just look. Here is the document:

https://docs.stripe.com/terminal/quickstart

And you can download the zip file.

The download is this:

`const express = require("express");
const app = express();
// This is your test secret API key.
const stripe = require("stripe")('sk_test_51O8qkAEPuIFxKCqtwV78O2mjDNip3mlvWq89T2YKSzvllbFiKPbgGlPwk6v2LCfXJKgvyqXVVh61u9WDWppVPnvp00Jza03hN1');

app.use(express.static("public"));
app.use(express.json());

const calculateOrderAmount = (items) => {
// Replace this constant with a calculation of the order's amount
// Calculate the order total on the server to prevent
// people from directly manipulating the amount on the client
return 1400;
};

app.post("/create-payment-intent", async (req, res) => {
const { items } = req.body;

// Create a PaymentIntent with the order amount and currency
const paymentIntent = await stripe.paymentIntents.create({
amount: calculateOrderAmount(items),
currency: "usd",
// In the latest version of the API, specifying the automatic_payment_methods parameter is optional because Stripe enables its functionality by default.
automatic_payment_methods: {
enabled: true,
},
});

res.send({
clientSecret: paymentIntent.client_secret,
});
});

app.listen(4242, () => console.log("Node server listening on port 4242!"));

#

I can't figure out how to piecemeal the doc into a simple workable POC.

brazen jacinth
#

I don't understand. I opened them side-by-side and they're identical. What are you selecting at the top of the page when you view the Quickstart? JS? Node? Swift? Android SDK?

hardy torrent
#

They are very different

brazen jacinth
#

did you get that demo from the link at the top of the page? Or from somewhere else?

I literally did the same thing with the same selections and the demo is identical to the quickstart code snippets

hardy torrent
#

At the top page the page.... the entre reason I am having this chat

#

I will do it again. Delete all my dirs, and my zip

brazen jacinth
#

I wonder if your default API version is affecting what file Stripe is letting you download. What's your Account ID? You can see it by going to the Gear Icon and selecting Profile in the top right corner of the Stripe Dashboard and scrolling down to the bottom of the profile page. It would look like this --> acct_abc123

hardy torrent
#

I cleared erything and sarted over. I had some CLI artifacts I wasn't aware of. I'm still new to how many options you are providing.

#

I am now setting up my test key and first sim

brazen jacinth
#

Are you referring to the Stripe CLI? I'm not sure where that fits in here, as I don't see anything in the Quickstart guide about using the CLI

hardy torrent
#

I had many false starts. thanks for your patience. I now have a clean worjspace with a responsive simulator.

#

Why is there a create location in server.js. That where I got confused.... a server would never create a location in the US.

#

I already have a location and a sim reader.

brazen jacinth
#

I think that's just this integration demo trying to be helpful by showing all the steps needed from start to finish. If you already created a location for your reader, then you would obviously skip that step and just make an API call to retrieve the location (as needed): https://docs.stripe.com/api/terminal/locations/retrieve, or hardcode the reader's Location ID in your code (as needed)

hardy torrent
#

The dashboard docs and the dev docs are very diffcult to align. I will try to get to my next step and remove the "crud". I just want a simple server.js that can accept a card from the sim and post to dashboard and see the transaction.

brazen jacinth
#

Gotcha. Yeah, I think the best thing to do would be to get a clean integration that does everything the way the guide says to. Once you have that, then you can ad-lib a bit and try breaking things

hardy torrent
#

Can you provide any basic framework code that remuse the junk? Simple- elegant.

brazen jacinth
#

Not really. The demo already kind of does that for you. Stripe sort of expects that you(as the developer) will know the basics about how to remove any extra stuff you've created or configured and start fresh when you need to. The demo is useful in getting a developer up to speed, but they will ultimately need to know how best to integrate the system

ocean perchBOT