Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
Created October 3, 2012 14:32
Show Gist options
  • Save xcommerce-gists/3827228 to your computer and use it in GitHub Desktop.
Save xcommerce-gists/3827228 to your computer and use it in GitHub Desktop.
Sample template for X.commerce onboarding
<?php
/**
* Magento Enterprise Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition License
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magentocommerce.com/license/enterprise-edition
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* @license http://www.magentocommerce.com/license/enterprise-edition
*/
?>
<h1>Page title as you'd like it to display</h1>
<?php
$url = Mage::helper('xcom_onboarding')->getOnboardingUrl();
?>
<p>Text to display to the user.</p>
/**
* Simple form that requests the user's
* name and e-mail address.
*
*/
<div>
<form>
<table align="left">
<tr>
<td width="100" align="right"><b>Name</b></td>
<td align="left">
<input type="text" id="name"/>
</td>
</tr>
<tr>
<td align="right"><b>Email</b></td>
<td align="left">
<input type="text" id="email"/>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<br/>
<button onclick="customOnboardCall(); return false;">Activate</button>
</td>
</tr>
</table>
</form>
</div>
/**
* JavaScript that calls merchantOnboard
* and passes the dynamic parameters to
* the X.commerce onboarding cloud service.
*/
<script type="text/javascript">
function customOnboardCall() {
var name = document.getElementById('name').value;
var email = document.getElementById('email').value;
var body = {
'extension' : 'Namespace_Simplemoduleexample',
'bundle' : 'fabBundle',
'parameters' : {
'qFXF2qwDGF6DiV7LYcFPnu8ggGuYDnAuv7qjim12BE4AR10DEGHRcbM21TzMAJtZWbfNd73B' : {
'name' : name,
'email' : email,
}
}
};
onboardMerchant('<?php echo $url; ?>', JSON.stringify(body));
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment