Generating a jwt in Google Wallet - google-api

I don't understand how they are generating the jwt in tutorial #1.
Is it a call to a JavaScript function?

Honestly, the library link didn't connect the dots completely for me either. Especially when you're going from Google Checkout, which takes 10 minutes to set up, to Google Wallet that requires JSon/JWT knowledge.
So, I went to the Samples link instead and found all references to "Cake" in the code, per their demo. Link to sample code.
------- Digital goods sample app (PHP) ---------
I am using PHP, so I downloaded iap-php source at the this link. And clicked the Download .zip link. It's not very obvious on the page and the window will show you a message that says, "No files in the selected directory. Select a subdirectory, if one exists, or another directory from the tree on the left." Don't worry; just find that little Download: .zip link in the Source tab.
When I opened the files, I saw seller-info.php to enter my specific issuerID (also called your merchant id) & secret. Replace that red text with your info.
generate-token.php is where you change the red text to information about YOUR product.
index.php is where you change the same product information that appears on the page that the user first sees. When you put this on another page, inside of your live website, be sure to include all of the scripts.

The Tutorial says that it's generating the JWT server side and has a link to server libraries (in multiple languages) that can do the generation for you.

Related

How to add a link of a local file on Google Spreadsheet?

I want to add a link of a local file to a cell on Google Spreadsheet. I tried to use "insert Link" and pasted a full path of the file I want like C:\Users\xxxxx\Desktop\xxxxxx\xxxx.cpp.
However, it says,
Link doesn't look right. Typo?
Is it not possible to add a link of local path?
When I open a local file with a browser, the link starts with
file:///C:/(....)/
because you acces a local file with no network protocol. Maybe you can put the file into the same directory and use relative links.
Sure you know that you won't be able to access that file from the web without further actions relating your internet connection.
In this case, you might need to setup a http-Server;
use Windows' IIS (internet information services);
or just rent a hosting server.
Have fun!
Edit: This might also be useful:
HYPERLINK Creates a hyperlink inside a cell.
Sample Usage HYPERLINK("http://www.google.com/","Google")
Syntax HYPERLINK(url, [link_label])
https://support.google.com/docs/answer/3093313?hl=en

Parsing data: is img link slower then image from own server?

I'm parsing data from other website, and question wether it's better to download images and show them on my own or just links to website images I parsed . Is the link to image by default slower then image from own source?
Couldn't find answer to the simple question. If question is discussable and doesn't belong here, someone comment down please in order to delete it.
Some rules of thumb:
Don't display content on your page which you 'source' from another site without the other sites permission. ('Share this' links provided by youtube are okay, directly linking to the .flv file of someones video from another site to display on yours is not).
Don't copy content from other domains onto your domain without their permission first (doing so would be a copyright violation).
So to answer your question: You should copy the content onto your domain/host, but only if they have given permission to allow this kind of use.
Edit: I am interpreting your question as "I am taking content from another website [and putting it on my own] and I am wondering if I should link directly to their content ( tags pointing to the other domain) or if I should download/copy the content to my website and have my server handle everything?"
The "technical" answer is "it depends on how good your host is compared to the other host when serving content to the average visitor". Compare a page run by Google vs. the same thing run on a home server behind a 56k modem. It matters if you have broadband, but if you're on a 33.3k modem it doesn't.

Where to add Google Remarketing tag in Magento

I am trying to figure out in which file I need to add the Google remarketing tag. I know it needs to be added before the closing of the body tag. Can anyone point me in the right direction?
Thanks
here is I did in the past:
Depending on what kind of google tracking you are using you have a few different way to use:
1) If only add a custom code and should be in all the Magento page, use the "Miscellaneous Scripts" value going to admin section, System > Configuration > Design > HTML Head - Miscellaneous Scripts. (This will be included before head closing tag in page HTML.)
2) By native Magento already have Google Analytics tracking code and you can find this configuration going to admin section System > Configuration > Google API - Google Analytics.
3) If you are looking something more complex and use the Google adWords I used the extension magento connect link. For a particular Client I did some extra modification to include some extra code if a client subscribe to newsletter or a new client etc.
I hope you can find something helpfully in the post.
Best,
GrinGo.
There are different template file for different pages in magento so at first I think you should decide where to place it.For example if you want to place it in footer than you should place that code snippet in
"app/design/frontend/base/default/page/html/footer.phtml"
Similarly you can check other different template files to place your code.
NB:Best practice is to overide the core file of magento before making changes to it.
Hope this will help.
There's no indication as to which Magento version you're using 1 or 2. At the end of the day it depends how much technical knowledge you have and if you're using a version control system to manage your Magento build.
Miscellaneous Scripts as another answer mentioned earlier, this approach is straight forward and very easy to use to plug and play your code.
Google Module depending which version of Magento you use (CE/EE) there will be a built-in section for you to plugin your account ID in backend Magento configuration and then the platform will generate necessary code for you.
Write custom module by writing your own module you can place it the snippet anywhere on the page by targeting before_body_end node in your layout XML file. This is more technical but gives you more control over what you can do.
Google Tag Manager this also depends on if your Magento version comes pre-built with Google Tag Manager module, then you can create a container and place all your logic in there. This is also more technical and require the output of some values in JS format on the frontend to let GTM read the values.
At the end of the day go with what is easy to setup, portable and easy to manage. I usually go with Google Tag Manager as it takes time to create initial setup of exposing data on the frontend but then I have full control of what I want to do with that data through tag manager. In most cases you'll end up using the same data (ex. totals, shipping method, product IDs, SKUs, cost, etc.) in more than one third party API so this gives you flexibility to do just that.

Pdf files are not getting updated after docusign

We are using Embedded signing of DocuSign REST API to e-sign files.To sign a file, we upload the required file to our web app and then display it a viewer in the browser. This file can be signed immediately or later.
What is happening is that when the file is signed and the process is completed, we return to the same file view but the updated file is not reflected. Only when we refresh page like 3-4 times, it shows the sign on the file.
This issue comes only for files that were uploaded and signed later. For a fresh file which is uploaded and signed immediately, we get the updated file view.
It appears that all the browsers cache files (not HTML page, but the embedded files). The recommended solutions suggest to either add a parameter in the request when file is reloaded after signing- but this works only intermittently. The other is to rename the file so that the browser picks the updated file. But renaming file is not an option for us.
Is there some other alternative? Have any other DocuSign API users ever faced something similar? (I believe this issue would not come if you use email request mode for e-signing)
Thanks.
There have been no similar reports from anyone... I am not discounting yours necessarily but when you just write up something about your web app I could think of a few things that your web app could be doing out of sequence to see this behavior.
The first common mistake with embedded signing that comes to mind is this. In general embedded signing requires several steps (1) login call (2) create envelope (3) get the view of the recipients.
Most of the people put that logic in the controller code behind a web page so when they come back it goes through the same sequence. I understand that your page has some logic to maybe guard against it, but ideally on the "viewing" you should only call (3) - getting the view. If you somehow end up calling (2) again - you will see the signing sequence all over.
That's the most common mistake. However I do not want to discount your report. In order to actually get to the bottom of it you should post the web service call traces (XML for SOAP / JSON for REST) and show exactly what your app is doing.
Hope this helps.
-mb // i work for docusign

Logging image downloads

I'm trying to find a way of finding out who is downloading what image from an image gallery. Users can download using a button beside the thumbnail or right click and use the "save link as" Is it possible to relate a user session or ID to a "save link as" action from all browsers using either PHP or JavaScript.
Yes, my preferred way of doing this would be via PHP. You'd have to set up a script which would load up the file and send it to the user browser. This script would also be able to log the download somewhere (e.g. your database).
For example - in very rough pseudo-code:
download.php
$file = $_GET['file'];
updateFileCount($file);
header('Content-Type: image/jpeg');
sendFile($file);
Then, you just have your download link point to download.php instead of the actual file. (Note that updateFileCount and sendFile are functions that you would have to provide, of course - this script is an example of a download script which you could use)
Note: I highly recommend avoiding the use of $_GET['file'] to get the whole filename - malicious users could use it to retrieve sensitive files from your web server. But the safe use of PHP downloads is a topic for another question.
You need a gateway script, like ImageDownload.php?picture=me.jpg, or something like that.
That page whould return the image bytes, as well as logging that the image is downloaded.
Because the images being saved are on their computer locally there would be no way to get that kind of information as they have already retrieved the image from your system. Even with javascript the best I know that you could do is to log each time a user presses the second mousebutton using some kind of ajax'y stuff.
I don't really like the idea, but if you wanted to log everytime someone downloaded an image you could host the images inside a flash or java app that made it a requirement to click a download image button. That way the only way for them to get the image without doing that would be to either capture packets as they came into their side or take a screenshot.
Your server access logs should already have the request for the non-thumbnailed version of the file, so you just need to modify the log format to include the sessionid, which I presume you can map back to a user.
I agree strongly with the suggestion put forward by Phill Sacre. For what you are looking for this is the way to go.
It also has the benefit of being potentially able to keep the tracked files out of the direct web path so that they can't be direct linked to.
I use this method in a client site where the images are paid content so must be restricted access.

Resources