Store service tester(Staging server accountchooser.BIZ is used. Switch to accountchooser.COM)

See tester for Select, or Update service.

Please input the account to be stored:
 
Email:  
Display name:  
Photo URL:  
Provider ID:  
 
Email:  
Display name:  
Photo URL:  
Provider ID:  
 

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.

See client library doc for API details. Or learn more from Account Chooser Working Group.
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);
};