0.0.15 • Published 1 year ago

rm-plugin v0.0.15

Weekly downloads
13
License
MIT
Repository
github
Last release
1 year ago

RM Plugin SDK

Support for Merchant App, Terminal and Merchant Portal

Install

$ npm install rm-plugin

Usage

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);
    }
})
0.0.15

1 year ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago