git clone git@github.com:gsmainclusivetechlab/mmapi-javascript-sdk.git -b develop
export MMAPI_JAVASCRIPT_SDK=$(pwd)/mmapi-javascript-sdk
cd $MMAPI_JAVASCRIPT_SDK
GSMA_BASE_URL=https://sandbox.mobilemoneyapi.io/simulator/v1.2/passthrough/mm/
GSMA_BASE_URL_AUTH=https://sandbox.mobilemoneyapi.io/2/oauth/simulator/v1.2/mm/
GSMA_TOKEN_URL=https://sandbox.mobilemoneyapi.io/v1/oauth/accesstoken/
After the build, the final javascript SDK file mmsdk.min.js will be in the folder dist.
npm install
npm run build
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GSMA</title>
</head>
<body>
<h1 class="main"></h1>
<script src="mmsdk.min.js"></script>
<script>
// Init with Standard Auth
gsma.initStandardAuth({
username: '<consumer key>',
pass: '<consumer secret>',
apiKey: '<api key>',
callbackUrl: '<callback url>',
onFailure: (error) => {
console.log('init failed stdAuth', error);
},
onSuccess: (success) => {
console.log('init success stdAuth', success);
},
});
</script>
<script>
console.log(window.gsma.auth);
</script>
</body>
</html>