https://github.com/revenuemonster/rm-plugin
Revenue Monster Plugins for Merchant Portal, Terminal and Merchant App
https://github.com/revenuemonster/rm-plugin
add-on android ios plugin react react-native revenuemonster
Last synced: 3 months ago
JSON representation
Revenue Monster Plugins for Merchant Portal, Terminal and Merchant App
- Host: GitHub
- URL: https://github.com/revenuemonster/rm-plugin
- Owner: RevenueMonster
- Created: 2020-03-23T16:02:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T07:13:11.000Z (over 3 years ago)
- Last Synced: 2025-08-09T15:31:08.128Z (12 months ago)
- Topics: add-on, android, ios, plugin, react, react-native, revenuemonster
- Language: JavaScript
- Homepage: https://revenuemonster.my
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RM Plugin SDK 
##### Support for Merchant App, Terminal and Merchant Portal
## Release
When someone changes the version in package.json to 1.2.3 and pushes a commit with the message Release 1.2.3, the github action will create a new tag v1.2.3 and publish the package to the npm registry.
## Install
```
$ npm install rm-plugin
```
## Usage
```js
import rm from "rm-plugin";
// get signed request
rm.getSignedRequest({
success: function ({ signedRequest, platform }) {
console.log("signedRequest: ", signedRequest, " platform: ", platform);
},
});
// get platform
const platform = rm.getPlatform();
// show toast message
rm.showToast({
type: "success", // success, error (only for web portal)
title: "hello",
});
// scan qrcode (only for terminal and merchant-app)
rm.scanCode({
success: function (resp) {
console.log("success: ", resp.code);
},
fail: function () {
console.log("failed");
},
complete: function () {
console.log("complete");
},
});
// show loading
rm.showLoading();
// hide loading
rm.hideLoading();
// show alert (only for terminal and merchant-app)
rm.showAlert({
type: "success", // success, error
title: "hello world",
});
// print receipt (only for terminal)
rm.printReceipt({
data: {}, // object
});
// show navbar title (only for terminal and merchant-app)
rm.setBarTitle({
title: "hello world",
});
// set storage by key and value
rm.setStorage({
key: "test",
value: "token",
});
// get storage by key name
rm.getStorage({
key: "test",
success: function ({ data }) {
console.log("content", data);
},
});
```