#pdipietro-checkout-sample

1 messages · Page 1 of 1 (latest)

oak igloo
#

hello, let's talk here

#

reading

tawdry sky
#

Well, I was trying to run the checkout sample from the stripe site.

With no success at all.

As I'm new of this environment (Stripe && discord) can you tell me the best way to contact the stripe support to solve these kind of troubles?

ivory forge
#

Hi. Taking over for hmunoz here. Give me a moment to catch up

#

Are you starting the react server and node server separately at localhost:3000 and localhost:4242 respectively?

tawdry sky
#

Exactly, but manually because the npm start returned an error

#
> stripe-sample@0.1.0 start
> concurrently "yarn start-client" "yarn start-server"

sh: 1: concurrently: not found
#

So I added npm i concurrently because it's a missing dependency in the package.json.

But then, running npm start it returns

neo4j@neo4j:/experiment/stripe-sample-code$ npm start

> stripe-sample@0.1.0 start
> concurrently "yarn start-client" "yarn start-server"

[0] /bin/sh: 1: yarn: not found
[1] /bin/sh: 1: yarn: not found
[1] yarn start-server exited with code 127
[0] yarn start-client exited with code 127

The error now is obvious, but can Stripe propose a demo with missing dependencies and missing prerequisites? It's not serious.

#

I don't use yarn but npm .... and replacing yarn with npm returns an error ....

ivory forge
#

Can you link the guide you're following?

#

I can propose this feedback internally

tawdry sky
#

I changed the package.json file with

"start": "concurrently \"react-scripts start\" \"node server.js\""

It started but, when pressing the checkout button on the webpage it returned (I cut the long message!)

[0] You can now view stripe-sample in the browser.
[0] 
[0]   Local:            http://localhost:3000/checkout
[0]   On Your Network:  http://192.168.178.22:3000/checkout
[0] 
[0] Note that the development build is not optimized.
[0] To create a production build, use npm run build.
[0] 
[1] /experiment/stripe-sample-code/node_modules/stripe/lib/Error.js:40
[1]         return new StripeInvalidRequestError(rawStripeError);
[1]                ^
[1] 
[1] StripeInvalidRequestError: No such price: '{{PRICE_ID}}'
[1]     at Function.generate (/experiment/stripe-sample-code/node_modules/stripe/lib/Error.js:40:16)
[1]     at res.toJSON.then.StripeAPIError.message (/experiment/stripe-sample-code/node_modules/stripe/lib/StripeResource.js:220:35)
[1]     at processTicksAndRejections (node:internal/process/task_queues:96:5) {
[1]   type: 'StripeInvalidRequestError',
[1]   raw: {
[1]     code: 'resource_missing',
[1]     doc_url: 'https://stripe.com/docs/error-codes/resource-missing',
[1]     message: "No such price: '{{PRICE_ID}}'",
[1]     param: 'line_items[0][price]',
[1]     type: 'invalid_request_error',
[1]     headers: {
[1]       server: 'nginx',
[1]       date: 'Thu, 17 Feb 2022 19:04:22 GMT',
[1]       'content-type': 'application/json',
[1]       'content-length': '245',
[1]       connection: 'keep-alive',
[1]       'access-control-allow-credentials': 'true',
[1]       'access-control-allow-methods': 'GET, POST, HEAD, OPTIONS, DELETE',
[1]       'access-control-allow-origin': '*',
[1]       'access-control-expose-headers': 'Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required',
ivory forge
#

That's just because you have to replace the placeholder price id for one you create in your account

tawdry sky
#

Well, I need to study about the prices. Thank you for your support.

#

See you tomorrow...

ivory forge
#

No problem! I will take your feedback to the team about the yarn issue and the concurrently issue

tawdry sky
#

Can I ask you some clarification on the general architecture?

I have a marketplace site written in React-js.
I want to integrate Contact and Express.

So I have a frontend application runnign on a server or serverless. I have also an application server running node.

Do I need to install a payment server which runs Stripe or I just need to link with the Stripe server?

ivory forge
#

Not sure I follow exactly. But to communicate with the stripe API, all you will need is a back-end server to make API calls with your secret key