const handleApproveOrder = getHandleApproveOrder({ authState });
const onSubmit = useCallback(
async (data, actions) => {
const { attributes, paymentGatewayProperties } = await handleApproveOrder(
data,
actions
);
const paymentRequest = {
...
paymentGatewayProperties,
attributes,
} as PaymentRequest;
// add payment with paymentRequest payload
})