Skip to content

Commit

Permalink
Add ACCEPT_TERMS_OF_SERVICE event in StripeTerminalProvider (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-lin-bbpos authored Oct 2, 2024
1 parent 11f5df7 commit 3f79277
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/StripeTerminalProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const {
UPDATE_BATTERY_LEVEL,
REPORT_LOW_BATTERY_WARNING,
REPORT_READER_EVENT,
ACCEPT_TERMS_OF_SERVICE,
} = NativeModules.StripeTerminalReactNative.getConstants();

const emitter = new EventEmitter();
Expand Down Expand Up @@ -269,6 +270,11 @@ export function StripeTerminalProvider({
[log]
);

const didAcceptTermsOfService = useCallback(() => {
log('didAcceptTermsOfService');
emitter?.emit(ACCEPT_TERMS_OF_SERVICE);
}, [log]);

useListener(REPORT_AVAILABLE_UPDATE, didReportAvailableUpdate);
useListener(START_INSTALLING_UPDATE, didStartInstallingUpdate);
useListener(REPORT_UPDATE_PROGRESS, didReportReaderSoftwareUpdateProgress);
Expand Down Expand Up @@ -298,6 +304,7 @@ export function StripeTerminalProvider({
useListener(UPDATE_BATTERY_LEVEL, didUpdateBatteryLevel);
useListener(REPORT_LOW_BATTERY_WARNING, didReportLowBatteryWarning);
useListener(REPORT_READER_EVENT, didReportReaderEvent);
useListener(ACCEPT_TERMS_OF_SERVICE, didAcceptTermsOfService);

const tokenProviderHandler = async ({
callbackId,
Expand Down

0 comments on commit 3f79277

Please sign in to comment.