Store service tester(Staging server accountchooser.BIZ is used. Switch to accountchooser.COM)
See tester for Select, or Update service.
Note: To use staging server accountchooser.BIZ, include js file from https://www.accountchooser.biz/client.js, instead of https://www.accountchooser.com/client.js
Below is the code used in the demo.
function done(result, error) {
client.closePopupWindow();
if (result) {
alert('receive result: ' + JSON.stringify(result));
} else {
alert('receive error: ' + JSON.stringify(error));
}
}
var client = window.accountchooser.CdsClient.init({
popupMode: false,
popupWidth: 640,
popupHeight: 480,
clientCallbackUrl: window.location.protocol + '//ac-test.appspot.com/storeBiz.htm',
callbacks: {
store: done
}});
var store = function() {
client.changePopupModeTo(jQuery('#popupMode').attr('checked'));
var accounts = [{
email: jQuery('#email').val(),
displayName: jQuery('#displayName').val(),
photoUrl: jQuery('#photoUrl').val(),
providerId: jQuery('#providerId').val()
}];
if (jQuery('#multipleAccounts').attr('checked')) {
accounts.push({
email: jQuery('#email1').val(),
displayName: jQuery('#displayName1').val(),
photoUrl: jQuery('#photoUrl1').val(),
providerId: jQuery('#providerId1').val()
});
}
var cdsOptions = {language: jQuery('#language').val()};
client.store(accounts, cdsOptions);
};