Example implementation using React Native Library:
import { PosBuddy } from 'react-native-thumbzup-pos-buddy';
const posBuddy = new PosBuddy();
// Your device identifier is displayed in the Thumbzup PoS Buddy client on your payment device.
posBuddy.connect('device identifier', (nextStatus: PbStatus) =>
console.log('Connection status', nextStatus)
);
// Authenticate.
posBuddy.setPosId(appKey);
posBuddy.setMerchantId(merchantId);
posBuddy.setAuthenticationKey(authenticationKey);
posBuddy.doPosAuth(({ secretKey, accessKey }) => {
// Keep `obj.authenticationKey` for your session.
});
// Make a payment.
posBuddy.doPayment(totalAmountInCents, (obj: any) => {
// View the payment outcome in the `obj.receiptBundle`.
});