Skip to content

Instantly share code, notes, and snippets.

@echr
Created June 7, 2017 04:37
Show Gist options
  • Save echr/eec6d3573c82896ab7529a16ae5d4ed0 to your computer and use it in GitHub Desktop.
Save echr/eec6d3573c82896ab7529a16ae5d4ed0 to your computer and use it in GitHub Desktop.
Old SDK webview
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Webview Page</title>
</head>
<body>
<noscript>
Please enable javascript
</noscript>
<script id="mp-snippet">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
window.mhAsyncInit = function() {
MP.COLOR_THEME = 'green';
MP.APP_KEY = 'CHANGE_WITH_YOUR_APP_KEY';
MP.SHOW_NAVBAR = false; //set false, if you want disable the widget navbar and using the native apps navbar
};
//-- EVENT API
window.mhOnWidgetLoaded = function() {
// OPEN THE WIDGET AUTOMATICALLY WHEN PAGE LOADED
MP.openWidget();
};
window.mhOnWidgetOpen = function() {
// PUT EVENT HERE
console.log("it's Open!");
};
window.mhOnTransactionSuccess = function() {
// PUT EVENT HERE
};
//SDK Snippet
!function(a,b,c){var d=a.createElement(b),e=a.getElementById("mp-snippet");
d.async=!0,d.id=c,d.src="https://mpwidget.s3.amazonaws.com/dist/v0.5.0/jssdk.min.js",
e.parentNode.insertBefore(d,e)}(document,"script","mp-widget");
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment