HMS In-App Payment plugin for Cordova Android
Link to full Cordova project: https://github.com/bryantvu/Cordova-HMS-IAP-Demo
Initialize project: https://cordova.apache.org/docs/en/latest/guide/cli/
cordova create hello com.bvutest.iapdemo HelloWorld
Navigate into project folder
cd hello
Add Android platform
cordova platform add android
Download and extract files
Navigate to root folder and open shell
cordova plugin add /path/to/plugin/IapWrapper
Copy 'android-debug-keys.properties' and 'debug.p12' from plugin root folder to /platforms in project
Add function to www/js/index.js and call from 'onDeviceReady: function()'
cordova.plugins.IapWrapper.getNonConsumables(
success =>{
alert("success >> " + success);
}, error => {
alert("fail >> " + error);
});
cordova run android