Paypal, angular 2 and expressjs server - node.js

I am new to web development and have put together a decent Angular 2 MEAN web-app that I would like to launch relatively soon. Unfortunately PayPals documentation is such a gigantic Kafkaesque clusterf maze swamp mire that I am lost in and have no clue what I'm doing, I have 30 browser tabs open including code examples and their node sdk/REST. I've tried a few of the different options on offer which involved pasting their scripts to try get a button but nothing happened. Does anyone have a simple guide I can follow and a simple recommendation for integrating paypal payments into MEAN stack? I just need to be able to set payment amounts based on data that is contained in objects I have access to in my front-end, so a simple front-end solution would be nice where user can pay with paypal account or credit card and where I can plug the variable {{event.price}} straight into paypals api and send it off, and verify it somehow.
Thanks

Related

How to access Google Classroom without API?

I'd like to automatize some processes that are not yet available through API(Google Classroom), like posting comments on announcements, seeing private comments on my work and so on. I have trouble accessing my account. I'd like the app to be able to run on a server. I'm currently working with node.js, but if there is an easier approach I'll gladly accept it (free if it's possible). Can you give me an example of how it's done because currently, I am struggling to find every button that needs to be clicked on?
Unfortunately, there are no methods right now to accomplish that. You can leave a feature request on Google Issue Tracker describing what methods you would like to use. Google engineers will study your case and, if applicable, they will develop the requested methods.
You could use something like Selenium with your language of choice (Javascript in this case) to automate the browser clicks.
This is however, not the best of ideas... To make Selenium log into your account you will need to hardcode your password somewhere.
Google services use Oauth for authentication, take a look at the Classroom API Getting-started for instructions on how to work with Google Classroom API.

How to create a charge with Stripe for a Wordpress website?

I have managed to create a Checkout Button for my Wordpress Site (using Divi) to accepts my customer's payment details and directly passes them to Stripe's servers.
Now, I need to create charges using Stripe’s API and my server-side code to process charges.
I am quite lost here having never done this before. Could someone tell me by step by step how to proceed?
Welcome to stackoverflow!
Maybe you could consider using a plugin for wordpress like: https://nb.wordpress.org/plugins/stripe/
You dont seem that familiar with PHP so i highly recomend using a plugin instead.
EDIT:
If you prefer to make this yourself take a look at stripe docs here: https://stripe.com/docs/quickstart and maybe consider looking at this tutorial https://www.youtube.com/watch?v=EildM6OMcoQ (This guy is awesome)

SendGrid-nodejs or Nodemailer?

There are at least two ways to send email from Nodejs using SendGrid:
Sendgrid provides a Nodejs library called "SendGrid-nodejs." They're actively supporting Sendgrid-Nodejs (last update 29 days ago).
Nodemailer supports sendgrid and seems to be extremely popular. SendGrid posted an article about using this combination: Sending email with Nodemailer and Sendgrid.
Edit 2
SendGrid have ended support for nodemailer-sendgrid-transport as of today.
So, if you're starting on a project now, I would suggest going with sendgrid-nodejs.
Original question:
Edit to make the question less opinion-based:
What are the pros and cons to each approach? I have googled for days and not seen any comparison of the two. There is another StackOverflow question asking for differentiation between the two (among several other things) which has gone unanswered. So surely the answer to this will help others.
My specific usage, in case it helps focus the answers:
I want to allow users of an iPhone app to invite others to use the app. They'll see the default invitation text in the app, and can customize it. The customized text is sent to my Nodejs server and added to a job queue. As the queue is processed, emails are sent. I want the emails to look nice, so I want to use HTML email templates (and a plaintext alternate body).
Scale-wise, this will start out very small but if the app is succssful could scale up rapidly.
You'll find that you can achieve what you want to do using either library (nodemailer-sendgrid-transport was written by SendGrid too!) but given you suggest that you want to use HTML templates and plain text alternatives, you might want to take a look at using the SendGrid Node JS library because it'll give you easier access to some more advanced features, such as:
Template Engine - Which allows you to manage both HTML and plain text templates inside the SG dashboard rather than in your code - this could be handy for making quick changes, without the need to redeploy your app to production.
Advanced Suppression Management - Which allows you to group emails that users can then unsubscribe from, rather than completely unsubscribing from everything, ever.
It's worth noting that you could still use both these features with NodeMailer and nodemailer-sendgrid-transport, but the SendGrid NodeJS library directly exposes methods for these features.
Like I said, you can achieve what you want with either but I thought it was worth pointing out a few SendGrid specific things.
Well, sendgrid-nodejs is a more popular repository.
However, Nodemailer is the most popular module for sending emails with NodeJS. I've been using it for months and I'm very satisfied.
If you're worried about the future of your app you should consider that Nodemailer is used not just with Sendgrid, but with a lot of other competitors. So if you have a problem with Sendgrid, you could easily switch to another email delivery service without having to learn a different API.
So I suggest you to use nodemailer-sendgrid-transport, and if you find bugs, fix them with a PR :P

How to hide meteor server-side code from browser?

As a newbie to meteor, I found lacking security is one of the first impressions people usually have due to meteor's historic debut and that meteor has taken measurements to address the concern. Therefore I pay more attention to this subject as I am learning it. When following the to-do list tutorial, I noticed, to my surprise, the if (Meteor.isServer) {} block is visible in browser. The tutorial dedicated 2 steps out of 12 to move client-side code to server-side to make it secure. But if server-side code is also visible in browser, isn't that defeated the whole purpose? How could meteor be a secure platform in that regard?
The tutorial is using this simple technique to start things quickly, but hopefully there is a built-in way to prevent server code being sent to the browser.
Every code that you put in the server directory won't be shipped to the client.
Likewise, source code living under the client directory only lives in the browser environment.
This is detailed in the docs section relative to "Structuring your app" :
http://docs.meteor.com/#/full/structuringyourapp

Google chat badge not working anymore?

I was using google talk chat badge (chatback - small iframe code that enables remote user to chat with you as anonymous) for some years but now it is not working anymore. The generated code is fine as it seems it opens a new window and all but after a second, it redirects to support.google.com page which of course is not of much use.
I rechecked the code, generated new code, didn't help. Again redirects to support.google.com. The code is generated from http://www.google.com/talk/service/badge/New
Anyone knows what's going on? Have they discontinued it or?
Also, a suggestion - is there any alternative web-presence button like that for other messengers which don't require client on other end. For Skype, Windows Live or some other messenger?
According to KatherineG at Google the chat badge is no longer supported. http://productforums.google.com/forum/#!topic/chat/_VpluJc6IfU
We are looking into using Crafty Syntax for a replacement.
http://www.craftysyntax.com/
Yup, been a while now - it was great while it lasted. The personal workaround that I am using is to sign up for a live chat service and hook it up with Gtalk. I am currently using ClickDesk - http://www.clickdesk.com/
Visitors chat using the live chat interface and I use the Gtalk interface.
For a while I used MeeboMe in combination with MeeboMe notifier but then it died as well (company was purchased by Google and the product was killed) I found some good alternatives myself so I am sharing them. Ironically, they are recommended by MeeboMe after they discontinued their service. Both are free.
Zoho Live Support - https://chat.zoho.com/
Yahoo! Pingbox - http://messenger.yahoo.com/pingbox/ (requires Yahoo! account but otherwise is great)
Too bad large companies simply kill useful products. But as far as I am concerned, Yahoo! Pinbox is even better than both Google chat badge and MeeboMe (at least for my needs) and can be customized to great extent.
I recommend ClickDesk - http://www.clickdesk.com too if you like to use Google Talk or Skype.
However, if you want to code - you can use xmpp protocol and hook it up with Pidgin notifications. Google Appengine also has notifications which I believe is what ClickDesk uses.

Resources