react-native-sp-reader-sdk
Dependencies
react-native
version >0.40
Installation
Check the wiki for instructions.
Usage
import ReaderSDK from 'react-native-sp-reader-sdk';
Example
class testApp extends Component {
constructor() {
super();
const readerSdk = new ReaderSDK();
readerSdk.initSdk();
readerSDK.authorizeWithCode("1234567").then(() => {
}).catch((err) => {
})
const isLoggedIn = await readerSdk.isLoggedIn();
readerSDK.setCheckoutParameters(
ReaderSDK
.AdditionalPaymentTypes
.MANUAL_CARD_ENTRY,
null,
tipsEnabled,
false,
false,
true,
false,
false,
);
readerSDK.presentReaderSettingsScreen(
true,
);
const isLoggedIn = readerSDK.isLoggedIn()
.then(isLoggedIn => {
});
readerSDK.requestPermissions()
.then((permissions) => {
if (permissions != null) {
let permissionsGranted;
if (notAndroid) {
const {
appLocationPermission,
deviceLocationEnabled,
appRecordingPermission,
} = permissions;
}
}
});
readerSDK.checkoutWithAmount(
100,
'This is a transaction',
).then((result) => {
})
.catch((e) => {
});
readerSDK.deauthorize();
}
...
}