@olo/pay-react-native
Version:
Olo Pay React Native SDK
28 lines (27 loc) • 879 B
JavaScript
// Copyright © 2022 Olo Inc. All rights reserved.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
import { useCallback } from 'react';
// Load commands for Fabric
const Commands = require('../components/specs/PaymentCardCvvViewNativeComponent').Commands;
export default function usePaymentCardCvvViewManager() {
const blur = useCallback(ref => {
Commands.blur(ref.current);
}, []);
const focus = useCallback(ref => {
Commands.focus(ref.current);
}, []);
const clear = useCallback(ref => {
Commands.clear(ref.current);
}, []);
const createCvvUpdateToken = useCallback(ref => {
// Result comes via onCvvTokenResult event
Commands.createCvvUpdateToken(ref.current);
}, []);
return {
blur,
clear,
createCvvUpdateToken,
focus
};
}
//# sourceMappingURL=usePaymentCardCvvViewManager.js.map