online-store's People
online-store's Issues
SendEmail: Cannot read property 'id' of undefined
After checkout API successfully completes, I can see that the DB triggers call to send email. However this is reporting the following error:
TypeError: Cannot read property 'id' of undefined
at exports.sendEmail.functions.firestore.document.onCreate.event (/user_code/index.js:49:31)
at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:82:36)
at /var/tmp/worker/worker.js:728:24
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
When I look at the firestore database, I see the 'id' has been added, but it's inside the product's structure which is odd, should it not be at the root of the document?
Another error I get is:
TypeError: event.data.data is not a function
at exports.sendEmail.functions.firestore.document.onCreate.event (/user_code/index.js:50:27)
at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:82:36)
at /var/tmp/worker/worker.js:728:24
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
TypeError: Cannot read property 'storageBucket' of undefined
When I try to call the products API, firebase reports the following error in index.js
TypeError: Cannot read property 'storageBucket' of undefined
at app.get (/user_code/index.js:17:30)
at Layer.handle [as handle_request] (/user_code/node_modules/express/lib/router/layer.js:95:5)
at next (/user_code/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/user_code/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/user_code/node_modules/express/lib/router/layer.js:95:5)
at /user_code/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/user_code/node_modules/express/lib/router/index.js:335:12)
at next (/user_code/node_modules/express/lib/router/index.js:275:10)
at cors (/user_code/node_modules/cors/lib/index.js:188:7)
at /user_code/node_modules/cors/lib/index.js:224:17
Looking at the code in app.get('/products', (req, res) => {} I see the following:
const imageBaseUrl =
'https://storage.googleapis.com/' +
functions.config().firebase.storageBucket +
'/resized/';
Any ideas why the storageBucket is not set?
Sample Request for Checkout API
I am trying to call the checkout API.
When it tries to validate the products it reports the following error:
"checkOut error is : TypeError: Cannot read property 'every' of undefined
at Promise.then.result (/user_code/checkout.js:56:31)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)"
My request looks like this:
POST /api/checkout HTTP/1.1
Host: us-central1-XXX.cloudfunctions.net
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
Accept: /
User-Agent: ClientApp/1.0 (com.some.cool.domain.name; build:1; iOS 11.4.0) Alamofire/4.7.2
Accept-Language: en;q=1.0
Content-Length: 304
Accept-Encoding: gzip;q=1.0, compress;q=0.5
amount=11.00&items%5Bdescription%5D=Spicy%20bombay%20mix%20from%20Kenya.&items%5Bname%5D=Kenyan%20Chevdo&items%5Bimages%5D%5B%5D=https%3A//supergrocery.firebaseapp.com/KenyanChevdo.jpg&items%5Bid%5D=1&items%5Bprice%5D=10&items%5Bimage_url%5D=&paymentMethodNonce=tokencc_bc_xw8zq6_8jr4sf_4knqpn_thv4kr_d53
I think its having trouble with the items property I am posting in the request body.
Would you be able to share a sample of what the request for checkout api should look like?
How to get start with Webstore?
Hello,
I would like to know how to setup with the website you have in the src folder?
Currently all the code is uploaded on firebase, however what URL do I put in my browser in order to see the website in action?
Config.json sample?
Hello!!
I am trying to test the Braintree integration.
inits.js requires config.json to exist, but it's not included in the repo. I understand this is private as it's referenced in the .gitignore.
Therefore would you be able to send a sample of what the contents of the config.json should look like?
I've have tried the following, but firebase complains that it can't find the merchant id
{
"merchant_id" : "XXXXXXXXXXXXXXXX",
"public_key" : "YYYYYYYYYYYYYYYY",
"private_key" : "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.