PayPal in-context bolt-on opens blank popup - asp.net

Having integrated PayPal Express for one of our clients (in ASPX WebForms) and received some under-documented integration steps (https://developer.paypal.com/docs/classic/express-checkout/in-context/integration/) for bolting on the so-called in-context integration, we're facing the following issues:
1) The document asks for the Merchant ID, which, for a sandbox can't be found, wondering if it's the same as the Username in the API credentials
2) I've set up an aspx page for the express checkout to do the posts and gets, which only requires the order id (this would be /checkout_paypal_nvp.aspx?oid={OrderID} below). Judging by the example code PP provided, we're guessing this is what needs to be passed in, but on clicking the 'Check out with PayPal' button, there's only an about:blank popup appearing, and the page doesn't get executed.
Also wondering if 2) is caused by using the wrong Merchant ID in 1), hence the double question (sorry).
Screenshot for ease of visualisation:
Relevant code:
<a id="lnkPaypalCheckout" href="/checkout_paypal_nvp.aspx?oid=81774"></a>
<script>
window.paypalCheckoutReady = function () {
paypal.checkout.setup('{API_username_here}', {
container: 'lnkPaypalCheckout',
locale: 'en_GB',
environment: 'sandbox'
});
};
</script>
<script src="//www.paypalobjects.com/api/checkout.js" async></script>
Many thanks in advance.

Answers to your issues:
The merchant ID (you can found under My Account > Profile > My business info > Merchant account ID) can be used for both production and sandbox environments.
Please make sure "/checkout_paypal_nvp.aspx?oid=81774” returns with the correct PayPal flow url. If you comment out the two script sections which for in-context setup, you should see the PayPal flow being loaded in the full page. That will be your first step before adding in-context setup.

Related

Unsubscribe Reason Not Working in Mailchimp when using MailChimp.Net Library

I am using mailchimp.net library (https://github.com/brandonseydel/MailChimp.Net) to use mailchimp api. And everything is working fine except that the unsubscribe reason does not work when i update the member.
for example:
Under certain event i am using following code to unsubscribe:
existingMember.Status = Status.Unsubscribed;
existingMember.UnsubscribeReason = "Contact Unsubscribed from contact page" ;
//***Notice the Unsubscribe Reason here, i have different pages which has different unsubscribe reason***
await _mailChimpManager.Members.AddOrUpdateAsync(listUserSubscribed, existingMember)
.ConfigureAwait(false);
Now, Next i created webhook in mailchimp as explained here (https://mailchimp.com/developer/marketing/guides/sync-audience-data-webhooks/#create-a-new-webhook). However the unsubscribe reason is always "manual" and it doesnt shows the note that i entered earlier (i.e. Contact Unsubscribed from contact page) .
Is there anything i am missing? or is there any other way to achieve the same?
Thanks in advance !!!

How to distribute apps when SELECT button does nothing - Android Management API

I am building a console and have successfully rendered my iframe:
gapi.load('gapi.iframes', function() {
var options = {
'url': 'https://play.google.com/work/embedded/search?token=' + data + '&mode=SELECT',
'where': document.getElementById('container'),
'attributes': { style: 'width: 950px; height:500px', scrolling: 'yes'}
}
However, when I select an app using the provided SELECT button, it only returns the expected payload. I assumed that the iframe would do the heavy lifting here but now know that I need to build the logic. Can someone point me in the rightt direction here for approving the app via SELECT button? Is there a set of iframe events that I should be writing this with in mind? I'm completely lost since documentation here https://developers.google.com/android/management/apps#select-button_1
is extremely vague. Has anyone had issues with this before?
Thanks!
The documentation for the select button indicates that “You need to specify the action that takes place when the IT admin clicks this button”. It is up to the EMM to decide what to do next. You could prompt the user to approve the app on play.google.com/work
For example, you need to approve dropbox. You need to login with your enterprise account then go to this link https://play.google.com/work/apps/details?id=com.dropbox.android and then approve the app.
Or you could prompt the user to add the application to a policy, which automatically approves the app for use by the user’s enterprise.
You may refer to this link for more information about handling iframe events.

Cross domain tracking on right click

Is there a way to pass GA cookies for cross domain tracking when user uses right click (instead of a left click) to hop domains?
It would seem that reliance is on autoLink, which decorates links automatically on left click and does not directly provide for alternative events.
Since I'm working on assumptions I'm not providing complete solutions.
Per autoLink in GA's analytics.js devguide:
// Loads the Linker plugin
ga('require', 'linker');
// Instructs the Linker plugin to automatically add linker parameters
// to all links and forms pointing to the domain "destination.com".
ga('linker:autoLink', ['destination.com'], false, true);
This will also operate on oncontextmenu so if the visitor right-clicks and selects "Open in new tab", the link is still decorated and will have the data appended.
Where decoration is required on other events, autoLinking needs to be extended by manually adding linker parameters using:
ga('linker:decorate', destinationLink);
Such a function call decorates a link based on the domains listed in the 'linker:autoLink` array above. It can be adapted to apply to all cross-domain links.
Assuming the context menu needs to be disabled:
From Andy E's answer
destinationLink.oncontextmenu = function ()
{
ga('linker:decorate', destinationLink);
console.log(destinationLink.href);
document.location = destinationLink.href;
return false;
}
That will decorate the link on right click and direct the browser to the decorated URL.
If the context menu is already disabled, abbreviating Andy E's code:
destinationLink.addEventListener('mousedown', function (e) {
console.log('mousedown', e);
if (3 == e.which) { // is it a right click
ga('linker:decorate', destinationLink)
document.location = destinationLink.href;
}
})
Note that decoration must occur as soon as possible before the visitor clicks since the parameters expire after 2 minutes.
Analytics Ninja, adapt your code to your specific requirements and if you run into further issues, please follow Philip Walton's advice

Where to get a google branded disonnect button?

I setup my website to use google+signin.
For the login google provides a more or less nice, translated button to log in.
The code
<span id="signinButton">
<span
class="g-signin"
data-callback="signinCallback"
data-clientid="CLIENT_ID"
data-cookiepolicy="single_host_origin"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-scope="https://www.googleapis.com/auth/plus.login">
</span>
</span>
is expandet to :
To follow googles developer policies, the app must provide a way to delete the association between your app and the account. (From: google account logout and redirect)
The implemenatation is easy, but as far as I understood does Google not provide a (styled/desigend) disconnect button. Or did I miss it?
It should look similar/like the login button.
To follow the policies, you have to provide a way for your user's to revoke your app's access to their information and account. This is different than logging out.
See how to provide that disconnection and revoking of access
After the user disconnects, then you would perform the clean up steps required by the terms.
Here is an example that uses jQuery from the documentation. It assumes that you stored your access token in the global variable access_token:
<script type="text/javascript">
function disconnectUser(access_token) {
var revokeUrl = 'https://accounts.google.com/o/oauth2/revoke?token=' +
access_token;
// Perform an asynchronous GET request.
$.ajax({
type: 'GET',
url: revokeUrl,
async: false,
contentType: "application/json",
dataType: 'jsonp',
success: function(nullResponse) {
// Do something now that user is disconnected
// Start account clean up
},
error: function(e) {
// Handle the error
// console.log(e);
// You could point users to manually disconnect if unsuccessful
// https://plus.google.com/apps
}
});
}
// Could trigger the disconnect on a button click
$('#revokeButton').click(disconnectUser);
</script>
<button id="revokeButton">Disconnect</button>
Edit:
If you'd like resources to assist with customizing the look of a disconnect button to match up with the look of the sign-in button, you can use the resources that are provided on the Google+ Platform branding guidelines page. On that page, you can download PhotoShop source files that you can use to create a disconnect button for your site. You will need to follow the instructions on that page to comply with the branding guidelines.
How sites choose to offer a disconnect option is up to the designer. One site might prefer a disconnect link and another to use a button, the design is up to you.
FYI even though their rules do say you must provide a way for a user to revoke access, it doesn't force you to make it easy for the user to do so. Most sites tend to tuck away the ability to disconnect in a user settings menu somewhere, keeping it as a text link. You really don't want users to disconnect and leave forever that easily.
If you're still bent on having the button though, have a look here for a CSS solution
https://developers.google.com/+/web/signin/#customizing_the_sign-in_button
Customize as necessary. Good luck!

Notify a facebook user if a comment is made using the <fb:Comments> comment box

I have an application on facebook and i have the facebook comment box on it. If someone makes a comment using the comment box, is there a way to notify person that a post has been made on their app
I have the following code
<script src="https://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:comments xid="test" canpost="true" candelete="false" href="<%= link %>" num_posts="10" width="500" send_notification_uid="<%= fbUserId %>" notify="true" publish_feed="true"></fb:comments>
The href - link is a dynamic link depending on where the post was made. The send_notification_uid - user_Id is also dynamic and it retrieves the user id of the person that owns the page.
Any help would be great. It all works apart from the send notification
I believe using the javascript SDK you can subscribe to the comment.create event. Then provided you have the necessary permissions for the uid in question, you could then send them a notification I believe. I haven't tested this but you need to look at the FB.event.subscribe code
https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
There's some more information on a post here
http://facebook.stackoverflow.com/questions/6146925/fb-event-subscribecomment-create-doesnt-work
Further to this you can test things out on the js skd tool
https://developers.facebook.com/tools/console/
and some sample code
<h1>Defaults</h1>
<fb:comments href="http://www.fbrell.com/"></fb:comments>
<script>
FB.Event.subscribe('comments.add', function(resp) {
console.log('Comment was added' + resp);
});
</script>
I don't know if the specs changed, but the current answer doesn't work anymore, the new way is now this :
FB.Event.subscribe('comment.create', function() {
console.log('Comment was added');
console.log(arguments);
});
comment.create , as explained here : https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.0#comments-example

Resources