This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a state token to prevent request forgery. | |
// Store it in the session for later validation. | |
$state = md5(rand()); | |
$app['session']->set('state', $state); | |
// Set the client ID, token state, and application name in the HTML while | |
// serving it. | |
return $app['twig']->render('index.html', array( | |
'CLIENT_ID' => CLIENT_ID, | |
'STATE' => $state, | |
'APPLICATION_NAME' => APPLICATION_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -230,7 +230,7 @@ | |
/* 3rd, 4th, etc level categories */ | |
div.ecwid-categories-MenuBarPopup td.gwt-MenuItem { | |
padding: 3px 40px 3px 10px; | |
- width: 100%; | |
+ width: auto; | |
} | |
@@ -3250,7 +3250,8 @@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EcwidCheckout.setConfig({ | |
currency: {precision:2,roundScale:100,prefix:'$',suffix:'',code:'USD'}, | |
weightUnit: 'POUND', | |
storeName: 'Test store', | |
companyEmail: '[email protected]', | |
storeUrl: 'http://www.example.com', | |
dateFormat: 'MMM d, yyyy', | |
timeFormat: 'hh:mm a', | |
timeZone: 'PST' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.ControlPanelJSLoaded = function() { EcwidCheckout.init({/* something */}); }; | |
var script = document.createElement('SCRIPT'); | |
script.src = "https://checkout.ecwid.com/controlpanel-api.js"; | |
script.charset = "utf-8"; | |
script.setAttribute("type", "text/javascript"); | |
script.onerror = function() { alert('Could not load script'); }; | |
document.body.appendChild(script); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('CHECKOUT_WIDGET_OWNERID', 'TEST-123'); | |
define('CHECKOUT_WIDGET_KEY', 'secret'); | |
$timestamp = time(); | |
$signature = hash_hmac( "sha1", CHECKOUT_WIDGET_OWNERID." ".$timestamp, CHECKOUT_WIDGET_KEY); | |
?> | |
<script src="https://checkout.ecwid.com/controlpanel-api.js" type="text/javascript" charset="UTF-8"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://checkout.ecwid.com/controlpanel-api.js" type="text/javascript" charset="UTF-8"></script> | |
<script> | |
EcwidCheckout.OnChanged.add(function() { | |
alert("My change event handler"); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//app.ecwid.com/script.js?1003" type="text/javascript" charset="UTF-8"></script> | |
<script> | |
Ecwid.OnPageLoad.add(function(page) { | |
alert("My page load handler: "+page.type); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//app.ecwid.com/script.js?1003" type="text/javascript" charset="UTF-8"></script> | |
<script> | |
function dump(arr,level) { | |
var dumped_text = ""; | |
if (!level) level = 0; | |
// The padding given at the beginning of the line. | |
var level_padding = ""; | |
for (var j=0;j<level+1;j++) level_padding += " "; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//app.ecwid.com/script.js?1003" type="text/javascript" charset="UTF-8"></script> | |
<script> | |
Ecwid.OnAPILoaded.add(function() { | |
// Ecwid API is available, do something | |
alert(Ecwid.formatCurrency(123.45)); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Ecwid.OnAPILoaded.add(function() { | |
window.Ecwid.setSignInProvider({ | |
addSignInLinkToPB: function() { return true; }, | |
signIn: function () { alert('sign in'); | |
window.Ecwid.setSsoProfile('<?php echo "$message $hmac $timestamp"; ?>'); | |
}, | |
canSignOut: function() { return true; }, | |
signOut: function () { alert('sign out') } | |
}); | |
}); |
NewerOlder