Stripe works in localhost but gives error in live - javascript

I'm currently developing a stripe checkout for my website, it's working in localhost but gives me this error : JSON.parse: unexpected character at line 1 column 1 of the JSON data. In localhost I get this error if I name in a JSON payment intent field that does not exist, I've already set the live website in HTTPS channel

Stripe has a support article that explains how to debug and fix this error.

Related

Getting error while Deploying mBeam Microservices to mCM Container

I am working on the the Smart-car-use-case provided in the mimik website. When i try to follow the steps '[B5-1] ,[B6-1], [B7-1] ', which will deploy the microservices to the mCM container,
I am getting the following error in postman.
[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid number; expected digit after '-'; last read: '--'
Please make sure that the deployment of all microservices are successful. You can verify deployment by running GET http://{{YOUR_IP_ADDRESS}}:{{PORT}}/mcm/v1/images (or [B4-1] in Postman collection) and looking at the response. Your response should contain the names of all the required microservices (miot-v1, msuperdrive-v1 and mbeam-v1). If the microservices are missing; you will need to deploy them again.
NOTE:
edgeengine must be running at all times in order to complete everything correctly

Uncaught syntax error in github deployment

I made a simple website that recommends restaurants based on your city using Zomato API. It works perfectly locally, but when I deployed on a GitHub page it gives me the following
POST https://devangmukherjee.github.io/locations/delhincr 405
(anonymous) # index.js:15
index.js:15 - const res = await fetch(${hostname}/locations/${query}, {
and
index.js:24 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
index.js:24 is });
The repo is here - https://github.com/devangmukherjee/random-zomato-restaurant
It is a very small repo only three files.
The website link is here - https://devangmukherjee.github.io/random-zomato-restaurant/
The same code works perfectly locally. What can I do?
When you visit the website locally, you are running your Express backend on localhost too. But, when you visit it on GitHub, your backend isn't executing on GitHub's machines. So, when I write "Mumbai" in the search field, in the line const res = await fetch(`${hostname}/locations/${query}`, { you are actually fetching https://devangmukherjee.github.io/locations/mumbai. Since that GitHub's URL doesn't allow POST HTTP method (because your backend isn't executing there), you are getting a 405 HTTP error. Thus the first error. This response's body is HTML and not JSON. When you do res.json() on line 23 there is a parsing error when it finds the angle bracket of the first HTML tag. And that's the reason for your second error.
To make it work you have to deploy your backend somewhere else, e.g., Vercel or Netlify serverless functions or Heroku (among many other possibilities). And then, update your hostname variable on line 4 accordingly.

Linkedin Authentication using a WebView on Android occasionally fails

For some of our users, Linkedin authentication using a WebView doesn't work.
Linkedin WebView is displayed within an activity
The user types in the credentials
The Linkedin login screen just get refreshed
Some hints:
Not sure if it's related, but in my attempt to understand what is going on, I logged a Error and a Warning message using setWebChromeClient and got these:
Error: Cannot read property 'channel' of undefined -- From line 233 of https://www.linkedin.com/scds/common/u/lib/espany/1.0.0/espany.js
Warning: webkitURL' is deprecated. Please use 'URL' instead. -- From line 31 of https://static.licdn.com/scds/concat/common/js?h=25kaepc6rgo1820ap1rglmzr4-edgsl2z4e4gk56cy2m5kbpp1q-dtx8oyvln9y03x1ku6t0abhc9-cl5mre9823ndhfdrl4nozaofi-6isi7fr80gagap7736arbauct-8ohb0iio22nbqe1w8et54sawe-13kfns70b5ghzzqxzr194d2jo-cr2cf88zdeizqhuobqtot8sge-amjylk8w8039f2lwlov2e4nmc-47qp7uw3i5i1pqeovirlcc070-5pmigtkow46izwzcb8m1b57ly-br7xw7z07pbsy9z5545ze80zu-aikuay313zihm7be1fml6lb8y-7vr4nuab43rzvy2pgq7yvvxjk-9qa4rfxekcw3lt2c06h7p0kmf

chrome.identity.getAuthToken returning "bad client id: {0}" error

I'm trying to use chrome.identity.getAuthToken to get a token, but every time I try this error shows up:
OAuth2 request failed: Service responded with error: 'bad client id: {0}'
I have no idea why this is happening. The client ID I put in manifest.json is exactly the same as the one on the Google Developers Console, and the correct scopes is also included:
oauth2: {
"client_id": "NUMBERS-NUMBERS&LETTERS.apps.googleusercontent.com",
"scopes": ["https://www.googleapis.com/auth/SOME_SERVICE"]
}
The extension is up on the webstore, and I don't see why it is still giving the bad client ID error.
What is possibly causing this error? What am I missing here?
Just as a note for myself and for someone run into.
I have encounter this problems with chrome app , the answers is not my problem ,and finally I found the solution for my problem but produce the same error as the question.
As https://developer.chrome.com/apps/app_identity#client_id say is much special for chrome apps, you have to create a separate client id for your chrome app.
Go to the "API Access" navigation menu item and click on the Create an OAuth 2.0 client ID... blue button.
Enter the requested branding information, select the Installed application type.
you must to choose Installed application an set you Application ID.
what's your Application ID ?
chrome-extension://your application id
chrome-extension://gfmehiepojbflifceoplblionpfclfhf/
I overcomed this problem by setting up the email address and product name in "Consent screen" in the Google Developer Console.
Please refer to https://developers.google.com/console/help/new/#userconsent for detail.
I had a similar problem. Everything seemed to work fine on my own laptop, but when i ran it on another device i got that "bad client id" error.
My problem was that the client-id changed from one device to another, as i did not yet upload my extension to the chrome store.
To overcome that problem, i followed the instructions of How to change chrome packaged app id Or Why do we need key field in the manifest.json?.
You need to create a key to keep the client-id persistent through all devices.
Hope that helps finding the right answer for people with the same issue quicker.

Error with Deezer Javascript API: Valid token required?

My Deezer-app used to work fine with the Javascript API, but stopped working recently.
I get the following error:
{"error": "VALID_TOKEN_REQUIRED":true},"results":{}}
I can't find any information about this error and I have no idea how to debug it.
The url is www.rapucationals.com
Update: Please check out the code (www.rapucationals.com).
This is the call that fails: http://www.deezer.com/ajax/gw-light.php?api_version=1.0&api_token=a7cadc94893e55c9fd79da702354c86b&method=song.getListData&input=3&cid=0053621bf26d2cf98

Categories