Facebook app - Paypal transaction within facebook? - iframe

Is it possible and if so how to do an IPN transaction within a facebook application?
I found you can not launch an IPN transaction within an iframe. I will be using facebook's iframe option for my application, so I need to figure out a way for the users to pay.
I guess it would be possible to launch a pop up with the transaction in there... but then there is the risk of pop up blockers etc.
How do developers normally receive payment?

If you are looking to do simple micropayments (such as for virtual currency in a facebook app game) you may want to consider a 3rd party API such as SocialGold (http://www.jambool.com/)
SocialGold supports an iframe option by using a signature passing method and handles a wide variety of payment types, including PayPal.
If you want to avoid the risk of a popup blocker, consider instead using the iframe within an inline dialog within your application. There are many dialog handlers, but I recommend one that relies on JQuery myself:
http://jqueryui.com/demos/dialog/

Related

Tracking iframe origin

I am creating a Web Widget, a page that customers can use within an HTML Iframe in order to embed our experience on 3rd parties and vendors.
The site will be public, I am not willing to ask consumers to register in order to have a key or a unique identity to be passed as a query param for example (e.g. ?id=<unique_id>).
On the other hand, I need to track who is using the iframe. What are my options? A colleague suggested using the request headers, such as the origin, to track the usage on the server-side. Is that a good strategy? I'm not sure how much I can trust the origin header.
What if I fire an event (hence a client to server call), at page load (such as analytics) which logs the current page URL? Would that work, from within an iframe?
I am pretty sure I am reinventing the wheel here. What would be some good recommendations?
Thanks!
For others ideating for a similar solution, my fix was actually to simply hook a proper client analytics to the page, and trigger a page load event, upon page load, which would push not just the page, but quite a few other properties to our analytics.
Also, we added a clientId query param to our urls, so that we could identify precisely who was serving the iframe visited by the user.

Disable analytics for iframe

The website uses embed Youtube videos, Slide Shares, Open Table Widgets that become iframes. According to the new law about GDPR we need to ask user's consent for tracking his activity. But how then I can use these components and at the same time disable analytics that comes automatically from these iframes?
It's very difficult to reconcile any kind of tracking with GDPR. If the frame you're loading does not provide privacy controls of its own, you would need to acquire the relevant consent before loading the iframe at all, which you can do via Javascript loaded from your own site.
As a workaround, you could proxy the services and strip tracking cookies and scripts before they ever reach the end user. I've done this before.
The privacy-friendly approach is to not use services that track users in the first place, and then you have nothing to worry about. Sadly this is easier said than done, since the vast majority of such services' entire business model relies on tracking people.

Google Forms PayPal Express Integration

I am doing work for a non profit with 0 budget for IT. They need to allow users to enter information on a Google Form and then collect payment. I have done a lot of research on the topic and currently appears you can only add a hyperlink on the Google Forms to link to PayPal. However, I was wondering if there was some way to link the PayPal Express Checkout javascript(https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/add-paypal-button/) into the Google Form so it calls back with a transaction id and status. Then I would be able to somehow insert those values into the Google Form. Any thoughts on how to integrate would be helpful. I am a developer but not familiar with Google Forms.
I recently wrestled with this exact question and ended up building a G Suite addon to make this easier for others. Coincidentally I also do volunteer IT for a small nonprofit and we wanted to use PayPal with our signup form (there's pricing for the addon but just ping me if you're a small nonprofit).
Here's what I learned while building it:
There's no way for Apps Script to modify the form once it's shown to the user, or to use Apps Script to respond to user input
There's no way to redirect the user automatically to PayPal after a form is submitted
That means if you want to send someone to PayPal, you've got to use an ordinary link. You can do this within the form by adding the URL to a question description, or you can add the URL to the text shown once someone has submitted the form. For PayPal, you've got two options for this kind of link:
PayPal buttons
Express checkout
PayPal buttons are a static link managed by PayPal. They don't require any coding - just go here and create a button. Then you need to get the raw text link for the button, which PayPal calls the "email" version. You can insert that into your form directly and tell users to access it. The one problem is there's no real way to get the transaction ID. You could try correlating the form submit time with the payment time, or the payer email with the form submit email. It's possible that neither of them will match up and you'll have to do it manually.
Express checkout requires you to dynamically create a new link for each payment by calling the PayPal API. That means your link needs to open a page that then generates an express checkout URL and redirects the user to it. You can do this using a web app in Google Apps Script using a doGet() trigger, or you can create your backend on your server in any language.
If you can run your own server somewhere, I recommend that (plenty of PaaS services have a free tier). It's much easier to test and debug things when you aren't using Apps Script. I used the PayPal Node SDK which works great despite being unmaintained. (Express checkout is "deprecated" by PayPal, but I'll bet it's not going away anytime soon). Their example will get you most of the way there. When the user arrives, generate a payment link and redirect them. When they finish they'll return to your server, and you can display whatever you want. For example, you can ask them to copy the transaction ID and paste it into your form.
Finally, when your form is submitted an onSubmit() trigger can be set up. There are actually two kinds of onSubmit() triggers for forms - one for the form itself, and a second for the spreadsheet linked to the form. You can register a trigger to do extra processing (e.g. look up the transaction ID), but you can't modify the response in the trigger. You can however modify the spreadsheet where the trigger gets sent, which for most cases is equivalent. For example, you could add a column to the spreadsheet with a link to the PayPal transaction based on the transaction code.

detect email view counter using ASP.NET

I'm creating a newsletter dynamically in my ASP.NET web app. I've made an ASP.NET page which is sent my users via email, I need to know how many times this email is viewed, what are my options? I have another page which acts as an archive for my newsletters, so I should find a way that each time my email is viewed, "numview" column in my newsletter table is increased by one, is it possible? are there any ready made tools or I should make one using code? it is easy to make one but my page is going to be viewed as an EMAIL, so I think I cannot write SQL commands, how can I solve this problem?
It will not be very easy to add tracking to normal email. but if you are loading some external webpage(of yours), inside the email (via an iframe or as an images source or so), you may try any of the following.
You can try incorporating some analytics code inside your page. So everytime when someone visits the page,the visits will be tracked. You will get a clear picture from the dashboard of the analytics provider. There are lot of providers but i think google analytics is the winner. It is free as well.
If you want to implement your own, you can have a one table which stores the pageid/url, users' IP Address, date, browser etc.. and add a record to this table on the page load event of your page.
I've made an ASP.NET page which is sent my users via email
I had a little trouble understanding this. If it's an ASP.NET page, then how can you send it to users?
Forgetting about ASP.NET for a minute, you can just send an HTML email. One trick is to have the email reference an image on your server. You could then write ASP.NET code to intercept that server request and count the number of times that happens.
However, this is not reliable because most email readers will not display images unless the user indicates images should be loaded for an email because spammers have used this technique too many times.
So, to the extend I understand the question, I do not believe there is a reliable way to accomplish this.

Google Chat in ASP.NET application

I want to provide chat facility to my website visitors. This should be same as google chat (person to person communication). Are there any free tools available to integrate in the website? Or is there any way that we can use Google Chat's API and can integrate in our website?
Pls help me.
You can embed google chat into your web page, instructions here
I think a reasonable approach would involve opening an iframe that talks to a dynamic page. The dynamic page would be auto-refreshed by two or more clients and continously post to/read from a table that stores the ID of the session, timestamp, user name(or IP), and message for the chats. The ID of the session would correspond to the dynamic page ID and bob's your uncle.
I'm sure there are various implementations floating around, but I'd want to control this on my own. No user accounts required if you set it up correctly, thought finding other users may be an issue without accounts.
There are a lot of good embeddable chat widgets you can insert into a page fairly easily that do all the work for you.
I've tried out a few of the ones listed in the link above (mostly MeeboMe and Geesee) and don't have any major complaints. With that many choices you should be able to find one that meets your needs. Most don't even require a login.

Resources