@olo/pay-react-native
Version:
Olo Pay React Native SDK
27 lines • 908 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/PaymentCardDetailsFormNativeComponent').Commands;
export default function usePaymentCardDetailsFormManager() {
const blur = useCallback(ref => {
Commands.blur(ref.current);
}, []);
const focus = useCallback((ref, field) => {
Commands.focus(ref.current, field);
}, []);
const clear = useCallback(ref => {
Commands.clear(ref.current);
}, []);
const createPaymentMethod = useCallback(ref => {
// Result comes via onPaymentMethodResult event
Commands.createPaymentMethod(ref.current);
}, []);
return {
blur,
clear,
focus,
createPaymentMethod
};
}
//# sourceMappingURL=usePaymentCardDetailsFormManager.js.map