Parse server payments not working - stripe-payments

I have an app that used to be on Parse.com and now is migrated to the open source parse server running on elastic beanstalk. The app uses Stripe for payments and everything worked fine before, but after migrating to parse server, the payments are now failing. Does anyone know of something they changed or anyone had a similar problem?
Thanks

I am pretty sure that the module delivered with Parse hosted no longer works on Parse-server. I am sure that Stripe has a node module which you could install and use instead.

Instead of using Cloud Code, create a route in your index.js file to take care of charges. Make a post route and you can call it via jquery post or from a form. I use body-parser in index.js to retreive the post data.

Related

simple react app with fetch from Bigcommerce API

I'm relatively new to react and wanted to create an app that uses the Bigcommerce API to change product data submitted by the user through a form. My idea is to have a simple form for the user to input a quantity, for example. Once the user submits the quantity the want to change, the new number will be reflected on the product page on Bigcommerce Admin pages.
I have already created the same kind of app with Node with no front end. The app I made reads a csv file and calls the proper APIs to update their quantities. I wanted to create sort of the same app but in React with no csv reading abilities. I am having trouble with CORS errors now for some reason. I tried creating a backend with Node for this React app but I still get the same error.
I tried some other API. one that does not require authentication and that worked fine. I was able to see results when I do the console.log(data).
It seems that this Bigcommerce API won't work because it requires authentication, which I already have made on their backend several times to double check my work. I'm confused and not convinced that there is no way for a react app to fetch data from a remote server with credentials.
I figured it out, but I'm still convinced that I can do this with only a front end application in React. Without Node, However.
What I did was create an endpoint with Express using Node as the backend. Installed cors modules, then allowed requests coming from the front end URL address. Also, pay attention to whether you are using localhost:PORT# or 127.0.0.1:PORT#
to the browser these are different. Make sure they're the same when you open up the browser.

How can I use react with a custom webserver?

I want to use React for a project I am working on, but I also want to use an API.
How can I do it?
I have tried to Google this and ask different people, but I have not got a response yet, so I thought I would ask here. I want to use express and maybe not use create-react-app (as it takes up a lot of storage).
Working on a custom server doesen't preclude the use of an API.
If you want fetch the API from the express server and inject it directly on react frontend you need to enable server side rendering (useful post) and pass the data collected as a props from the server (check this example).
Rather then you can build your react project (using even create-react-app) and build an express server who return the index.html on call.
Personally I prefer the first one solution.

nodemailer to send mail from portfolio site

I have successfully created a Node.js server with Express and also installed nodemailer to send the data from the 'Contact Me' form from my front-end React app. I have uploaded this on Heroku.
I have a question though - since this endpoint is set up on this public domain, in theory, someone could inspect my source code, find the URL, and build a script out to make a ton of POST requests with random data to blow up my inbox.
Is there anything that can be done to stop this sort of behavior? Where would I even start to research into this?
I think Captcha could help you.
CORS is what you're looking for. I recommend reading up a lot more on it since it will pay off greatly for your web development journey! https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
The short answer is that you must set a Access-Control-Allow-Origin: <yoursite>.com header in CORS policy for your Node.js app (install it from npm), which will turn down any requests made by a 3rd party actor who inspects the form destination address.

How to connect angular2 server side with php

I recently bought a new template for my site written in angular2, i did a short course on it and started to work and everything fine.
Now come the the part where i try to connect it to my DataBase and i cant figure it out...
after a little bit of reading i saw that i need to use nodejs in order to speak with the server side, is that true?
can i use php or i must use the nodejs api to work with my Db?
am i missing the concept of the angular2 or something? can someone post a basic script of angular working with php example , i just cant find it.. :(
thanks a lot :)
The most common scenario is that you use the Http service in Angular that makes XHR (Ajax) requests to the server to fetch data (not HTML).
You can use any server that is able to receive, process and response to XHR requests. Therefore PHP is as suiteable as node.js (or .NET, Java, or any other web server)
See also https://angular.io/docs/ts/latest/guide/server-communication.html

Using Twilio with Meteor to respond to SMS

I have recently started learning how to use node.js and Meteor. I am trying to create a small app that I can query via a client built in meteor, but also query that same MongoDB via SMS using the Twilio API. I can see that this can be done with Express: How can I respond to incoming Twilio calls and SMS messages using node.js? but I wanted to use Meteor because of its apparent ease-of-use and integration with a database. I've been reading various questions about routing templates and serving static html pages in Meteor, but is there a solid way someone think I can make this work? Should I just go back to plain Express?
Twilio expects you to give them the URL where the XML response will be hosted: http://www.twilio.com/docs/quickstart/php/sms/hello-monkey
My earlier response is outdated. Today one should use iron:router and create a server-side route.

Resources